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?
MissMarilynn Offline
Member

Posts: 77
Threads: 23
Joined: Oct 2011
Reputation: 1
#3
RE: How do I make a ladder teleport you to next level?

(01-09-2012, 07:45 PM)Inurias Wrote: (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
I do have a working script file, yes. Could you make an example of the script I would need to make? Thank you. Smile
01-09-2012, 07:48 PM
Find


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



Users browsing this thread: 3 Guest(s)