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 Help expected ")" or "," help please
Chunckycat12 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Apr 2012
Reputation: 0
#1
expected ")" or "," help please

hi everyone i only started to mod about 3 days ago so bear with me Smile but basically my problem is that whenever i load my amnesia custom map a message appears saying 19,57 expected ")" or "," i have beem trying to do it for hours Angry if anyone sees anything let me know Big Grin


void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScriptArea1", true, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
}
void UsedKeyOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}

void CollideScriptArea1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_1", true, true);
}

void StartMusic(string &in asParent, string &in asChild int alState)-this is 19,57 btw
{
PlayMusic("01_amb_darkness.ogg", true, 0.8, 2, 1, true);
}
(This post was last modified: 04-16-2012, 10:04 PM by Chunckycat12.)
04-16-2012, 08:17 PM
Find
MrIcabod123 Offline
Junior Member

Posts: 43
Threads: 7
Joined: Jan 2012
Reputation: 0
#2
RE: expected ")" or "," help please

Try this:


void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScriptArea1", true, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
}
void UsedKeyOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}

void CollideScriptArea1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_1", true, true);
}

void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("01_amb_darkness.ogg", true, 0.8, 2, 1, true);
}

You forgot the "," after &in asChild
04-16-2012, 08:29 PM
Find
Chunckycat12 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Apr 2012
Reputation: 0
#3
RE: expected ")" or "," help please

Thankyuuuuuuuuuuuu so much its funny how how one little commar can cause so much of a pain in my life
i feel kinda stupid
04-16-2012, 08:43 PM
Find
MrIcabod123 Offline
Junior Member

Posts: 43
Threads: 7
Joined: Jan 2012
Reputation: 0
#4
RE: expected ")" or "," help please

(04-16-2012, 08:43 PM)Chunckycat12 Wrote: Thankyuuuuuuuuuuuu so much its funny how how one little commar can cause so much of a pain in my life
i feel kinda stupid
Glad to help Big Grin
04-16-2012, 08:48 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#5
RE: expected ")" or "," help please

HOLD UP. The callback syntax for AddUseItemCallback is supposed to be (string &in asItem, string &in asEntity). You have (string &in item, string &in door), how is it possible it still works?!
-rage face-

Ba-da bing, ba-da boom.
(This post was last modified: 04-16-2012, 10:54 PM by JenniferOrange.)
04-16-2012, 09:42 PM
Find
Chunckycat12 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Apr 2012
Reputation: 0
#6
RE: expected ")" or "," help please

to be honest im not entirely sure i just just followed a youtube tutorial lol
04-16-2012, 09:45 PM
Find
MrIcabod123 Offline
Junior Member

Posts: 43
Threads: 7
Joined: Jan 2012
Reputation: 0
#7
RE: expected ")" or "," help please

He must have followed the tutorial from the wiki.

void OnStart()
{
AddUseItemCallback("", "ITEM", "DOOR", "FUNCTION", true);
}

void FUNCTION(string &in item, string &in door)
{
SetSwingDoorLocked(door, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem(item);
}

04-16-2012, 09:47 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#8
RE: expected ")" or "," help please

(04-16-2012, 09:47 PM)MrIcabod123 Wrote: He must have followed the tutorial from the wiki.

void OnStart()
{
AddUseItemCallback("", "ITEM", "DOOR", "FUNCTION", true);
}

void FUNCTION(string &in item, string &in door)
{
SetSwingDoorLocked(door, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem(item);
}
I didn't know it still worked if you did that. I get everything from the Engine Scripts page.



Ba-da bing, ba-da boom.
04-16-2012, 09:48 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#9
RE: expected ")" or "," help please

(04-16-2012, 09:42 PM)JenniferOrange Wrote: HOLD UP. The callback syntax for AddUseItemCallback is supposed to be (string &in asItem, string &in asEntity). You have (string &in item, string &in door), how is it possible it still works?!

-img-

You need to learn scripting, Jennifer. Undecided


Noob scripting tutorial: From Noob to Pro

(This post was last modified: 04-16-2012, 10:11 PM by Cranky Old Man.)
04-16-2012, 09:58 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#10
RE: expected ")" or "," help please

(04-16-2012, 09:58 PM)Cranky Old Man Wrote: You need to learn scripting, Jennifer. Undecided
No, she was the one who started me on scripting. She knows a lot. Also, dont quote pictures, kinda makes the thread too long.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-16-2012, 10:06 PM
Website Find




Users browsing this thread: 1 Guest(s)