Frictional Games Forum (read-only)

Full Version: Changing map without a level door?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I'm making a custom story where in one part you're supposed to change map by walking on a static_object. I've tried putting a ScriptArea there with the following script:


void OnStart()
{
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1);
}

void ChangeMap_1
{
ChangeMap("MyMapName.map", "PlayerStartArea_1, "", "")
}


I've looked on the wiki and tried googling it. I can't find anything about it. Can somebody please help me?
void OnStart()

{

AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1);

}



void ChangeMap_1 (string &in asParent, string &in asChild, intalState)

{

ChangeMap("MyMapName.map", "PlayerStartArea_1, "", "")

}

Every function (or void) has a syntax. You didn't have one.
(11-04-2012, 06:48 PM)The chaser Wrote: [ -> ]void OnStart()

{

AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1);

}



void ChangeMap_1 (string &in asParent, string &in asChild, intalState)

{

ChangeMap("MyMapName.map", "PlayerStartArea_1, "", "")

}

Every function (or void) has a syntax. You didn't have one.
Ah! Thanks a lot! Big Grin
(11-04-2012, 06:50 PM)Tigerwaw Wrote: [ -> ]
(11-04-2012, 06:48 PM)The chaser Wrote: [ -> ]void OnStart()

{

AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1);

}



void ChangeMap_1 (string &in asParent, string &in asChild, int alState)

{

ChangeMap("MyMapName.map", "PlayerStartArea_1, "", "")

}

Every function (or void) has a syntax. You didn't have one.
Ah! Thanks a lot! Big Grin
Sorry, a part of the syntax was wrong. Now it's corrected.
(11-04-2012, 06:52 PM)The chaser Wrote: [ -> ]Sorry, a part of the syntax was wrong. Now it's corrected.
Yeah, it didn't work at first. Thanks Big Grin

beecake Wrote:Maybe you can use this: http://www.frictionalgames.com/forum/thread-18368.html

Thanks. I've wondered what all that means. Smile
So this is what my script looks like now:


void OnStart()
{
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1);
}

void ChangeMap_1 (string &in asParent, string &in asChild, intalState)
{
ChangeMap("MapName.map", "PlayerStartArea_2", "player_jump6.ogg", "player_bodyfall5.ogg")
}

Amnesia crashes when I open my custom story. Why?
(11-04-2012, 11:48 PM)Tigerwaw Wrote: [ -> ]So this is what my script looks like now:


void OnStart()
{
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1);
}

void ChangeMap_1 (string &in asParent, string &in asChild, intalState)
{
ChangeMap("MapName.map", "PlayerStartArea_2", "player_jump6.ogg", "player_bodyfall5.ogg")
}

Amnesia crashes when I open my custom story. Why?
On the ChangeMap("MapName.map", "PlayerStartArea_2", "player_jump6.ogg", "player_bodyfall5.ogg") add a ;
This must be used after every script is typed out, so use this:
ChangeMap("MapName.map", "PlayerStartArea_2", "player_jump6.ogg", "player_bodyfall5.ogg");

Hope it helps.
Wrong syntax again Smile You wrote "intalState" when it should be "int alState"
Yes spaces are important too!
(11-05-2012, 07:27 AM)beecake Wrote: [ -> ]Wrong syntax again Smile You wrote "intalState" when it should be "int alState"
Yes spaces are important too!
Aw cr*p. I thought I had looked through the whole script :c
Thanks for noticing Big Grin