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
Scripting help needed
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Scripting help needed

Does Amnesia crash when you start up one of your scripted maps, or is it that your scripted events just don't happen at all?

If it's a crash on mapstart, fix the errors in your script file then try again. If it's your script simply not doing anything, make sure:

1) Your map's name and script file's name match: mymap.map & mymap.hps
2) Make sure your script has these three functions somewhere in it: void OnStart() {} void OnEnter() {} & void OnLeave() {}
3) Make sure for things like collide callbacks, item interactions, etc that they are added in your OnStart function. Collisions don't happen when they aren't declared, and interactions don't exist unless they are declared, etc. Make sure the functions have the proper tags too.

A function called by a collision between two entities needs this tag:
void YourCollisionCallback(string &in parent, string &in child, int state) {}

A function called after a timer runs out will have this tag:
void YourTimerCallback(string &in timer) {}

There are other types too, and if they aren't correct then the function won't do anything, and you might even crash on mapstart.

(This post was last modified: 07-16-2011, 04:05 PM by palistov.)
07-16-2011, 04:01 PM
Find


Messages In This Thread
Scripting help needed - by Jovismcp - 07-16-2011, 01:15 PM
RE: Scripting help needed - by palistov - 07-16-2011, 04:01 PM
RE: Scripting help needed - by Jovismcp - 07-17-2011, 09:07 AM
RE: Scripting help needed - by palistov - 07-17-2011, 09:09 AM
RE: Scripting help needed - by Jovismcp - 07-17-2011, 09:19 AM
RE: Scripting help needed - by palistov - 07-17-2011, 09:32 AM
RE: Scripting help needed - by Jovismcp - 07-17-2011, 09:48 AM
RE: Scripting help needed - by Jovismcp - 07-17-2011, 09:23 PM



Users browsing this thread: 1 Guest(s)