Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help] Teleport player to next map OnPickup
Author Message
dasde Offline
Junior Member

Posts: 30
Joined: May 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #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 all posts by this user Quote this message in a reply
dasde Offline
Junior Member

Posts: 30
Joined: May 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #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 all posts by this user Quote this message in a reply
dasde Offline
Junior Member

Posts: 30
Joined: May 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Synatic Offline
Junior Member

Posts: 46
Joined: Jun 2011
Reputation: 1
Post: #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 all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
dasde Offline
Junior Member

Posts: 30
Joined: May 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)