Damascus
Senior Member
Posts: 646
Threads: 118
Joined: Mar 2012
Reputation:
29
|
RE: Teleporting items & Vaporizing items
If you want the item to appear exactly back where it was in the same position, use this command:
ResetProp(string& asName);
It will return an item to its original state and location as it was when the map was loaded.
|
|
10-22-2012, 12:58 AM |
|
ZodiaC
Member
Posts: 120
Threads: 8
Joined: Oct 2012
Reputation:
2
|
RE: Teleporting items & Vaporizing items
(10-22-2012, 12:58 AM)Damascus Wrote: If you want the item to appear exactly back where it was in the same position, use this command:
ResetProp(string& asName);
It will return an item to its original state and location as it was when the map was loaded. Thanks it works perfectly!But it works only one time...How can i make it work every time the item leaves the region?
|
|
10-22-2012, 12:40 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Teleporting items & Vaporizing items
AddEntityCollideCallback("nameofitem", "ScriptReturn", "REturn", false, -1)
void REturn(string &in asParent, string &in asChild, int alState);
{
ResetProp(string &in asName);
}
The false is that it will always repeat.
The -1 is when it leaves the area.
Combine beecake's script with this one and it should work.
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
10-22-2012, 01:31 PM |
|
ZodiaC
Member
Posts: 120
Threads: 8
Joined: Oct 2012
Reputation:
2
|
RE: Teleporting items & Vaporizing items
(10-22-2012, 01:31 PM)The chaser Wrote: AddEntityCollideCallback("nameofitem", "ScriptReturn", "REturn", false, -1)
void REturn(string &in asParent, string &in asChild, int alState);
{
ResetProp(string &in asName);
}
The false is that it will always repeat.
The -1 is when it leaves the area.
Combine beecake's script with this one and it should work. it was so simple!
|
|
10-22-2012, 01:52 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Teleporting items & Vaporizing items
(10-21-2012, 09:46 PM)belikov Wrote: (10-21-2012, 06:49 PM)beecake Wrote: you can always use the ""+something
I sometimes do this: AddTimer("Timer_"+RandInt(1, 3), 5, "Timer");
void Timer(string &in asTimer)
{
if(asTimer == "Timer_1")
{
}
if(asTimer == "Timer_2")
{
}
if(asTimer == "Timer_3")
{
}
}
understand? well i got the "For" command
but this confuses me.. :/
The "Timer_"+RandInt(1, 3)" makes 3 timers with names : Timer_1,Timer_2 and Timer_3 ?
And what exactly you compare in the "If" commands? What it does is:
There are 3 timers. You call "Timer_" and then it picks a random number from 1 to 3, which is added to the name Timer_. This results in a random timer being called It's just another way to use ""+Something
Trying is the first step to success.
|
|
10-25-2012, 09:37 PM |
|
ZodiaC
Member
Posts: 120
Threads: 8
Joined: Oct 2012
Reputation:
2
|
RE: Teleporting items & Vaporizing items
(10-25-2012, 09:37 PM)beecake Wrote: What it does is:
There are 3 timers. You call "Timer_" and then it picks a random number from 1 to 3, which is added to the name Timer_. This results in a random timer being called It's just another way to use ""+Something I didn't noticed the rand command..Pretty cool!!I like this kind of commands!
Thanks for sharing them!
|
|
10-25-2012, 10:21 PM |
|
|