Frictional Games Forum (read-only)

Full Version: wait time script possible ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
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);
}
Code:
AddTimer(string& asName, float afTime, string& asFunction);
Function(string &in asTimer)
    {
          // Do stuff here
    }
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

Code:
void action_step1(string &in asTimer)
    {
    AddTimer("delay_timer", 5, "action_step2");
    }

void action_step2(string &in asTimer)
    {
        // Do stuff here
    }
So it have to look like this ?


Code:
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 )
    }
yes, the "5" in AddTimer("delay_timer", 5, "action_step2");
is how many seconds to delay
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 ?
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

Code:
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", "", "");
}
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 -.-"
You're not calling action_step1 anywhere.
(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
Pages: 1 2 3