Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wait time script possible ?
Author Message
sassix Offline
Member

Posts: 56
Joined: Jan 2011
Reputation: 0
Post: #1
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
Find all posts by this user Quote this message in a reply
ModManDann Offline
Member

Posts: 61
Joined: Dec 2010
Reputation: 0
Post: #2
RE: wait time script possible ?

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

Current project: Mind Trap
(This post was last modified: 01-10-2011 02:17 AM by ModManDann.)
01-10-2011 02:16 AM
Find all posts by this user Quote this message in a reply
DIGI Byte Offline
Senior Member

Posts: 376
Joined: Dec 2010
Reputation: 1
Post: #3
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
Find all posts by this user Quote this message in a reply
sassix Offline
Member

Posts: 56
Joined: Jan 2011
Reputation: 0
Post: #4
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
Find all posts by this user Quote this message in a reply
DIGI Byte Offline
Senior Member

Posts: 376
Joined: Dec 2010
Reputation: 1
Post: #5
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
Find all posts by this user Quote this message in a reply
sassix Offline
Member

Posts: 56
Joined: Jan 2011
Reputation: 0
Post: #6
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
Find all posts by this user Quote this message in a reply
DIGI Byte Offline
Senior Member

Posts: 376
Joined: Dec 2010
Reputation: 1
Post: #7
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
Find all posts by this user Quote this message in a reply
sassix Offline
Member

Posts: 56
Joined: Jan 2011
Reputation: 0
Post: #8
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
Find all posts by this user Quote this message in a reply
Frontcannon Offline
Senior Member

Posts: 538
Joined: Jul 2010
Reputation: 2
Post: #9
RE: wait time script possible ?

You're not calling action_step1 anywhere.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-10-2011 06:47 PM
Find all posts by this user Quote this message in a reply
sassix Offline
Member

Posts: 56
Joined: Jan 2011
Reputation: 0
Post: #10
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 Confused
01-10-2011 06:51 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)