Frictional Games Forum (read-only)
Change map with area... - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Change map with area... (/thread-20669.html)

Pages: 1 2


RE: Change map with area... - The chaser - 03-10-2013

Check map_caches.


RE: Change map with area... - Tiger - 03-10-2013

(03-10-2013, 11:14 AM)No Author Wrote: Shouldn't the :
PHP Code:
AddEntityCollideCallback("Player""ChangeLevel_1""LeaveMap_1"true1); 
change into :
PHP Code:
AddEntityCollideCallback("Player""ChangeLevel_1""LeaveMap_1"true0); 
?

Doesn't really matter.

No map_caches either.


RE: Change map with area... - No Author - 03-11-2013

Remember to put the EXACT name of the area where you exit the map.


RE: Change map with area... - PutraenusAlivius - 03-11-2013

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

PHP Code:
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:
AddEntityCollideCallback("Player""ChangeLevel_1""LeaveMap_1"true1); 
change into :
PHP Code:
AddEntityCollideCallback("Player""ChangeLevel_1""LeaveMap_1"true0); 
?
Changing the integer from 1 to 0 makes the player to change level when it's not colliding. No changes.


RE: Change map with area... - richm0nkey - 03-11-2013

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.


RE: Change map with area... - PutraenusAlivius - 03-11-2013

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


RE: Change map with area... - Adrianis - 03-13-2013

(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