The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Change map with area...
Check map_caches.
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
03-10-2013, 12:32 PM |
|
Tiger
Posting Freak
Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation:
55
|
RE: Change map with area...
(03-10-2013, 11:14 AM)No Author Wrote: Shouldn't the :
AddEntityCollideCallback("Player", "ChangeLevel_1", "LeaveMap_1", true, 1);
change into :
AddEntityCollideCallback("Player", "ChangeLevel_1", "LeaveMap_1", true, 0);
?
Doesn't really matter.
No map_caches either.
(This post was last modified: 03-10-2013, 10:01 PM by Tiger.)
|
|
03-10-2013, 10:00 PM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Change map with area...
Remember to put the EXACT name of the area where you exit the map.
|
|
03-11-2013, 07:56 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Change map with area...
(03-10-2013, 11:14 AM)No Author Wrote: (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:
void OnStart() { AddEntityCollideCallback("Player", "ChangeLevel_1", "LeaveMap_1", true, 1); }
void LeaveMap_1(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "player_bodyfall.snt", "Player", 0.1f, false); FadeOut(2.0f); ChangeMap("InsideCabin.map", "PlayerStartArea_2", "", ""); }
void OnLeave() { SetupLoadScreen("LoadingText", "load_1", 1, "game_loading_well.jpg"); }
Shouldn't the :
AddEntityCollideCallback("Player", "ChangeLevel_1", "LeaveMap_1", true, 1);
change into :
AddEntityCollideCallback("Player", "ChangeLevel_1", "LeaveMap_1", true, 0);
? Changing the integer from 1 to 0 makes the player to change level when it's not colliding. No changes.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
03-11-2013, 08:13 AM |
|
richm0nkey
Junior Member
Posts: 35
Threads: 9
Joined: Feb 2013
Reputation:
1
|
RE: Change map with area...
Instead of using OnStart() to add the collide callback try using OnEnter() to see if it is because of a game save.
Make sure there are no game saves that are being loaded before testing the map. Press the start button on the custom story menu instead of continue.
Not sure if using continue after saving progress on a map Nullifies any functions under the OnStart() part of scripts but its worth a shot.
|
|
03-11-2013, 09:59 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Change map with area...
(03-11-2013, 09:59 AM)richm0nkey Wrote: Instead of using OnStart() to add the collide callback try using OnEnter() to see if it is because of a game save.
Dude, if he put it on the void OnEnter() part, he will change map everytime he collided with that area.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
03-11-2013, 10:02 AM |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
RE: Change map with area...
(03-11-2013, 10:02 AM)JustAnotherPlayer Wrote: (03-11-2013, 09:59 AM)richm0nkey Wrote: Instead of using OnStart() to add the collide callback try using OnEnter() to see if it is because of a game save.
Dude, if he put it on the void OnEnter() part, he will change map everytime he collided with that area.
The callback would have been set up the first time the map was run, and it would be saved when the player leaves/exits the map. Only when the callback is removed (either by using RemoveCollide.. or after being activated with delete set to true) would it not be present if you load up a saved game.
If its in OnEnter, then the callback will be set up every time the map is loaded, which would be a problem if it's a one-time only event.
Tigerwaw - Do you hear the sound / have the screen fade when you collide with that area?
If not, check to make sure the area is a Script area, and that it's name is exactly as it appears in the script.
Failing these, make the area really big to make sure it's not just that the player's body is not colliding with it.
Also, check the names of the map & start pos area in the map you are trying to go to.
Finally, try removing the .map at the end of the map name to see if that makes a difference
|
|
03-13-2013, 01:24 PM |
|
|