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
Scripting help needed please, fatal error...
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#1
Scripting help needed please, fatal error...

Hey guys I'm getting this error every time i try to load up my map:


[Image: fatalerrorqy.png]

And here's my script:


void OnStart()
{
AddEntityCollideCallback("Player", "BruteSpawn", "ActivateBrute", true, 1);
MonsterPath();
MonsterPath1();
AddEntityCollideCallback("servant_brute_1", "ScriptArea_3", "BruteDisable", true, 1);
AddEntityCollideCallback("servant_grunt_1", "GruntDisable", "GruntDisable", true, 1);
SetEntityPlayerInteractCallback("prison_1", "LockCheck", false);
}

void LockCheck(string &in asEntity)
if(GetSwingDoorLocked("prison_1") == true)
{
PlaySoundAtEntity("GruntSlash", "attack_claw_hit.snt", "Scream", 1, true);
AddTimer("", 0.5f, "Scream");
SetPlayerActive(true);
StartPlayerLookAt("LookAtGrunt", 10, 50, "");
}

void Scream(string &in asTimer)
{
PlaySoundAtEntity("HumanScream", "21_intro_scream.snt", "Scream", 1, true);
AddTimer("", 1.0f, "Grunt");
}

void Grunt(string &in asTimer)
{
SetEntityActive("servant_grunt_1", true);
}

void MonsterPath1()
{
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0.0f, "");
}

void GruntDisable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
SetPlayerActive(false);
StopPlayerLookAt();
}

void ActivateBrute(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("LookAtWall", 10, 50, "");
AddTimer("", 0.1f, "TimerStopPlayerLookAtWall");
SetPlayerActive(true);
}

void TimerStopPlayerLookAtWall(string &in asTimer)
{
StartPlayerLookAt("LookAtWall", 10, 50, "");
StopPlayerLookAt();
AddTimer("", 0.0f, "FalconPunch");
}

void MonsterPath()
{
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0.0f, "");
}

void FalconPunch(string &in asTimer)
{
PlaySoundAtEntity("HitWall", "attack_claw_hit.snt", "SlashSound", 1, true);
CreateParticleSystemAtEntity("WallSlash", "ps_break_cavein.ps", "LookAtWall", false);
AddTimer("", 0.3f, "BreakWall");
}

void BreakWall(string &in asTimer)
{
PlaySoundAtEntity("WallBreak", "03_break_wall.snt", "LookAtWall", 1, true);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_xlarge.ps", "Smoke", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_xlarge.ps", "Smoke_1", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_1", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_2", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_3", false);
SetEntityActive("BreakWall_1", false);
SetEntityActive("BrokenWall_1", true);
SetEntityActive("rock_debris01_1", true);
SetEntityActive("rock_debris01_2", true);
SetEntityActive("rock_debris01_3", true);
SetEntityActive("rock_debris01_4", true);
SetEntityActive("rock_debris01_5", true);
SetEntityActive("rock_debris01_6", true);
SetEntityActive("servant_brute_1", true);
StopPlayerLookAt();
StartPlayerLookAt("servant_brute_1", 10, 50, "");
}

void BruteDisable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", false);
StopPlayerLookAt();
SetPlayerActive(false);
}

Please help someone!

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
(This post was last modified: 11-18-2011, 05:52 PM by TheDavenia.)
11-17-2011, 06:21 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#2
RE: Scripting help needed please, fatal error...

Try thisSmile
Spoiler below!

void OnStart()
{
AddEntityCollideCallback("Player", "BruteSpawn", "ActivateBrute", true, 1);
MonsterPath();
MonsterPath1();
AddEntityCollideCallback("servant_brute_1", "ScriptArea_3", "BruteDisable", true, 1);
AddEntityCollideCallback("servant_grunt_1", "GruntDisable", "GruntDisable", true, 1);
SetEntityPlayerInteractCallback("prison_1", "LockCheck", false);
}

void LockCheck(string &in asEntity)
{
if(GetSwingDoorLocked("prison_1") == true)
{
PlaySoundAtEntity("GruntSlash", "attack_claw_hit.snt", "Scream", 1, true);
AddTimer("", 0.5f, "Scream");
SetPlayerActive(true);
StartPlayerLookAt("LookAtGrunt", 10, 50, "");
}
}

void Scream(string &in asTimer)
{
PlaySoundAtEntity("HumanScream", "21_intro_scream.snt", "Scream", 1, true);
AddTimer("", 1.0f, "Grunt");
}

void Grunt(string &in asTimer)
{
SetEntityActive("servant_grunt_1", true);
}

void MonsterPath1()
{
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0.0f, "");
}

void GruntDisable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
SetPlayerActive(false);
StopPlayerLookAt();
}

void ActivateBrute(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("LookAtWall", 10, 50, "");
AddTimer("", 0.1f, "TimerStopPlayerLookAtWall");
SetPlayerActive(true);
}

void TimerStopPlayerLookAtWall(string &in asTimer)
{
StartPlayerLookAt("LookAtWall", 10, 50, "");
StopPlayerLookAt();
AddTimer("", 0.0f, "FalconPunch");
}

void MonsterPath()
{
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0.0f, "");
}

void FalconPunch(string &in asTimer)
{
PlaySoundAtEntity("HitWall", "attack_claw_hit.snt", "SlashSound", 1, true);
CreateParticleSystemAtEntity("WallSlash", "ps_break_cavein.ps", "LookAtWall", false);
AddTimer("", 0.3f, "BreakWall");
}

