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
Bit of an issue with my script
A Tricky Carnie Offline
Member

Posts: 72
Threads: 15
Joined: Sep 2011
Reputation: 0
#1
Bit of an issue with my script

There seems to be a problem with my script that when I enter the map it gives me this error:
Quote: (1,1): ERR: No matching signatures to 'OnGameStart()' main (29,2): ERR : Unexpected end of file

Now I've never seen the 'OnGameStart(),' so I replaced my 'OnStart()' line to 'OnGameStart().' So now my script looks like this:
Quote:////////////////////////////
// Run when entering map
void OnGameStart()
{
SetEntityConnectionStateChangeCallback("lever_small01_1", "SecretDoor");
AddUseItemCallback("", "key_torture_chamber_1", "castle_2", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_2", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_2", 0, false);
RemoveItem("key_torture_chamber_1");
}

void SecretDoor(string &in asEntity, int alState)
{
if (alState == -1)
{
SetMoveObjectState("castle_portcullis_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "close_gate", 0, false);
return;
}
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
However I'm still getting the same error and I have no idea what to do. If anyone knows what to do the help would be appreciated. Also I did do a search on "OnGameStart()' on the wiki and didn't find anything but like I said, if anyone could point me in the right direction it'd be appreciated.

(This post was last modified: 02-27-2012, 07:27 PM by A Tricky Carnie.)
02-27-2012, 06:08 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Bit of an issue with my script

Try OnStart()

and then make a void OnEnter()

and OnLeave

Try if it works when you have all those 3

(This post was last modified: 02-27-2012, 06:33 PM by SilentStriker.)
02-27-2012, 06:30 PM
Find
A Tricky Carnie Offline
Member

Posts: 72
Threads: 15
Joined: Sep 2011
Reputation: 0
#3
RE: Bit of an issue with my script

(02-27-2012, 06:30 PM)SilentStriker Wrote: Try OnStart()

and then make a void OnEnter()

and OnLeave

Try if it works when you have all those 3
nope I get the same error.

02-27-2012, 06:42 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: Bit of an issue with my script

Try setting up a global.hps in your custom story folder (The one where the maps folder is) and in it, put
void OnGameStart()
{

}

02-27-2012, 06:57 PM
Find
A Tricky Carnie Offline
Member

Posts: 72
Threads: 15
Joined: Sep 2011
Reputation: 0
#5
RE: Bit of an issue with my script

(02-27-2012, 06:57 PM)Obliviator27 Wrote: Try setting up a global.hps in your custom story folder (The one where the maps folder is) and in it, put
void OnGameStart()
{

}
That didn't seem to work. Just to make sure, the global.hps should be in amnesia the dark descent\custom_stories\[name of custom story]

(This post was last modified: 02-27-2012, 07:14 PM by A Tricky Carnie.)
02-27-2012, 07:14 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#6
RE: Bit of an issue with my script

Yes, that's where it's supposed to go. Assuming you're still getting the same error, try just putting
void OnGameStart()
{

}
into your .hps. Leave the code block empty, and put everything else in your OnStart function.
If the error still appears, then I'm out of ideas.

02-27-2012, 07:20 PM
Find
A Tricky Carnie Offline
Member

Posts: 72
Threads: 15
Joined: Sep 2011
Reputation: 0
#7
RE: Bit of an issue with my script

I found the issue, it seems that I was so focused on the 'OnGameStart()' because I've never seen that before, that I completely missed the fact that my void OnLeave command was missing a closing curly bracket underneath it.

I feel dumb.

But thanks for the help.

(This post was last modified: 02-27-2012, 07:26 PM by A Tricky Carnie.)
02-27-2012, 07:26 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#8
RE: Bit of an issue with my script

Don't feel dumb. Nobody else caught it. ^^

02-27-2012, 07:28 PM
Find




Users browsing this thread: 1 Guest(s)