TheDavenia
Member
Posts: 223
Threads: 38
Joined: Jun 2011
Reputation:
0
|
Fatal error please help!
This is what my fatal error says:
FATAL ERROR: Could not load script file
'custom_stories/(secret)/maps/Bedroom.hps'!
main (37, 1): ERR : Unexpected token '{'
And here's my Bedroom.hps file:
void OnStart()
{
AddEntityCollideCallback("Player", "script_turn_boxlight_off", "func_turn_boxlight_off", true, 1);
wakeUp();
AddUseItemCallback("", "key_tower_1", "level_hub_1", "unlock_level_hub_1", true);
}
void wakeUp () {
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 7.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}
void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}
void func_turn_boxlight_off(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("script_turn_light_off", "scary_laugh01.ogg", "Player", 1.0f, false);
//SetLightVisible("boxlight", false);
}
void SetLevelDoorLocked(string& asName, bool abLocked);
{
SetLevelDoorLocked("level_hub_1", false, true);
PlaySoundAtEntity("", "unlock_door", "level_hub_1", 0, false);
RemoveItem("key_tower_1");
}
Please help!
Thanks,
TheDavenia
Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
|
|
07-10-2011, 08:47 PM |
|
Russ Money
Senior Member
Posts: 360
Threads: 25
Joined: Dec 2010
Reputation:
4
|
RE: Fatal error please help!
void SetLevelDoorLocked(string& asName, bool abLocked);
Remove the ; at the end.
Usually when you get an error like that, it's telling you that error is somewhere around Line 37, Character 1
|
|
07-10-2011, 09:28 PM |
|
TheDavenia
Member
Posts: 223
Threads: 38
Joined: Jun 2011
Reputation:
0
|
RE: Fatal error please help!
(07-10-2011, 09:28 PM)Russ Money Wrote: void SetLevelDoorLocked(string& asName, bool abLocked);
Remove the ; at the end.
Usually when you get an error like that, it's telling you that error is somewhere around Line 37, Character 1
Now i get this error:
FATAL ERROR: Could not load script file
'custom_stories/(secret)/maps/Bedroom.hps'!
main (36, 1) : ERR : A function with the same name and parameters allready exist
main (38, 5) : ERR : No matching signatures to
'SetLevelDoorLocked(string@&, const bool, const bool)'
Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
|
|
07-10-2011, 09:39 PM |
|
SLAMnesia
Member
Posts: 99
Threads: 39
Joined: May 2011
Reputation:
0
|
RE: Fatal error please help!
you're line """"void SetLevelDoorLocked(string& asName, bool abLocked)""""
is incorrect. you should change it to
void unlock_level_hub_1(string& asName, bool abLocked)
[EDIT]
the reason why its wrong (incase you are a learning type) is because you have the callback function at the beginning
void Onstart
{
AddUseItemCallback("", "key_tower_1", "level_hub_1", "unlock_level_hub_1", true);
}
isn't referenced correctly, so change it to what I put above and it should all smoothen out
Don't thank me, BLOW ME
(This post was last modified: 07-10-2011, 11:17 PM by SLAMnesia.)
|
|
07-10-2011, 11:12 PM |
|
PumpMaster
Junior Member
Posts: 23
Threads: 6
Joined: Mar 2011
Reputation:
0
|
RE: Fatal error please help!
DAMNesia that's some good hearty advice!
|
|
07-10-2011, 11:14 PM |
|
TheDavenia
Member
Posts: 223
Threads: 38
Joined: Jun 2011
Reputation:
0
|
RE: Fatal error please help!
(07-10-2011, 11:12 PM)SLAMnesia Wrote: you're line """"void SetLevelDoorLocked(string& asName, bool abLocked)""""
is incorrect. you should change it to
void unlock_level_hub_1(string& asName, bool abLocked)
[EDIT]
the reason why its wrong (incase you are a learning type) is because you have the callback function at the beginning
void Onstart
{
AddUseItemCallback("", "key_tower_1", "level_hub_1", "unlock_level_hub_1", true);
}
isn't referenced correctly, so change it to what I put above and it should all smoothen out
Don't thank me, BLOW ME
Now i get this error:
FATAL ERROR: Could not load script file
'custom_stories/(secret)/maps/Bedroom.hps'!
main (38, 5) : ERR : No matching signatures to
'SetLevelDoorLocked(string@&, const bool, const bool)'
Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
|
|
07-11-2011, 10:13 AM |
|
plantum
Junior Member
Posts: 4
Threads: 1
Joined: Jul 2011
Reputation:
0
|
RE: Fatal error please help!
(07-11-2011, 10:13 AM)TheDavenia Wrote: (07-10-2011, 11:12 PM)SLAMnesia Wrote: you're line """"void SetLevelDoorLocked(string& asName, bool abLocked)""""
is incorrect. you should change it to
void unlock_level_hub_1(string& asName, bool abLocked)
[EDIT]
the reason why its wrong (incase you are a learning type) is because you have the callback function at the beginning
void Onstart
{
AddUseItemCallback("", "key_tower_1", "level_hub_1", "unlock_level_hub_1", true);
}
isn't referenced correctly, so change it to what I put above and it should all smoothen out
Don't thank me, BLOW ME
Now i get this error:
FATAL ERROR: Could not load script file
'custom_stories/(secret)/maps/Bedroom.hps'!
main (38, 5) : ERR : No matching signatures to
'SetLevelDoorLocked(string@&, const bool, const bool)'
Change "SetLevelDoorLocked("level_hub_1", false, true);"
to "SetLevelDoorLocked("level_hub_1", false);"
|
|
07-11-2011, 10:24 AM |
|
TheDavenia
Member
Posts: 223
Threads: 38
Joined: Jun 2011
Reputation:
0
|
RE: Fatal error please help!
(07-11-2011, 10:24 AM)plantum Wrote: (07-11-2011, 10:13 AM)TheDavenia Wrote: (07-10-2011, 11:12 PM)SLAMnesia Wrote: you're line """"void SetLevelDoorLocked(string& asName, bool abLocked)""""
is incorrect. you should change it to
void unlock_level_hub_1(string& asName, bool abLocked)
[EDIT]
the reason why its wrong (incase you are a learning type) is because you have the callback function at the beginning
void Onstart
{
AddUseItemCallback("", "key_tower_1", "level_hub_1", "unlock_level_hub_1", true);
}
isn't referenced correctly, so change it to what I put above and it should all smoothen out
Don't thank me, BLOW ME
Now i get this error:
FATAL ERROR: Could not load script file
'custom_stories/(secret)/maps/Bedroom.hps'!
main (38, 5) : ERR : No matching signatures to
'SetLevelDoorLocked(string@&, const bool, const bool)'
Change "SetLevelDoorLocked("level_hub_1", false, true);"
to "SetLevelDoorLocked("level_hub_1", false);"
now my key just doesn't work on the door
Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
|
|
07-11-2011, 10:33 AM |
|
Roenlond
Senior Member
Posts: 331
Threads: 3
Joined: Apr 2011
Reputation:
0
|
RE: Fatal error please help!
change
unlock_level_hub_1(string& asName, bool abLocked)
to
unlock_level_hub_1(string &in asItem, string &in asEntity)
|
|
07-11-2011, 10:39 AM |
|
TheDavenia
Member
Posts: 223
Threads: 38
Joined: Jun 2011
Reputation:
0
|
RE: Fatal error please help!
Thanks guys it all works now!
Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
|
|
07-11-2011, 10:47 AM |
|
|