Frictional Games Forum (read-only)
wait time script possible ? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: wait time script possible ? (/thread-6136.html)

Pages: 1 2 3


wait time script possible ? - sassix - 01-10-2011

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);
}


RE: wait time script possible ? - ModManDann - 01-10-2011

Code:
AddTimer(string& asName, float afTime, string& asFunction);
Function(string &in asTimer)
    {
          // Do stuff here
    }



RE: wait time script possible ? - DIGI Byte - 01-10-2011

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
    }



RE: wait time script possible ? - sassix - 01-10-2011

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 )
    }



RE: wait time script possible ? - DIGI Byte - 01-10-2011

yes, the "5" in AddTimer("delay_timer", 5, "action_step2");
is how many seconds to delay


RE: wait time script possible ? - sassix - 01-10-2011

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 ?


RE: wait time script possible ? - DIGI Byte - 01-10-2011

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", "", "");
}



RE: wait time script possible ? - sassix - 01-10-2011

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 -.-"


RE: wait time script possible ? - Frontcannon - 01-10-2011

You're not calling action_step1 anywhere.


RE: wait time script possible ? - sassix - 01-10-2011

(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