Frictional Games Forum (read-only)

Full Version: Making a timed room transition
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok
To go into more detail, im trying to make a script for a map in which you are transitioned into the map (Irrelevant), then after a set time, you automatically move to a new map.
------
void OnStart()
{
AddTimer("Countdown", 500f, "CountdownHallucination");
}

void CountdownHallucination(string &in asTimer)
{
ChangeMap("map 3.map", "PlayerStartArea_1", "player_climb.snt", "player_crouch.snt");
}
------
^^ Is what i currently have, and the script is accepted, but after the 500f, nothing happens. I even left it for longer and nothing happens.
What am i not doing here?

As usual, any guidance is much appreciated.
(10-02-2010, 06:08 AM)Chilton Wrote: [ -> ]Ok
To go into more detail, im trying to make a script for a map in which you are transitioned into the map (Irrelevant), then after a set time, you automatically move to a new map.
------
void OnStart()
{
AddTimer("Countdown", 500f, "CountdownHallucination");
}

void CountdownHallucination(string &in asTimer)
{
ChangeMap("map 3.map", "PlayerStartArea_1", "player_climb.snt", "player_crouch.snt");
}
------
^^ Is what i currently have, and the script is accepted, but after the 500f, nothing happens. I even left it for longer and nothing happens.
What am i not doing here?

As usual, any guidance is much appreciated.

Well I just tested something and it worked for me. Try this.

Code:
void CountdownHallucination(string &in asTimer)
{
    ChangeMap("map3.map", "PlayerStartArea_1", "", "");

}

OnStart
Code:
AddTimer("Countdown", 10.0, "CountdownHallucination");

I noticed you have a space in your map name "map 3.map". It's probably best to not have any spaces, underscore would be a better option. Also.. I'm not sure why it would work using "500f", since I get an error with that. "500.0f" is what it should be, or "500" or "500.0" (without the quotation marks of course ^_^).

This is coming from someone with no other scripting experience other than Amnesia. So don't take my word for it Big Grin
(10-02-2010, 07:38 AM)Alexander Wrote: [ -> ]
(10-02-2010, 06:08 AM)Chilton Wrote: [ -> ]Ok
To go into more detail, im trying to make a script for a map in which you are transitioned into the map (Irrelevant), then after a set time, you automatically move to a new map.
------
void OnStart()
{
AddTimer("Countdown", 500f, "CountdownHallucination");
}

void CountdownHallucination(string &in asTimer)
{
ChangeMap("map 3.map", "PlayerStartArea_1", "player_climb.snt", "player_crouch.snt");
}
------
^^ Is what i currently have, and the script is accepted, but after the 500f, nothing happens. I even left it for longer and nothing happens.
What am i not doing here?

As usual, any guidance is much appreciated.

Well I just tested something and it worked for me. Try this.

Code:
void CountdownHallucination(string &in asTimer)
{
    ChangeMap("map3.map", "PlayerStartArea_1", "", "");

}

OnStart
Code:
AddTimer("Countdown", 10.0, "CountdownHallucination");

I noticed you have a space in your map name "map 3.map". It's probably best to not have any spaces, underscore would be a better option. Also.. I'm not sure why it would work using "500f", since I get an error with that. "500.0f" is what it should be, or "500" or "500.0" (without the quotation marks of course ^_^).

This is coming from someone with no other scripting experience other than Amnesia. So don't take my word for it Big Grin

Removed 500f, and renamed the maps a bit, and now it magically works.
Im not even going to read in to how such tiny things made a difference, but the important thing is that it wont happen again

Thankyou very much
Wow! That was quick. Glad to hear you have it working now Smile
(10-02-2010, 07:44 AM)Alexander Wrote: [ -> ]Wow! That was quick. Glad to hear you have it working now Smile

Oh, Alexander, ok... Well, i dont know how to say this, but could you wait a moment, i need to kill you if you dont mind. Its ok. Death on swift wings will come for you, and by my hand you will be rendered whole again... Wait, this is a forum Smile