kriand's Forum Posts

  • When does the loop start? As you describe it, the loop would go through every tick. Or is this event under 'On Start of Layout'?

  • You can do it like this:

    I used ImagePoint 1 as the Center of the Player because the Origin is at the bottom.

    File: 1drv.ms/u/s!Ap_-qxoGKbDchAMg99ldnSwrq9XV (made with C3 editor.construct.net )

  • Make the walls the platform is easy. The Platform behavior has the action "Set angle of gravity". The harder part is to always trigger the change correctly.

  • Easiest way would be to put both objects into a container. Then both objects are bound together and always refer to the 'container partner'. As your code is now, you always refer to all objects without specifying which belong together. I suspect in this case Construct will automatically choose the objects that are closest to each other.

  • I can only advise against using Wait like this. Imagine, the enemy plays the IDLE animation and the Wait command starts. Exactly at this moment you inflict damage on the enemy and a corresponding animation / movement starts. This would be interrupted as soon as the Wait command has expired and the enemy suddenly plays the WALK animation and runs away in one direction. All events that start during the Wait command can be interrupted shortly afterwards.

    If I remember correctly, I've given you an example with the timer behavior. You should use this behavior, since you can also cancel timers at will, or specify further conditions for triggering them.

  • According to your code, you activate the motion simulation for one tick every x seconds. By comparison, how far would a car go if you hit the accelerator for 0.016 seconds?

    Pathfinding also works outside the visible area, but not outside the layout, which you probably mean. In this case, you can also enlarge your layout and fix the camera in the middle. Then you can also spawn opponents out of the field of view and move them with pathfinding.

  • I once modified the 'Flying along' template and for me the 'for each loop' worked just fine:

    1drv.ms/u/s!Ap_-qxoGKbDcg2Y-t8sZ_hyYbypD

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • if you tried just this mechanic in a new project, you would see that it works.

    There must be something else in your project that we can not see on the screenshots. Is there another event that changes back the status of your character?

  • It should work, unless your second person has a status in the variable that does not match any of the ones on your screenshot.

  • Is the string variable a family variable?

  • There are many approaches. It would be important to know how you design your game. Are there different quality levels (normal, rare, magical ...)? Do you use a sprite with different animations for an item type or for each item an extra sprite? What about the enemies and containers?

    Here I have a very simple variant for a still effective drop system. It uses no arrays or dictionaries, but many instance variables. To increase the drop chance of an item within a quality level, you can enter it several times in the list. However, I do not know if there is a limit for a string variable. At some point and for even more accuracy, an array might be needed. But then it gets far more complex and the code much longer.

    1drv.ms/u/s!Ap_-qxoGKbDchALxLOyU3rOHQuJD

    Edit: You should think carefully which objects you are packing into a family! It would be possible to put all enemies and containers into one family and assign them the necessary instance variables. When calling the function, you then select the correct object via the UID. It is always a pain changing everything afterwards.

  • His last comment is 3 years old and he probably will not answer. You can open the RTS Template in free C3 and look how it is done there. editor.construct.net

  • That's how it could work.

  • Maybe it is better to use a different approach. I had created an example in another post. You should try it.

    construct.net/forum/construct-3/how-do-i-8/how-do-i-limit-how-far-a-sprit-136887

    Edit: Main problem in your code is that Touch.X/Y uses he coordinates of an layer with parallax 100,100. You need to use 'Touch.X("HUD")' for example.