void BreakWall(string &in asTimer)
{
PlaySoundAtEntity("WallBreak", "03_break_wall.snt", "LookAtWall", 1, true);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_xlarge.ps", "Smoke", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_xlarge.ps", "Smoke_1", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_1", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_2", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_3", false);
SetEntityActive("BreakWall_1", false);
SetEntityActive("BrokenWall_1", true);
SetEntityActive("rock_debris01_1", true);
SetEntityActive("rock_debris01_2", true);
SetEntityActive("rock_debris01_3", true);
SetEntityActive("rock_debris01_4", true);
SetEntityActive("rock_debris01_5", true);
SetEntityActive("rock_debris01_6", true);
SetEntityActive("servant_brute_1", true);
StopPlayerLookAt();
StartPlayerLookAt("servant_brute_1", 10, 50, "");
}

void BruteDisable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", false);
StopPlayerLookAt();
SetPlayerActive(false);
}


When Life No Longer Exists
Full-conversion mod
11-17-2011, 06:25 PM
Website Find
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#3
RE: Scripting help needed please, fatal error...

(11-17-2011, 06:25 PM)Unearthlybrutal Wrote: Try thisSmile
Spoiler below!

void OnStart()
{
AddEntityCollideCallback("Player", "BruteSpawn", "ActivateBrute", true, 1);
MonsterPath();
MonsterPath1();
AddEntityCollideCallback("servant_brute_1", "ScriptArea_3", "BruteDisable", true, 1);
AddEntityCollideCallback("servant_grunt_1", "GruntDisable", "GruntDisable", true, 1);
SetEntityPlayerInteractCallback("prison_1", "LockCheck", false);
}

void LockCheck(string &in asEntity)
{
if(GetSwingDoorLocked("prison_1") == true)
{
PlaySoundAtEntity("GruntSlash", "attack_claw_hit.snt", "Scream", 1, true);
AddTimer("", 0.5f, "Scream");
SetPlayerActive(true);
StartPlayerLookAt("LookAtGrunt", 10, 50, "");
}
}

void Scream(string &in asTimer)
{
PlaySoundAtEntity("HumanScream", "21_intro_scream.snt", "Scream", 1, true);
AddTimer("", 1.0f, "Grunt");
}

void Grunt(string &in asTimer)
{
SetEntityActive("servant_grunt_1", true);
}

void MonsterPath1()
{
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0.0f, "");
}

void GruntDisable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
SetPlayerActive(false);
StopPlayerLookAt();
}

void ActivateBrute(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("LookAtWall", 10, 50, "");
AddTimer("", 0.1f, "TimerStopPlayerLookAtWall");
SetPlayerActive(true);
}

void TimerStopPlayerLookAtWall(string &in asTimer)
{
StartPlayerLookAt("LookAtWall", 10, 50, "");
StopPlayerLookAt();
AddTimer("", 0.0f, "FalconPunch");
}

void MonsterPath()
{
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0.0f, "");
}

void FalconPunch(string &in asTimer)
{
PlaySoundAtEntity("HitWall", "attack_claw_hit.snt", "SlashSound", 1, true);
CreateParticleSystemAtEntity("WallSlash", "ps_break_cavein.ps", "LookAtWall", false);
AddTimer("", 0.3f, "BreakWall");
}

void BreakWall(string &in asTimer)
{
PlaySoundAtEntity("WallBreak", "03_break_wall.snt", "LookAtWall", 1, true);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_xlarge.ps", "Smoke", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_xlarge.ps", "Smoke_1", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_1", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_2", false);
CreateParticleSystemAtEntity("Smoke", "ps_area_fog_moving.ps", "SmokePush_3", false);
SetEntityActive("BreakWall_1", false);
SetEntityActive("BrokenWall_1", true);
SetEntityActive("rock_debris01_1", true);
SetEntityActive("rock_debris01_2", true);
SetEntityActive("rock_debris01_3", true);
SetEntityActive("rock_debris01_4", true);
SetEntityActive("rock_debris01_5", true);
SetEntityActive("rock_debris01_6", true);
SetEntityActive("servant_brute_1", true);
StopPlayerLookAt();
StartPlayerLookAt("servant_brute_1", 10, 50, "");
}

void BruteDisable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", false);
StopPlayerLookAt();
SetPlayerActive(false);
}

I don't get the error anymore, thanks for that.
But now the event doesn't happen when i click the door?

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
11-17-2011, 06:44 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#4
RE: Scripting help needed please, fatal error...

The event should happen when you touch the door when it's locked. If it's not locked, nothing happens.
Make sure that the door is locked when you touch it

When Life No Longer Exists
Full-conversion mod
11-17-2011, 06:50 PM
Website Find
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#5
RE: Scripting help needed please, fatal error...

(11-17-2011, 06:50 PM)Unearthlybrutal Wrote: The event should happen when you touch the door when it's locked. If it's not locked, nothing happens.
Make sure that the door is locked when you touch it
It's locked i checked the level editor...
The player gets deactivated, but the sounds don't happen and the grunt doesn't spawn either

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
(This post was last modified: 11-17-2011, 07:03 PM by TheDavenia.)
11-17-2011, 06:59 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#6
RE: Scripting help needed please, fatal error...

You haven't named the timers. I don't know if that has something to do with that.
For example: AddTimer("screamtimer", 0.5f, "Scream");

When Life No Longer Exists
Full-conversion mod
11-17-2011, 09:27 PM
Website Find
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#7
RE: Scripting help needed please, fatal error...

(11-17-2011, 09:27 PM)Unearthlybrutal Wrote: You haven't named the timers. I don't know if that has something to do with that.
For example: AddTimer("screamtimer", 0.5f, "Scream");
Well... I don't really think that's the problem cause in my other scripts I din't name them as well... But I'll try...
Nope... Still not working...

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
(This post was last modified: 11-17-2011, 09:34 PM by TheDavenia.)
11-17-2011, 09:31 PM
Find




Users browsing this thread: 1 Guest(s)