CREATOR4's Forum Posts

  • Seems that if you invert the parent object's width, some children animations are successfully flipped. X and Y location seems to work. Angle does not work

  • Is this possible yet?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If angle(sprite.x, sprite.y, mouse.x, mouse.y) is between angles 0 and 180, set sprite angle towards mouse

  • Apparently it just doesn’t work with some devices. Never had any issues myself, but I’ve seen people recommend using C3’s Photon plugin instead for this reason

    Photon is pretty easy. If you understand C3’s multiplayer you should be able to figure out Photon

  • Here are some things you can try

    - Change your Z elevation sorting code so that it only applies to WorldObjects on screen. You can do this by adding the “is on screen” condition

    - The above may result in flickering at the edges of the screen as objects sort as they come on screen. To solve this I like to make an invisible sprite, stretch it 2-3x larger than the screen, and then do an overlapping check with that object for sorting instead of “is on screen”

    - Try not doing an overlap check to destroy overlapping objects every tick. You only need that once, after all the objects are created, right?

    - Not sure how much this will impact, but you could try only doing greenery health checks after subtracting health from them

    - I would definitely try to figure out a way to do your terrain via tilemaps instead of separate objects. You can probably figure out a way to do the 1px lower effect with tilemaps

  • Debug mode usually gives lower FPS than non-debug mode because the debug viewer itself is taking resources

    Construct can handle very large layouts as long as you do it correctly. It's hard to know why your game would slow down without seeing what you're doing tho. Can you post some screenshots of whatever you think is slowing the game down? Or a project file?

  • I played around and here's another way

    Add all objects you'd like to check to a Family

    Then just check the Family.Count before and after creation

  • Put "Wait 0 seconds" after you create the object

    This will wait 1 tick/1 frame, which will give time for the object to be created

  • If you're using 8 Direction, both Sprites are probably responding to the arrow key presses, because by default movement is enabled in the 8 Direction behavior. Make sure that Sprite 1 and Sprite 2 both have their movement behaviors disabled by default. Then have the host enable movement for sprite 1 only on their end

  • lionz is right

    However, there are cases where you might want to do it the way you're doing it

    The reason it's not working is because the "On Created" is triggering as soon as the Pistol is spawned, but before the pistol has been assigned an ID

    the "On Created" trigger will activate as soon as an object is created, run the actions in this event, and then Construct will go back to where it left off

    This isn't the case inside Functions. Inside functions, outside triggers will only be activated after the entire function has run. So you could put the pistol spawning and ID setting behavior inside a function, and it should work

    The other way to deal with this is to put a "wait 0 seconds" as the first action in the second group of events. "Wait 0 seconds" waits until the next tick. So The pistol will be created, the "On Created" trigger will be activated, but then it will wait for 1 full tick before running the pin action, which will give the first group of events time to set the ID

  • You do not have permission to view this post

  • dropbox.com/s/5ene2o4byir2x4w/GrappleFix.c3p

    I got it working

    I made the hand perform the "add joint" action on the arm, instead of the other way around

    I also found out you have to enable physics on every object that's either adding a joint or being jointed, so both the arm and the hand in this case

    In this demo you can just click anywhere and the hand will act as if it's grappled onto something

  • If down arrow key is being pressed, set tank's targetAngle variable to 90 (down)

    If tank's angle is not equal to tank's targetAngle, smoothly rotate tank towards targetAngle

    Else, move tank

  • I don't have much experience using physics, so I may be wrong, but I think you could try using Physics for this. Using joints to connect the grapple object, arm, and player

  • You can't pick a BadTroop by UID, and then pick a different BadTroop by UID in a subevent. Pick By UID only succeeds if the object you're picking is within the group of already-picked object. And since the first Pick BadTroop By UID narrows the picked group of BadTroops down to a singular BadTroop, the second one won't work unless it's the same exact BadTroop that was already picked (that was a tongue twister)

    But what's really messing you up here is the "Pick All GoodTroops." This is resetting the picking done in ForEach. Then you are picking a single GoodTroop, checking if the BadTroop it's targeting is the same BadTroop that was already picked earlier, and then telling all GoodTroops to shoot at it.

    Not only is "PickAllGoodTroops" messing your code up, but you don't need it. You're already looping through each GoodTroop to begin with, so any code in the ForEach will run for every single GoodTroop