sassix
Member
Posts: 56
Threads: 13
Joined: Jan 2011
Reputation:
0
|
wait time script possible ?
is there a script i didnt see which one pause the script for a peroid of time ?
something like
void Collide_Area(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("cross_small_metal_1", 20, 50, "");
"wait some time"
SetEntityActive("servant_grunt_2" , true);
}
|
|
01-10-2011, 12:25 AM |
|
ModManDann
Member
Posts: 61
Threads: 6
Joined: Dec 2010
Reputation:
0
|
RE: wait time script possible ?
AddTimer(string& asName, float afTime, string& asFunction);
Function(string &in asTimer)
{
// Do stuff here
}
(This post was last modified: 01-10-2011, 02:17 AM by ModManDann.)
|
|
01-10-2011, 02:16 AM |
|
DIGI Byte
Senior Member
Posts: 376
Threads: 20
Joined: Dec 2010
Reputation:
1
|
RE: wait time script possible ?
I'm not aware of a "wait" or a "pause" function, I didn't find one in the script list, and i went over it with an advanced searcher so you have to do a moch delay
as mentioned before
void action_step1(string &in asTimer)
{
AddTimer("delay_timer", 5, "action_step2");
}
void action_step2(string &in asTimer)
{
// Do stuff here
}
(This post was last modified: 01-10-2011, 03:55 AM by DIGI Byte.)
|
|
01-10-2011, 03:54 AM |
|
sassix
Member
Posts: 56
Threads: 13
Joined: Jan 2011
Reputation:
0
|
RE: wait time script possible ?
So it have to look like this ?
void action_step1(string &in asTimer)
{
AddTimer("delay_timer", 5, "action_step2");
StartPlayerLookAt("cross_small_metal_1", 20, 50, "");
SetEntityActive("servant_grunt_2" , true);
}
void action_step2(string &in asTimer)
{
changemap(bla bla bla )
}
|
|
01-10-2011, 06:22 AM |
|
DIGI Byte
Senior Member
Posts: 376
Threads: 20
Joined: Dec 2010
Reputation:
1
|
RE: wait time script possible ?
yes, the "5" in AddTimer("delay_timer", 5, "action_step2");
is how many seconds to delay
|
|
01-10-2011, 06:50 AM |
|
sassix
Member
Posts: 56
Threads: 13
Joined: Jan 2011
Reputation:
0
|
RE: wait time script possible ?
hmm... something still wont workt...
this is my code right now
Quote:void Collide_Area(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("cross_small_metal_1", 20, 50, "");
SetEntityActive("servant_grunt_2" , true);
SetEntityActive("servant_grunt_1" , true);
SetEntityActive("servant_brute_1" , true);
}
void action_step1(string &in asTimer)
{
FadeIn(20);
FadeOut(10);
CompleteQuest("Quest01", "Quest01");
AddTimer("delay_timer", 5, "action_step2");
}
void action_step2(string &in asTimer)
{
ChangeMap("Paranoid.map", "PlayerSpawn1", "", "");
}
before using this i tryed this one
Quote:void Collide_Area(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("cross_small_metal_1", 20, 50, "");
}
void action_step1(string &in asTimer)
{
SetEntityActive("servant_grunt_2" , true);
SetEntityActive("servant_grunt_1" , true);
SetEntityActive("servant_brute_1" , true);
FadeIn(20);
FadeOut(10);
CompleteQuest("Quest01", "Quest01");
AddTimer("delay_timer", 5, "action_step2");
}
void action_step2(string &in asTimer)
{
ChangeMap("Paranoid.map", "PlayerSpawn1", "", "");
}
in the first script the enemys appear and killing me, but i just get my "sry ur dead bla bla" and the maps starts again from beginning ( not loading )
in the second script the player just look at the cross and thats it , nothing happend after 5 seconds :/
ur sure its the right way im using the script ?
(This post was last modified: 01-10-2011, 03:30 PM by sassix.)
|
|
01-10-2011, 03:29 PM |
|
DIGI Byte
Senior Member
Posts: 376
Threads: 20
Joined: Dec 2010
Reputation:
1
|
RE: wait time script possible ?
I haven't tested it, but in theory...
(its 2:30am and I'm sleepy, I'll check out the amnesia script when I wake up)
This might or might not work
void Collide_Area(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("cross_small_metal_1", 20, 50, "");
// sets map_change_part1 as active
SetGlobalVarFloat(change_on_death, 1);
//
SetEntityActive("servant_grunt_2" , true);
SetEntityActive("servant_grunt_1" , true);
SetEntityActive("servant_brute_1" , true);
}
// if map change on death is active and players health goes below 1, play this script
if ( (GetPlayerHealth() < 1) && (change_on_death == 1))
{
void map_change_part1(string &in asTimer)
{
FadeIn(20);
FadeOut(10);
CompleteQuest("Quest01", "Quest01");
AddTimer("delay_timer", 5, "map_change_part2");
}
}
void map_change_part2(string &in asTimer)
{
ChangeMap("Paranoid.map", "PlayerSpawn1", "", "");
}
|
|
01-10-2011, 05:26 PM |
|
sassix
Member
Posts: 56
Threads: 13
Joined: Jan 2011
Reputation:
0
|
RE: wait time script possible ?
y, would be great if u keep helping me, cuz i got a "unexpected token 'if' fatal error :/ well im glad i just need such a script at the first map -.-"
|
|
01-10-2011, 06:07 PM |
|
Frontcannon
Senior Member
Posts: 538
Threads: 10
Joined: Jul 2010
Reputation:
2
|
RE: wait time script possible ?
You're not calling action_step1 anywhere.
╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
|
|
01-10-2011, 06:47 PM |
|
sassix
Member
Posts: 56
Threads: 13
Joined: Jan 2011
Reputation:
0
|
RE: wait time script possible ?
(01-10-2011, 06:47 PM)Frontcannon Wrote: You're not calling action_step1 anywhere.
why action step 1 ? i thought this is a complete new script :S
|
|
01-10-2011, 06:51 PM |
|
|