Vennufius
Junior Member
Posts: 8
Threads: 2
Joined: Jun 2012
Reputation:
0
Fatal error: Expected identifier
So I'm having this small problem with my script. It keeps on having some kind of error, but I just can't simply find it. I would appreciate if someone could help me with this.
Here is my script atm:
void OnStart()
{
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
AddUseItemCallback("crowbarondoor", "crowbar_1", "castle_arched01_2", "UseCrowbarOnDoor", true);
AddUseItemCallback("crowbaronframe", "crowbar_1", "AreaUseCrowbar", "UseCrowbarOnDoor", true);
}
void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("timer01", 0.2, "TimerAttachCrowbar");
PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false);
RemoveItem("crowbar_1");
}
void TimerAttachCrowbar(string &in asTimer)
{
PlaySoundAtEntity("attachcrowbar","puzzle_place_jar.snt", "Player", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
GiveSanityBoostSmall();
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("castle_arched01_2", false, false);
SetSwingDoorDisableAutoClose("castle_arched01_2", true);
SetSwingDoorClosed("castle_arched01_2", false, false);
PlaySoundAtEntity("break", "break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
AddPropImpulse("castle_arched01_2", 0, 0, 3, "World");
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_broken_1", true);
AddTimer("pushdoor", 0.1, "TimerPushDoor");
AddDebugMessage("Break door!", false);
}
void TimerPushDoor(string &in asTimer)
{
AddPropImpulse("castle_arched01_2", -1, 2, -4, "World");
AddTimer("doorclose", 1.1, "TimerDoorCanClose");
}
void TimerDoorCanClose(string &in asTimer)
{
SetSwingDoorDisableAutoClose("castle_arched01_2", false);
}
07-05-2012, 02:58 AM
Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
RE: Fatal error: Expected identifier
Can you specify what the error is?
I rate it 3 memes.
07-05-2012, 03:02 AM
Vennufius
Junior Member
Posts: 8
Threads: 2
Joined: Jun 2012
Reputation:
0
RE: Fatal error: Expected identifier
(07-05-2012, 03:02 AM) andyrockin123 Wrote: Can you specify what the error is?Well thats part of the problem. It just wont start the map and gives me that "FATAL ERROR: Expected identifier". I can't figure out what could be the problem.
07-05-2012, 03:12 AM
Vennufius
Junior Member
Posts: 8
Threads: 2
Joined: Jun 2012
Reputation:
0
RE: Fatal error: Expected identifier
So I messed around a bit and got to this. When I try to start the map, it gives me this error (Look at the attachment). It changed from "Expected identifier" to "Unexpected end of file". Can someone please help me out?
Attached Files
UnexpectedEndOfFile.png (Size: 21.47 KB / Downloads: 144)
07-05-2012, 10:48 AM
drunkmonk
Member
Posts: 109
Threads: 7
Joined: Jun 2012
Reputation:
4
RE: Fatal error: Expected identifier
(07-05-2012, 10:48 AM) Vennufius Wrote: So I messed around a bit and got to this. When I try to start the map, it gives me this error (Look at the attachment). It changed from "Expected identifier" to "Unexpected end of file". Can someone please help me out?What changes did you make to your script? Because iv had an unexpected error before and it was for something simple as forgetting to put quotes around something or forgetting a bracket somewhere. andyrockin123 helped me with my last one
07-05-2012, 12:42 PM
Vennufius
Junior Member
Posts: 8
Threads: 2
Joined: Jun 2012
Reputation:
0
RE: Fatal error: Expected identifier
(07-05-2012, 12:42 PM) drunkmonk Wrote: (07-05-2012, 10:48 AM) Vennufius Wrote: So I messed around a bit and got to this. When I try to start the map, it gives me this error (Look at the attachment). It changed from "Expected identifier" to "Unexpected end of file". Can someone please help me out? What changes did you make to your script? Because iv had an unexpected error before and it was for something simple as forgetting to put quotes around something or forgetting a bracket somewhere. andyrockin123 helped me with my last oneI found some small mistakes in the script, so I fixed them. I can't figure out whats wrong.
07-05-2012, 03:03 PM
drunkmonk
Member
Posts: 109
Threads: 7
Joined: Jun 2012
Reputation:
4
RE: Fatal error: Expected identifier
Post the script that you have now
07-05-2012, 03:17 PM
Vennufius
Junior Member
Posts: 8
Threads: 2
Joined: Jun 2012
Reputation:
0
RE: Fatal error: Expected identifier
Here is what my script looks like now:
void OnStart()
{
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
AddUseItemCallback("crowbarondoor", "crowbar_1", "castle_arched01_2", "UseCrowbarOnDoor", true);
AddUseItemCallback("crowbaronframe", "crowbar_1", "castle_arched01_2", "UseCrowbarOnDoor", true);
}
void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("timer_01", 0.2, "TimerAttatchCrowbar");
PlaySoundAtEntity("pickupcrow", "player_crouch.snt", "Player", 0.05, false);
RemoveItem("crowbar_1");
}
void TimerAttatchCrowbar(string &in asTimer)
{
PlaySoundAtEntity("attachcrowbar", "puzzle_place_jar.snt", "Player", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
GiveSanityBoostSmall();
PlayMusic("10_puzzle01.snt", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("castle_arched01_2", true);
SetSwingDoorDisableAutoClose("castle_arched01_2", true);
SetSwingDoorClosed("castle_arched01_2", false, false);
PlaySoundAtEntity("break", "break_wood_metal.snt", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
AddPropImpulse("castle_arched01_2", 0, 0, 3, "World");
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_broken_1", true);
AddTimer("pushdoor", 0.1, "TimerPushDoor");
}
void TimerPushDoor(string &in asTimer)
{
AddPropImpulse("castle_arched01_2", -1, 2, -4, "World");
AddTimer("doorclose", 1.1, "TimerDoorCanClose");
}
void TimerDoorCanClose(string &in asTimer)
{
SetSwingDoorDisableAutoClose("castle_arched01_2", false);
}
(07-05-2012, 05:33 PM) Vennufius Wrote: Here is what my script looks like now:
void OnStart()
{
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
AddUseItemCallback("crowbarondoor", "crowbar_1", "castle_arched01_2", "UseCrowbarOnDoor", true);
AddUseItemCallback("crowbaronframe", "crowbar_1", "castle_arched01_2", "UseCrowbarOnDoor", true);
}
void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("timer_01", 0.2, "TimerAttatchCrowbar");
PlaySoundAtEntity("pickupcrow", "player_crouch.snt", "Player", 0.05, false);
RemoveItem("crowbar_1");
}
void TimerAttatchCrowbar(string &in asTimer)
{
PlaySoundAtEntity("attachcrowbar", "puzzle_place_jar.snt", "Player", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
GiveSanityBoostSmall();
PlayMusic("10_puzzle01.snt", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("castle_arched01_2", true);
SetSwingDoorDisableAutoClose("castle_arched01_2", true);
SetSwingDoorClosed("castle_arched01_2", false, false);
PlaySoundAtEntity("break", "break_wood_metal.snt", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
AddPropImpulse("castle_arched01_2", 0, 0, 3, "World");
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_broken_1", true);
AddTimer("pushdoor", 0.1, "TimerPushDoor");
}
void TimerPushDoor(string &in asTimer)
{
AddPropImpulse("castle_arched01_2", -1, 2, -4, "World");
AddTimer("doorclose", 1.1, "TimerDoorCanClose");
}
void TimerDoorCanClose(string &in asTimer)
{
SetSwingDoorDisableAutoClose("castle_arched01_2", false);
}Sorry again, I found a mistake. But this time I think it gave me an error that someone could actually solve.
So this is what it gave me: FATAL ERROR: Could not load script file
'custom_stories/NoNameYet/maps/NoNameYet.hps'!
main (25, 2) : ERR :No matching signatures to
'SetSwingDoorLocked(string@&, const bool)'
Oh this is just annoying... I had made a wrong script:
SetSwingDoorLocked("castle_arched01_2", true);
[align=-webkit-auto]
Which should have been this:
[/align][align=-webkit-auto]
[/align][align=-webkit-auto]
SetSwingDoorLocked("castle_arched01_2", false, false);
[/align][align=-webkit-auto]
[/align][align=-webkit-auto]
[/align]
(This post was last modified: 07-05-2012, 05:56 PM by Vennufius .)
07-05-2012, 05:33 PM
drunkmonk
Member
Posts: 109
Threads: 7
Joined: Jun 2012
Reputation:
4
RE: Fatal error: Expected identifier
It's your SetSwingDoorLocked. It should look like this
SetSwingDoorLocked("castle_arched01_2", true, true);
07-05-2012, 06:00 PM
Vennufius
Junior Member
Posts: 8
Threads: 2
Joined: Jun 2012
Reputation:
0
RE: Fatal error: Expected identifier
(07-05-2012, 06:00 PM) drunkmonk Wrote: It's your SetSwingDoorLocked. It should look like this
SetSwingDoorLocked("castle_arched01_2", true, true);I got that about half an hour ago and actually it should be false, false in my case.
07-05-2012, 07:17 PM