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

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#11
RE: Change map with area...

Check map_caches.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
03-10-2013, 12:32 PM
Find
Tiger Away
Posting Freak

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

(03-10-2013, 11:14 AM)No Author Wrote: 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); 
?

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
Find
No Author Offline
Posting Freak

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

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

[Image: the-cabin-in-the-woods-masked-people.jpg]
03-11-2013, 07:56 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#14
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:

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); 
?
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
Find
richm0nkey Offline
Junior Member

Posts: 35
Threads: 9
Joined: Feb 2013
Reputation: 1
#15
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
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#16
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
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#17
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
Find




Users browsing this thread: 1 Guest(s)