Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: organican on October 19, 2004, 09:52:17 AM

Title: Why didn't I think of that?!
Post by: organican on October 19, 2004, 09:52:17 AM
...
How was I supposed to solve this?
Then it hit me:
the script of an object or entity is reloaded each time the object is...
so if I put:

global whatever_active;
if ( whatever_active==1)
   {this.Active=false; }

inside the objects script, then each time you enter the scene or reload the window,
the object or entity will become inactive if the variable is 1.

Pure genious!

Just say inside the snow's script:
global snow_active;
if (snow_active==1)
{ this.Active=false; }

on "lamp"
{ this.Active=false;
snow_active=1;
actor.Talk("Look, the snow melts away... and there's something...");
actor.Talk("*Activates the laser ultra 200 000 setting*...");
actor.Talk("Oops, I burned down the entire house, and the city's all in flames...");
actor.Talk("Game over, man, game over. But at least the snow won't be there anymore.");
}

So now whenever you use the lamp on the snow, it will hide,
and it will stay hidden whenever you come back to this place.
Way to go!

(it works with =false and ="anything you like" as well,
instead of =1.)

Some of you probably already knew this,
but newbies might find this useful.
(I know I did.)

(Edit: this is especially useful if you have any number of windows where objects can be taken or removed or become visible/invisible. It's in windows that this really RoXs ::rock