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
Jovismcp Offline
Junior Member

Posts: 6
Threads: 1
Joined: Jul 2011
Reputation: 0
#3
RE: Scripting help needed

(07-16-2011, 04:01 PM)palistov Wrote: 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.

I've got all of those functions in my script and it seems correct, but it still doesn't work. It doesn't crash when I run it but for some reason, since I posted originally, the map that I load isn't the same as the map on the level editor. It contains all of the same fog effects and billboards but some of the static objects I added afterwards aren't there, there's just an extended floor where they should be, which isn't on the level editor, I've tried removing it and replacing it but it still seems to be there. There just seems to be a massive string of problems that don't like being solved.
07-17-2011, 09:07 AM
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)