99Instances2Go's Recent Forum Activity

  • 1/. The function had no idea wich object to perform its action on, because you did not pick one. And 2/. All the other events had the same problem.

    You gots to learn how to pick objects, what the SOL (Selected Object List) stands for, and how to filter it with conditions.

    https://www.dropbox.com/s/2oofikpuwzezh ... .capx?dl=0

    Look at event 5. The 'on collision' auto picks 2 objects. The playerbox & obj_weaponItems where the playerbox collided with. Now the SOL conatains those two objects. Meaning, we still need to add the right obj_slots to the SOL. That is wat the 'pick by comparisation' does.

    At this moment the SOL contains the playerbox, the right obj_weaponItems & the right obj_slots. Any action adressed to any of those objects in that event will only adress THOSE objects that are in the SOL. And that is basecaly how c2 works.

  • Besides that it is to much code for only 'that' ....

    Your problem are the origins in the animation frames. They are way out of center, actual showing the graphic content out of the viewport.

  • Sounds like you need to use the condition ...

    Sprite > Pick nearest/furthest ... x= Player.X & y = Player.Y

  • Not really.

    You did't change that '0.3' each tick, and therefor you got one value in return.

    The lerp should be lerp(50, 800, 0>1), where '0>1' is a value that counts from 0 to 1 in a time you choose.

    The solution you found is kinda a 'fake' solution. It works, well kinda, that lerp will never reach 800.

    It works because the distance between 'Object.Width' and '800' gets smaller.

    If you cant wrap your mind arround 'lerp' then maybe you better use LiteTween.

    Just a friendly suggestion.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Need to use 'else'.

    Right now 'set to 1' makes '= 1' true. If true it is 'set to 2' and that makes '=2' true. And so on.

  • On startup of layout (event 1), i place the targets. Because i use a container to pair up text boxes with targets, i got to create them on run time. Because i was to lazy to calculate positions, i prepared some objects in the layout to place the targets on.

    Event 7 reads as: if instance variable 'targetUID' of the mover = -1, then pick the mover, and add a random target to the picklist. Move the picked mover to the picked target. At the same time i set 'targetUID' to UID of the choosen target. I reset the 'overlappingTime' of that target. I write that (zero) in the textbox belonging to that target. Since i use containers, picking a target also picks its text box. And, so i can see (and debug what i am dooing) i set the opacity of that choosen target, so it stands out. This event (event 7) will not run again untill 'targetUID' is set to -1 again in event 15. Why -1 and not zero ? Because the UID zero can exist. It is bad coding to take that risk.

    Event 9 reads as: Pick the target by its UID (instance variable 'targetUID' of the mover). Add the mover to that picklist when its boolean 'StartedOverlapping' is not true. If the picked target overlaps the picked mover then ... and only the first tick that all this is true ... set 'StartedOverlapping' to true.

    So. When the mover overlaps that choosen target (not any other target) set a boolean to true, so we know that from this moment we have to count the time that they are overlapping.

    Event 11 is the opposite of event 9. If i set a boolean, i have to unset it somewhere.

    So, event 11 reads as: if the boolean 'StartedOverlapping' is set to true and if the mover is not overlapping any target, then pick the mover. And set 'StartedOverlapping' to false.

    Also meaning that there can be no more time added in event 13. Done with overlapping = stop the timer.

    Event 13 is the counter. It reads as: if 'StartedOverlapping' is true, then pick the mover. If that mover is overlapping any target, then add that target to the picklist. 'StartedOverlapping' is only set (in event 9) when the target is the choosen target, so i can safely asume that any target picked here is the choosen target. When all this happen, add dt to the timer every tick. And show that time in the (due the container) picked textbox.

    Event 15 just sets instance variable 'targetUID' of the mover to -1when the MoveTo plugin says it reached destiny. With 'targetUID' = -1, event 9 can again find a new target. And it all starts all over again.

    Basicaly most coding in C2 works this way: pick an object when something is true. Add another object to that picklist when something is true. Make actions that work on the picked objects.

  • I still perceive the cursor movements as disturbing.

    In GTA, i beleive, the aiming cross is not acting as a cursor. I beleive that it is not locked to the mouse. Also the aiming cross dissapears when bringing up the wheel.

    I think (just an opinion as so many) if you see the aiming cross as 'the direction it will shoot to', things will get easyer to archive. Then the aiming cross can move on a fixed circle arround the player. Effectively show direction the player is shooting towards. Now it is easy to snap that aiming cross back to that place after un-showing the wheel.

    The aiming cross is (in my eyes) not needed to make a selection in the wheel. (see my example). With that cross hopping arround, that HUD gets to complex.

    Using the mouse wheel would be the most natural way to choose, but, on 'touch' thats not gonna work.

    So maybe, if you wanna do this on 'touch' too, why not use the actual 'touch'/'mouse' to choose from the wheel. And use a controlled aiming cross to represent the direction that one shoots to.

    Just mumbling, dont mind me.

  • Yesh ! Or two squares, or 3. Saw you wanted to animate the tilemap, wich is btw a very good idea, if you ask me.

    If have not idea if you can do it in a 'range'. Just suggested it.

  • Still not as fast as ... if you can do it with Tile > Set tile range.

    But thanks for the JSON string.

  • Are you perhaps making a platformer? Instead of a physics game ?

    Start up Construct 2. Choose New in the file menu. Now you have a list with templates.

    Look for the template 'Platform 6 (slopes & moving platforms)'.

    It explains how to 'stand' on a moving platform (using sine behavior).

  • Okay,

    so you are in the layout (tab),

    you open the Z order bar from the ribbon (or you have the z order bar pinned),

    you switch to te event sheet by clicking its tab ....

    Now the Z order bar is showing the objects.

    Wich is, i agree a bit confusing. Althaught i never used it that way, so it never botherd me.

    Now, when you try to change something in the Z order bar, the Z order bar goes empty. No object dissapears, the Z order bar just shows empty. Wich (mayby just maybe) should have happend (to avoid confusing) on the moment that you switched to the event sheet (by clicking its tab).

    It is really not needed to change Z orders while working in the event sheet. I never had the need to do that. Just like i never had the need to place tiles from the tile bar into the layout when working in a event sheet.

    My 2 cents.

99Instances2Go's avatar

99Instances2Go

Member since 12 Feb, 2016

Twitter
99Instances2Go has 2 followers

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies