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
Script doesn't work?
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#2
RE: Script doesn't work?

Is that the entire contents of your map script file? If so, then that's why it isn't working. The structure of the script files have changed from Amnesia. Where Amnesia's script files were just a bunch of root-level functions (like yours), SOMA's script files are fully enclosed in class objects like this:


class MapClass : cLuxMap
{
    void Setup()
    {

    }

    void OnStart()
    {
        cLux_AddDebugMessage("Hello.");
    }

    void OnEnter()
    {

    }

    void OnLeave()
    {

    }
}

Also, you shouldn't ever need to manually create the map script file yourself. When you create a map with the level editor, the script file ("MapName.hps") will automatically be generated in the same folder as your map with this whole structure along with all the common map functions. I don't recommend changing the default names of the class or those pre-generated functions unless you know what you are doing. (You can create your own custom functions as much as you want, though.)

For a description of all the map functions and how they work, you can read this page on the wiki. For a more general overview on how AngelScript in HPL3 works, I'd recommend following this tutorial.

(This post was last modified: 10-24-2018, 07:38 PM by Abion47.)
10-24-2018, 07:35 PM
Find


Messages In This Thread
Script doesn't work? - by Henriksen - 10-24-2018, 05:45 PM
RE: Script doesn't work? - by Abion47 - 10-24-2018, 07:35 PM
RE: Script doesn't work? - by Henriksen - 10-24-2018, 07:52 PM
RE: Script doesn't work? - by Abion47 - 10-25-2018, 02:57 AM
RE: Script doesn't work? - by Henriksen - 10-25-2018, 08:05 PM



Users browsing this thread: 1 Guest(s)