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 Editor Help How do I make a ladder teleport you to next level?
Inurias Offline
Junior Member

Posts: 20
Threads: 0
Joined: Jan 2012
Reputation: 2
#2
RE: How do I make a ladder teleport you to next level?

(I am assuming that you already created a working script file for the corresponding map. If this is not the case, google up the basics about scripting with hpl2, also, this link could help you a lot: http://wiki.frictionalgames.com/hpl2/start)



First you add a ScriptArea to your desired location, after that, you add a "AddEntityCollideCallback" call into your initializing function (most likely "OnStart" in your case), you do this by using:

void AddEntityCollideCallback(string& asParentName, string&  asChildName, string& asFunction, bool abDeleteOnCollide, int  alStates);

Callback syntax: void MyFunc(string &in asParent, string &in asChild, int alState)
alState: 1 = enter, -1 = leave

asParentName - internal name of main object
asChildName - internal name of object that collides with main object (asterix (*) NOT supported!)
asFunction - function to call
abDeleteOnCollide - determines whether the callback after it was called
alStates - 1 = only enter, -1 = only leave, 0 = both


Then, in your CallBack function you use:

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

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
(This post was last modified: 01-09-2012, 07:45 PM by Inurias.)
01-09-2012, 07:45 PM
Find


Messages In This Thread
RE: How do I make a ladder teleport you to next level? - by Inurias - 01-09-2012, 07:45 PM



Users browsing this thread: 2 Guest(s)