Redneb27
Junior Member
Posts: 10
Threads: 4
Joined: Jul 2012
Reputation:
0
|
Scripting errors.
I just started trying to create my own custom story, and I dont know hardly anything about scripting. All Im trying to do is make a key unlock a door right now. I get an unexpected token { error and a couple other errors. My scripting is probably full of errors, so can someone take a look at it and help me?
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
}
void (string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|
|
07-17-2012, 07:34 PM |
|
Traggey
is mildly amused
Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation:
185
|
RE: Scripting errors.
Wrong section, moved to development support.
|
|
07-17-2012, 07:39 PM |
|
JMFStorm
Member
Posts: 205
Threads: 8
Joined: Aug 2011
Reputation:
28
|
RE: Scripting errors.
void KeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}
|
|
07-17-2012, 07:41 PM |
|
Redneb27
Junior Member
Posts: 10
Threads: 4
Joined: Jul 2012
Reputation:
0
|
RE: Scripting errors.
(07-17-2012, 07:41 PM)JMFStorm Wrote: void KeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
} Okay I did that and it did remove one of the errors, but I still get an unexpected token { error. Is there something else wrong?
|
|
07-17-2012, 08:16 PM |
|
Kazakarumariou
An angry man.
Posts: 283
Threads: 8
Joined: Jul 2012
Reputation:
14
|
RE: Scripting errors.
Post the entire script again. You might have did something when most likely copying and pasting JMFStorm's script
|
|
07-17-2012, 10:00 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Scripting errors.
JMFStorm forgot to remove the semicolon in the function header that isn't supposed to be there.
|
|
07-18-2012, 12:24 AM |
|
Kazakarumariou
An angry man.
Posts: 283
Threads: 8
Joined: Jul 2012
Reputation:
14
|
RE: Scripting errors.
Oh yeah
void KeyOnDoor(string &in asItem, string &in asEntity)
(This post was last modified: 07-18-2012, 12:41 AM by Kazakarumariou.)
|
|
07-18-2012, 12:41 AM |
|
Redneb27
Junior Member
Posts: 10
Threads: 4
Joined: Jul 2012
Reputation:
0
|
RE: Scripting errors.
Thanks guys. I got it working.
|
|
07-19-2012, 04:28 AM |
|
|