Text and local variable.

Discussion and feedback on Construct 2

Post » Sat Apr 08, 2017 5:00 pm

post deleted
Last edited by NetOne on Thu Apr 13, 2017 4:21 pm, edited 1 time in total.
...
B
46
S
24
G
7
Posts: 329
Reputation: 8,223

Post » Sat Apr 08, 2017 11:49 pm

the code is always run downwards it would not go up to check if the group is active. if the group was not active the key press trigger will not even run.

As you wish & whatever dude.

Allow me to quote some one smarter


Ashley wrote: --- left out a few lines here--
Triggers in subevents check all their parent events are true, but the "else" is checked on its own without referring to previous events in that case, so it probably doesn't do what you want.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Apr 09, 2017 7:57 am

99Instances2Go wrote:the code is always run downwards it would not go up to check if the group is active. if the group was not active the key press trigger will not even run.

As you wish & whatever dude.

Allow me to quote some one smarter


Ashley wrote: --- left out a few lines here--
Triggers in subevents check all their parent Events are true, but the "else" is checked on its own without referring to previous events in that case, so it probably doesn't do what you want.


I wasn't trying to be smart / rude. Sorry if it came over like that. I was just trying to be helpfull with what can be quite a confusing subject.
I am still pretty much a noob here and very happy to be corrected for the benefit of myself and others reading.

Ashley is talking about Triggers in sub events but you are talking about Trigger events inside Groups.

My thinking was that, as the code runs down, if it finds a deactivated group then it just bypasses all the Events within. So its like that Trigger Event doesn't even exist for that cycle.

But you are saying that Groups are actually just Events with a "Is group active" flag? And that if a Group is deactivated the Trigger Events inside still fire but they also go up to check if the parent Group Event is active before running any of their Actions???

I am happy to entertain that, it makes sense, and the outcome should be the same.

If this is correct I am happy to delete my post above to avoid confusion.
Are we 100% that those triggers are still checked? It would be good to know as I read a lot of people on here spending a lot of time using groups to "Optimize their code" rather than just for turning bits on and off here and there. It would make that sort of optimization pointless if all those triggers are still being checked.
...
B
46
S
24
G
7
Posts: 329
Reputation: 8,223

Post » Sun Apr 09, 2017 8:25 pm

That is actual very easy to show, so you dont have to take me on my word.
https://www.dropbox.com/s/ezceqtejd2u3x ... .capx?dl=0

In fact, it is not exactly known when a trigger fires insight the tick. For the 'hardware readers' (mouse, keyboard, Ajax) there is no rule. It depends on the device and on the browser. Some triggers just have to run at the start of a tick, else they dont make sense. The 'On landed' by instance. Platform has a 'push out of solid' routine. Evaluating a position under 'On landed' should give the position after the 'push out of solid', even if you set the position to something else later in the events.

The only thing that is for sure, is that a trigger fires only once in the same tick.

A Group is just a condition as all other conditions. It has a system Boolean 'activated', false or true. And it will evaluate that Boolean every tick. Every condition under a condition is a sub condition.

So, again. What happens of you bury a trigger (there are false triggers too) deep (or not that deep) down in sub events ? It triggers and looks up to find out if it can run its actions/subs.

Do not quote me (stealing the possibility for me to erase my dumb comments, and dude, this whole forum has dumb post from me, till i learned something about the subject) and then offer to erase your own posts. Tyvm.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Apr 13, 2017 4:20 pm

@99Instances2Go

Holy cow......OK..i see.....well, that changes a lot of things.......

thanks for taking the time......I am enlightened...

will delete my post above......(and try to stop being a noob)....

cheers....
...
B
46
S
24
G
7
Posts: 329
Reputation: 8,223

Post » Thu Apr 13, 2017 4:34 pm

99Instances2Go wrote:That is actual very easy to show, so you dont have to take me on my word.
https://www.dropbox.com/s/ezceqtejd2u3x ... .capx?dl=0

In fact, it is not exactly known when a trigger fires insight the tick. For the 'hardware readers' (mouse, keyboard, Ajax) there is no rule. It depends on the device and on the browser. Some triggers just have to run at the start of a tick, else they dont make sense. The 'On landed' by instance. Platform has a 'push out of solid' routine. Evaluating a position under 'On landed' should give the position after the 'push out of solid', even if you set the position to something else later in the events.

The only thing that is for sure, is that a trigger fires only once in the same tick.

A Group is just a condition as all other conditions. It has a system Boolean 'activated', false or true. And it will evaluate that Boolean every tick. Every condition under a condition is a sub condition.

So, again. What happens of you bury a trigger (there are false triggers too) deep (or not that deep) down in sub events ? It triggers and looks up to find out if it can run its actions/subs.

Do not quote me (stealing the possibility for me to erase my dumb comments, and dude, this whole forum has dumb post from me, till i learned something about the subject) and then offer to erase your own posts. Tyvm.


It's unusual behavior for me, no programming language I've learned has a condition that works like that.
I'm not saying it's a bad thing, I'm just saying I've never seen anything like it.

Thanks!.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Thu Apr 13, 2017 5:09 pm

yea

Im still trying to get my head around it.

looking at 99Instances2Go's capx

even if you deactivate the group on start of layout, or even just right click disable the group in the editor, the trigger still runs if the set text code is outside the group!!!!

This is screwing with my head. just when I though i was understanding C2,,,,
...
B
46
S
24
G
7
Posts: 329
Reputation: 8,223

Post » Thu Apr 13, 2017 5:13 pm

NetOne wrote:yea

Im still trying to get my head around it.

looking at 99Instances2Go's capx

even if you deactivate the group on start of layout, or even just right click disable the group in the editor, the trigger still runs if the set text code is outside the group!!!!

This is screwing with my head. just when I though i was understanding C2,,,,


Yes, it seems that the trigger works with the group disabled but its actions (in case of shooting) will not be performed.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Thu Apr 13, 2017 5:18 pm

Dont stop being a noob. I would not have learned 1 thing without being a noob myself + combined with all the other noobs on this forum. The main goal is to learn (for me it is)

I acted (yeah my toes are to long, i apologise) as i did because i took you as 'no noob'.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests