Scripts / What is the purpose of ActivateIfUsed(e)???

Author
Message
SMS
20
Years of Service
User Offline
Joined: 2nd Dec 2004
Location: United States
Posted: 10th Jan 2016 16:45
I see this in lots of scripts, sometimes right after a Destroy(e).

Many thanks.
wermer
9
Years of Service
User Offline
Joined: 18th Sep 2015
Location:
Posted: 10th Jan 2016 17:29
It activates the entity you set in the "if used" field. It doesn't do anything if you don't set the 'if used' field.
It doesn't need to come after 'destroy'. In scripts like 'plrinzone.lua' it has no purpose when 'if used' is not set. I think it's added to scripts like 'plrinzone.lua' so that people can use the 'if used' field without the need to edit any scripts.
Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Jan 2016 17:37
Right now it is used to spawn hidden objects by putting their "name" in the "ifused" field in question.

The most common usage being to place a bunch of soldiers and set them to "spawn at start = no" and then put the name of said soldiers in the ifused field of a trigger zone to make them appear when the player enters that zone (they must all be named the same)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-12-22 12:17:45
Your offset time is: 2024-12-22 12:17:45