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
Fatal error: Expected identifier
Vennufius Offline
Junior Member

Posts: 8
Threads: 2
Joined: Jun 2012
Reputation: 0
#8
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
Find


Messages In This Thread
Fatal error: Expected identifier - by Vennufius - 07-05-2012, 02:58 AM
RE: Fatal error: Expected identifier - by Adny - 07-05-2012, 03:02 AM
RE: Fatal error: Expected identifier - by Vennufius - 07-05-2012, 05:33 PM



Users browsing this thread: 1 Guest(s)