lionz's Forum Posts

  • Since you gave a lot of info I worked on the file for you, and added a status variable you can use to track what the bee is doing. You will notice this also takes out the need to deactivate groups because it now relies on the status of the bee.

    dropbox.com/scl/fi/wsttb3wgqe2vd8q7y54wr/Percival_edited.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The order matters here, the 'for each' should be at the top

  • Well you are almost there haha, it's another condition called 'is touching object'

  • It will fly up because you have it set to MoveTo the player so there are no real restrictions. You can try forcing its Y position if you want to keep it at one level. To return to its patrol behaviour you'll have to add more logic to make it return to a certain location since it can escape the boundaries when it has LOS.

  • It won't affect the performance. To trim it down you could put the animation name and text to display as instance variables on the Interact object. Then it would be one event 'set animation to Interact.var1' and 'set text to Interact.var2'

  • It's because your events for mirrored in the LOS group are true even if the bee does not have LOS. You need to put those events as a sub event under the 'bee has LOS' event so it only forces the facing towards the player when the bee can see the player.

  • When you use the create object action, any actions underneath apply to that instance so you can set the instance variable at that point.

  • Yeah you can pick them out with different instance variable values if they do different things. Depends what exactly they are used for. If you want to display text you can set the text in an instance variable on the object itself and say on object clicked > display text object.text

  • I see ; I will try what you propose ! R0J0hound.

    lionz

    My understanding is, "On object clicked" should be accompagnied with another condition that specify WHICH instance was clicked, isn't it ? Because each instance has a specific causal effect, so the rest of the code must evolve accordingly to which specific instance was clicked.

    Am I being clear ?

    Nope it just picks the one that was clicked. The actions next to it only apply to that one instance.

  • > If it is based on which one the player clicks, you can use the condition 'on object clicked' under the Mouse object conditions.

    Hye !

    yes, I know about that condition ; my main problem is to identify WHICH object is clicked, since there's only one object, but many instances of it. Each instance should not have the same result ; hence my need to be able to identify every instance individually on runtime.

    'On object clicked' picks the instance that you clicked, then when you run actions it will be on only the instance that was clicked.

  • If it is based on which one the player clicks, you can use the condition 'on object clicked' under the Mouse object conditions.

  • Probably what you are looking for is the ScrollTo behaviour. Add it to the player object and the camera will follow the player.

  • Yes, was thinking that could be a fix, wouldn't be too difficult.

    And that might help me establish other variables easily with an (on created) for the cards too if I load them up somewhere

    Hoping to understand why it wouldn't create an object with the instance variables set though.

    Think of it less of a fix and more just that's how Construct works. It needs the initial instance to get info from. Or you can set 'on created' if you are applying to each instance manually.

  • Yeah that works. You removed the is playing check and instead added it in the same event with a wait so that's another way of doing it. They key thing is each event is a trigger once type event!

  • The top event you added runs constantly and overrules a lot of the events, as a habit you shouldn't really put trigger events (green arrow) as sub events. To fix this, delete the 2 duplicated events you won't need them, and bring the 'is animation playing' up to the main level not a sub event. Then for the two 'is animation playing' events you add the condition directly to each one if direction_left is true, and one where direction_left is false.