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


Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change map with area...
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#1
Change map with area...

So, I want the player to walk into an area and it's supposed to change level. I'm pretty sure this is possible since the creator of 'Killings in Alstadt' did this. Amnesia doesn't crash and I don't get an error message, but I know I'm not doing anything wrong. This is the part of the script:

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""ChangeLevel_1""LeaveMap_1"true1);
}

void LeaveMap_1(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""player_bodyfall.snt""Player"0.1ffalse);
FadeOut(2.0f);
ChangeMap("InsideCabin.map""PlayerStartArea_2""""");
}

void OnLeave()
{
SetupLoadScreen("LoadingText""load_1"1"game_loading_well.jpg");


edit for no bump: I had named the ScriptArea in the level editor and the script differently
Spoiler below!

[Image: picard-facepalm.jpg?1240934151]

(This post was last modified: 03-29-2013, 12:32 PM by Tiger.)
03-09-2013, 12:43 AM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Change map with area...

capital P in player.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
03-09-2013, 01:27 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#3
RE: Change map with area...

.snt", "player", 0


Yeah capital P right here


.snt", "Player", 0

03-09-2013, 01:38 AM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#4
RE: Change map with area...

Still doesn't work. I also changed the 'player_bodyfall5.snt' to 'player_bodyfall.snt', but to no avail.
03-09-2013, 01:38 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#5
RE: Change map with area...

There two places where you need a capital P. One for AddEntityCollideCallback and one for PlaySoundAtEntity.

In Ruins [WIP]
03-09-2013, 03:46 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#6
RE: Change map with area...

ollideCallback("player", "Cha
TO
ollideCallback("Player", "Cha

03-09-2013, 04:23 AM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#7
RE: Change map with area...

Like I said, it doesn't work...
03-09-2013, 11:27 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Change map with area...

Run the script again, then check the hpl.log for any insight.

Tutorials: From Noob to Pro
03-09-2013, 11:56 AM
Website Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#9
RE: Change map with area...

I have no idea what to do with the hpl.log ._.
03-10-2013, 10:26 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#10
RE: Change map with area...

(03-09-2013, 12:43 AM)Tigerwaw Wrote: So, I want the player to walk into an area and it's supposed to change level. I'm pretty sure this is possible since the creator of 'Killings in Alstadt' did this. Amnesia doesn't crash and I don't get an error message, but I know I'm not doing anything wrong. This is the part of the script:

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""ChangeLevel_1""LeaveMap_1"true1);
}

void LeaveMap_1(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""player_bodyfall.snt""Player"0.1ffalse);
FadeOut(2.0f);
ChangeMap("InsideCabin.map""PlayerStartArea_2""""");
}

void OnLeave()
{
SetupLoadScreen("LoadingText""load_1"1"game_loading_well.jpg");


Shouldn't the :
PHP Code: (Select All)
AddEntityCollideCallback("Player""ChangeLevel_1""LeaveMap_1"true1); 
change into :
PHP Code: (Select All)
AddEntityCollideCallback("Player""ChangeLevel_1""LeaveMap_1"true0); 
?

[Image: the-cabin-in-the-woods-masked-people.jpg]
03-10-2013, 11:14 AM
Find




Users browsing this thread: 2 Guest(s)