stinset2
Junior Member
Posts: 14
Threads: 4
Joined: Dec 2011
Reputation:
0
|
NEED HELP WITH SCRIPT
I need some help with my script. I get a fatal error message, and it says "main (38,19) : ERR : Expected ')' or ','"
and it looks the same only with some other numbers under it.
here's the whole script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key 1", "door", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_tower_1", "door2", "UsedKeyOnDoor1", true);
SetEntityCallbackFunc("key_tower_1", "OnPickup");
AddEntityCollideCallback("Player", "sec", "sec", true, 1);
AddEntityCollideCallback("Player", "scary", "scary", true, 1);
AddEntityCollideCallback("table", "tablescript", "tablescript", true, 1);
AddEntityCollideCallback("enemy_suitor_1", "run", "run", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door", false, true);
PlaySoundAtEntity("", "unlock_door", "door", 0.0f, false);
RemoveItem("key 1");
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door2", false, true);
PlaySoundAtEntity("", "unlock_door", "door2", 0.0f, false);
RemoveItem("key_tower_1");
}
void OnPickup(string &in asItem, string &in asEntity)
{
SetEntityActive("character_dog_1",true);
}
void sec(string &in asParent, string &in asChild, int alState)
{
AddTimer("", 20,0f, "running");
AddQuest("quest1","quest1");
}
void scary(string &in asTimer)
{
PlayMusic("horror1.ogg", true, 1, 1, 1, true);
SetEntityActive("deformed_man_1", true;
SetEntityActive("candlestick_floor_red_1", true;
GiveSanityDamage(5.0f, true);
AddTimer("", 2,0f, "scare1");
}
void scare1(string &in asTimer)
{
SetEntityActive("deformed_man_2", true;
SetEntityActive("candlestick_floor_red_2", true;
SetEntityActive("deformed_man_1", false;
SetEntityActive("candlestick_floor_red_1", false;
GiveSanityDamage(5.0f, true);
AddTimer("", 2,0f, "scare2");
}
void scare2(string &in asTimer)
{
SetEntityActive("deformed_man_3", true;
SetEntityActive("candlestick_floor_red_3", true;
SetEntityActive("deformed_man_2", false;
SetEntityActive("candlestick_floor_red_2", false;
GiveSanityDamage(5.0f, true);
AddTimer("", 3,0f, "scare3");
}
void scare3(string &in asTimer)
{
SetEntityActive("deformed_man_3", false;
SetEntityActive("candlestick_floor_red_3", false;
GiveSanityDamage(5.0f, true);
SetEntityActive("servant_grunt_1", true;
ShowEnemyPlayerPosition("servant_grunt_1");
}
void tablescript(string &in asTimer)
{
SetEntityActive("run", true;
}
void run(string &in asTimer)
{
SetEntityActive("enemy_suitor_1", false;
}
void running(string &in asTimer)
{
SetEntityActive("enemy_suitor_1", true;
ShowEnemyPlayerPosition("enemy_suitor_1");
GiveSanityDamage(5.0f, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
What to do?! D:
|
|
02-25-2012, 01:30 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: NEED HELP WITH SCRIPT
(02-25-2012, 01:30 PM)stinset2 Wrote: I need some help with my script. I get a fatal error message, and it says "main (38,19) : ERR : Expected ')' or ','"
and it looks the same only with some other numbers under it.
here's the whole script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key 1", "door", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_tower_1", "door2", "UsedKeyOnDoor1", true);
SetEntityCallbackFunc("key_tower_1", "OnPickup");
AddEntityCollideCallback("Player", "sec", "sec", true, 1);
AddEntityCollideCallback("Player", "scary", "scary", true, 1);
AddEntityCollideCallback("table", "tablescript", "tablescript", true, 1);
AddEntityCollideCallback("enemy_suitor_1", "run", "run", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door", false, true);
PlaySoundAtEntity("", "unlock_door", "door", 0.0f, false);
RemoveItem("key 1");
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door2", false, true);
PlaySoundAtEntity("", "unlock_door", "door2", 0.0f, false);
RemoveItem("key_tower_1");
}
void OnPickup(string &in asItem, string &in asEntity)
{
SetEntityActive("character_dog_1",true);
}
void sec(string &in asParent, string &in asChild, int alState)
{
AddTimer("", 20,0f, "running");
AddQuest("quest1","quest1");
}
void scary(string &in asTimer)
{
PlayMusic("horror1.ogg", true, 1, 1, 1, true);
SetEntityActive("deformed_man_1", true;
SetEntityActive("candlestick_floor_red_1", true;
GiveSanityDamage(5.0f, true);
AddTimer("", 2,0f, "scare1");
}
void scare1(string &in asTimer)
{
SetEntityActive("deformed_man_2", true;
SetEntityActive("candlestick_floor_red_2", true;
SetEntityActive("deformed_man_1", false;
SetEntityActive("candlestick_floor_red_1", false;
GiveSanityDamage(5.0f, true);
AddTimer("", 2,0f, "scare2");
}
void scare2(string &in asTimer)
{
SetEntityActive("deformed_man_3", true;
SetEntityActive("candlestick_floor_red_3", true;
SetEntityActive("deformed_man_2", false;
SetEntityActive("candlestick_floor_red_2", false;
GiveSanityDamage(5.0f, true);
AddTimer("", 3,0f, "scare3");
}
void scare3(string &in asTimer)
{
SetEntityActive("deformed_man_3", false;
SetEntityActive("candlestick_floor_red_3", false;
GiveSanityDamage(5.0f, true);
SetEntityActive("servant_grunt_1", true;
ShowEnemyPlayerPosition("servant_grunt_1");
}
void tablescript(string &in asTimer)
{
SetEntityActive("run", true;
}
void run(string &in asTimer)
{
SetEntityActive("enemy_suitor_1", false;
}
void running(string &in asTimer)
{
SetEntityActive("enemy_suitor_1", true;
ShowEnemyPlayerPosition("enemy_suitor_1");
GiveSanityDamage(5.0f, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
What to do?! D: found your problem, you forgot the ) on your SetEntityActive("deformed_man_1", true);
|
|
02-25-2012, 01:34 PM |
|
stinset2
Junior Member
Posts: 14
Threads: 4
Joined: Dec 2011
Reputation:
0
|
RE: NEED HELP WITH SCRIPT
(02-25-2012, 01:34 PM)SilentStriker Wrote: (02-25-2012, 01:30 PM)stinset2 Wrote: found your problem, you forgot the ) on your SetEntityActive("deformed_man_1", true); I changed it so it looks like this:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key 1", "door", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_tower_1", "door2", "UsedKeyOnDoor1", true);
SetEntityCallbackFunc("key_tower_1", "OnPickup");
AddEntityCollideCallback("Player", "sec", "sec", true, 1);
AddEntityCollideCallback("Player", "scary", "scary", true, 1);
AddEntityCollideCallback("table", "tablescript", "tablescript", true, 1);
AddEntityCollideCallback("enemy_suitor_1", "run", "run", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door", false, true);
PlaySoundAtEntity("", "unlock_door", "door", 0.0f, false);
RemoveItem("key 1");
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door2", false, true);
PlaySoundAtEntity("", "unlock_door", "door2", 0.0f, false);
RemoveItem("key_tower_1");
}
void OnPickup(string &in asItem, string &in asEntity)
{
SetEntityActive("character_dog_1",true);
}
void sec(string &in asParent, string &in asChild, int alState)
{
AddTimer("", 20,0f, "running");
AddQuest("quest1","quest1");
}
void scary(string &in asTimer)
{
PlayMusic("horror1.ogg", true, 1, 1, 1, true);
SetEntityActive("deformed_man_1", true);
SetEntityActive("candlestick_floor_red_1", true);
GiveSanityDamage(5.0f, true);
AddTimer("", 2,0f, "scare1");
}
void scare1(string &in asTimer)
{
SetEntityActive("deformed_man_2", true);
SetEntityActive("candlestick_floor_red_2", true);
SetEntityActive("deformed_man_1", false);
SetEntityActive("candlestick_floor_red_1", false);
GiveSanityDamage(5.0f, true);
AddTimer("", 2,0f, "scare2");
}
void scare2(string &in asTimer)
{
SetEntityActive("deformed_man_3", true);
SetEntityActive("candlestick_floor_red_3", true);
SetEntityActive("deformed_man_2", false);
SetEntityActive("candlestick_floor_red_2", false);
GiveSanityDamage(5.0f, true);
AddTimer("", 3,0f, "scare3");
}
void scare3(string &in asTimer)
{
SetEntityActive("deformed_man_3", false);
SetEntityActive("candlestick_floor_red_3", false);
GiveSanityDamage(5.0f, true);
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition("servant_grunt_1");
}
void tablescript(string &in asTimer)
{
SetEntityActive("run", true);
}
void run(string &in asTimer)
{
SetEntityActive("enemy_suitor_1", false);
}
void running(string &in asTimer)
{
SetEntityActive("enemy_suitor_1", true);
ShowEnemyPlayerPosition("enemy_suitor_1");
GiveSanityDamage(5.0f, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
A lot of the errors dissapered, but there are couple left which says the same as before. I can't see what I need to change
|
|
02-25-2012, 01:44 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: NEED HELP WITH SCRIPT
Could you post all the errors?
|
|
02-25-2012, 03:04 PM |
|
stinset2
Junior Member
Posts: 14
Threads: 4
Joined: Dec 2011
Reputation:
0
|
RE: NEED HELP WITH SCRIPT
(02-25-2012, 03:04 PM)SilentStriker Wrote: Could you post all the errors?
yes
FATAL ERROR: Could not load script file 'custom_stories/Division 3/maps/2.hps'!
main (38,26 : ERR : Expected ')' or ','
main (48,16 : ERR : Expected ')' or ','
main (58,16 : ERR : Expected ')' or ','
main (68,16 : ERR : Expected ')' or ','
|
|
02-25-2012, 03:24 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: NEED HELP WITH SCRIPT
Hmm strange... can't find any problem...
I guess just check so everything is named right
(This post was last modified: 02-25-2012, 03:37 PM by SilentStriker.)
|
|
02-25-2012, 03:34 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: NEED HELP WITH SCRIPT
He used commas instead of periods for float values.
|
|
02-25-2012, 06:00 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: NEED HELP WITH SCRIPT
oh yea on the timers
|
|
02-25-2012, 06:28 PM |
|
stinset2
Junior Member
Posts: 14
Threads: 4
Joined: Dec 2011
Reputation:
0
|
RE: NEED HELP WITH SCRIPT
well, I changed the commas to periods, and I was able to start up the map. but the timers didn't work at all
|
|
02-25-2012, 07:16 PM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: NEED HELP WITH SCRIPT
Post script again please.
|
|
02-26-2012, 10:26 AM |
|
|