Frictional Games Forum (read-only)

Full Version: expected ")" or "," help please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
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);
}
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
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)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
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-
to be honest im not entirely sure i just just followed a youtube tutorial lol
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)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.


(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

(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.
Pages: 1 2 3