Frictional Games Forum (read-only)
[Help] Teleport player to next map OnPickup - 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: [Help] Teleport player to next map OnPickup (/thread-9018.html)



[Help] Teleport player to next map OnPickup - dasde - 07-08-2011

Hi guys

My idea is to have two potions, and if the player picks up the right one you get teleported to the next map (Room6.map).

So, I have made this script:

Code:
void Teleportpotion(string &in nextlevel_potion, string &in OnPickup)
{
   TeleportPlayer("Room6.map");
   FadeOut(0);
   FadeIn(20);
}

My potions name is "nextlevel_potion" and I have gave it a CallbackFunc in the level editor "Teleportpotion".

Now, my problem is, when I pickup the potion, nothing happens, and that's where you guys come in. I need your help with this, what did I do wrong?

Thanks


RE: [Help] Teleport player to next map OnPickup - Kyle - 07-08-2011

I see what you did wrong.

Try this:

Code:
void Teleportpotion(string &in asEntity)
{
   TeleportPlayer("Room6.map");
   FadeOut(0);
   FadeIn(20);
}

If it doesn't work, then you messed up the callback.


RE: [Help] Teleport player to next map OnPickup - dasde - 07-08-2011

(07-08-2011, 02:03 PM)Kyle Wrote: I see what you did wrong.

Try this:

Code:
void Teleportpotion(string &in asEntity)
{
   TeleportPlayer("Room6.map");
   FadeOut(0);
   FadeIn(20);
}

If it doesn't work, then you messed up the callback.

Hi, nothing happened again. What do you mean by "..then you messed up the callback.", do I need something in OnStart perhaps?


RE: [Help] Teleport player to next map OnPickup - Kyle - 07-08-2011

You definately need at least some function to call the other function or else it's just sitting there, never to be used.

Put this in your OnStart()

Code:
SetEntityPlayerInteractCallback("nextlevel_potion", "Teleportpotion", true);



RE: [Help] Teleport player to next map OnPickup - dasde - 07-08-2011

Alright, now the screen turned black and faded into the same level and same potion as when I picked up the potion.


RE: [Help] Teleport player to next map OnPickup - Tanshaydar - 07-08-2011

Am I wrong or you can actually trying to make a level transition with TeleportPlayer command?


RE: [Help] Teleport player to next map OnPickup - Synatic - 07-08-2011

i think the custom story Wake uses that, not?

http://www.youtube.com/user/ChaoticMonki#p/c/3/tBCmBEGLDxw


RE: [Help] Teleport player to next map OnPickup - Tanshaydar - 07-08-2011

Yes but if you want to change maps without level doors, you should use this command:

void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);

Immediatly loads another map.

asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded


RE: [Help] Teleport player to next map OnPickup - dasde - 07-08-2011

(07-08-2011, 03:03 PM)Tanshaydar Wrote: Yes but if you want to change maps without level doors, you should use this command:

void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);

Immediatly loads another map.

asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded

Bingo, that did the job.