Eventing question

Get help using Construct 2

Post » Wed May 23, 2012 11:28 pm



i was thinking that subevents keep the picked objects

the image shows a working version, but without the additional var comparison, the counters add up to eachother(both the hpfight objects), so the picking must be wrong and doesnt account for the parent comparisment

any idea why it would do it like this?
vtrix2012-05-23 23:34:42
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Thu May 24, 2012 1:54 pm

Could you make a simpler demo in a new .capx? It might make it easier to understand, without the specifics of your project.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Thu May 24, 2012 3:34 pm

@Ashley

capx

so in this example, i would expect that the parent event picks the right object and the subevent would add to the correct counter, instead they are adding up on each    ( press space to add to counter )

ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Thu May 24, 2012 3:46 pm

The issue here is the order you use the trigger.
Triggers are "out of the code" in their execution.

You can see the picking is correct for the "every 1 sec" event, it still is a strange logic imo, but it does keep the picking of the parent event.

When you press space, the trigger is not considered a subevent.
But you can then affine the picking as subevent of the trigger "on space pressed".

Working capx
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu May 24, 2012 4:50 pm

@Kyatric, appreciate the help but this is a very simple example, i was using the enemy and player var as a "state" where under everything is related to the enemy or the player, so i dont have to repeat the statement and can have multiple actions or conditions under this, i think it makes sense

i already had a working version, if you add isplayer var to the trigger is works, so i rather was asking why it didnt take its parent condition into account, where does it state that triggers are "out of the code" can i have comfirmation that this is the only way it suppose to work @Ashley
vtrix2012-05-24 16:51:25
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests