Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help] Teleport player to next map OnPickup
dasde Offline
Junior Member

Posts: 30
Threads: 6
Joined: May 2011
Reputation: 0
#1
[Help] Teleport player to next map OnPickup

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:

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
(This post was last modified: 07-08-2011, 02:00 PM by dasde.)
07-08-2011, 01:54 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: [Help] Teleport player to next map OnPickup

I see what you did wrong.

Try this:

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
Find
dasde Offline
Junior Member

Posts: 30
Threads: 6
Joined: May 2011
Reputation: 0
#3
RE: [Help] Teleport player to next map OnPickup

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

Try this:

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?
07-08-2011, 02:15 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#4
RE: [Help] Teleport player to next map OnPickup

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

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

07-08-2011, 02:20 PM
Find
dasde Offline
Junior Member

Posts: 30
Threads: 6
Joined: May 2011
Reputation: 0
#5
RE: [Help] Teleport player to next map OnPickup

Alright, now the screen turned black and faded into the same level and same potion as when I picked up the potion.
(This post was last modified: 07-08-2011, 02:36 PM by dasde.)
07-08-2011, 02:27 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#6
RE: [Help] Teleport player to next map OnPickup

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

07-08-2011, 02:53 PM
Website Find
Synatic Offline
Junior Member

Posts: 46
Threads: 2
Joined: Jun 2011
Reputation: 1
#7
RE: [Help] Teleport player to next map OnPickup

i think the custom story Wake uses that, not?

http://www.youtube.com/user/ChaoticMonki...BCmBEGLDxw
07-08-2011, 02:59 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#8
RE: [Help] Teleport player to next map OnPickup

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
Website Find
dasde Offline
Junior Member

Posts: 30
Threads: 6
Joined: May 2011
Reputation: 0
#9
RE: [Help] Teleport player to next map OnPickup

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

07-08-2011, 03:32 PM
Find




Users browsing this thread: 2 Guest(s)