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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Changing map without a level door?
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#1
Question  Changing map without a level door?

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?
(This post was last modified: 11-05-2012, 05:38 PM by Tiger.)
11-04-2012, 06:41 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Changing map without a level door?

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.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-04-2012, 06:48 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#3
RE: Changing map without a level door?

(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
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Changing map without a level door?

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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-04-2012, 06:52 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Changing map without a level door?

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

Trying is the first step to success.
11-04-2012, 06:57 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#6
RE: Changing map without a level door?

(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
(This post was last modified: 11-04-2012, 07:05 PM by Tiger.)
11-04-2012, 07:02 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#7
RE: Changing map without a level door?

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
Find
ZeroPie Offline
Junior Member

Posts: 15
Threads: 2
Joined: Apr 2012
Reputation: 0
#8
RE: Changing map without a level door?

(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.
11-05-2012, 02:11 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: Changing map without a level door?

Wrong syntax again Smile You wrote "intalState" when it should be "int alState"
Yes spaces are important too!

Trying is the first step to success.
11-05-2012, 07:27 AM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#10
RE: Changing map without a level door?

(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
11-05-2012, 11:44 AM
Find




Users browsing this thread: 1 Guest(s)