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
Level doors with different shape
Modular100 Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2011
Reputation: 0
#1
Level doors with different shape

I'm currently working on a custom story, and in the beginning, the player has to crawl up through a pipe in order to get inside a castle. My question is, how can I make a hatch inside the pipe have the same function as a level door, which is teleporting the player to the next map as soon as it is interacted with. I've got little to none understanding of script whatsoever, so I really need some noob-friendly explanation.
Thanks in advance! Smile
05-14-2011, 12:06 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#2
RE: Level doors with different shape

It's actually really easy Smile
void OnStart()
{
SetEntityPlayerInteractCallback("hatch", "ChangeLevel", true); //Adds a callback to call the function ChangeLevel when "hatch" is interacted with. True simply means that the callback is only called once.
}

void ChangeLevel(string &in entity, string &in type)
{
ChangeMap("01.map", "PlayerStartArea_1", "", ""); //Changes to level "01.map" and you will start at "PlayerStartArea_1", of course change that if you wish.
}

//This is a comment explaining what each line does, and is ignored by the engine Smile
05-14-2011, 12:19 PM
Find
Modular100 Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2011
Reputation: 0
#3
RE: Level doors with different shape

Thanks alot, works perfectly! Smile
05-14-2011, 09:16 PM
Find




Users browsing this thread: 1 Guest(s)