Change when- on initialize

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Darkon
Posts: 237
Joined: Sun Jun 20, 2004 9:19 pm
Location: UK

Change when- on initialize

Post by Darkon »

This would make so whenever an element is first created it would trigger an action.

This would be really useful for CE's that you want to have a starting variable, or create something upon first being created.
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

I usually use "Change when delay 0 frames" for this, it works for me... maybe it doesn't work for you for some reason, or did you just not thought about it? :)
User avatar
Darkon
Posts: 237
Joined: Sun Jun 20, 2004 9:19 pm
Location: UK

Post by Darkon »

Just tried what you suggested, didnt seem to do a thing.

And surely that would also trigger whenever that element is changed?
What im suggesting would only happen once, which would be when that element is first created, so even if it changes it wont do it again.
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Don't really know what you mean here... didn't it work?
What is it that you're trying to do?
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> This would make so whenever an element is first created it would trigger
> an action.

This would indeed be cool!

And again: No idea why I've missed to comment on this one so far.

> This would be really useful for CE's that you want to have a starting
> variable, or create something upon first being created.

Well, at least the initial CE value can be specified (which you probably already know.)

Triggering actions for each and every element on game start also seems to be a bit too much, but for every newly created element after the very first start, this would be good.

This could be a CE or "normal" element created from a CE change, but also from a yamyam explosion (or explosion of other elements etc.)

I have just added it to the "change conditions" list in the editor as a new condition "(after/when) creation of <element>". Seems to work fine (although I haven't tested many things with it). I tried to let the player explode if a diamond was created, and then let the player throw a stone through a magic wall, resulting in a diamond. And voila: The player exploded!

Have a look at this in the next pre-release version!
Post Reply