Frictional Games Forum (read-only)

Full Version: [Help] Teleport player to next map OnPickup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
(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?
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);
Alright, now the screen turned black and faded into the same level and same potion as when I picked up the potion.
Am I wrong or you can actually trying to make a level transition with TeleportPlayer command?
i think the custom story Wake uses that, not?

http://www.youtube.com/user/ChaoticMonki...BCmBEGLDxw
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
(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.