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
24/7 fatal errors
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#1
24/7 fatal errors

Can anyone spot what's wrong here, cause I have tried SO many different things and every time I try to launch my custom sotry, the game finds something else to say what's the cause of the fatal errors I get..
//////////////////Foodstorage Grunt

void AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEnemyIsHallucination(string& asName, bool abX);
SetEntityActive("grunt_foodstorage", true);
ShowEnemyPlayerPosition(string& asName);
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_7", 0, "");
FadeEnemyToSmoke(string& asName, bool abPlaySound);
}


void OnLeave()
{
}


02-13-2012, 12:39 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: 24/7 fatal errors

Unless you're defining a function, never specify the data type of a variable when calling a function. Also, all functions should be called within a function definition.

Tutorials: From Noob to Pro
(This post was last modified: 02-13-2012, 12:49 AM by Your Computer.)
02-13-2012, 12:43 AM
Website Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#3
RE: 24/7 fatal errors

One of the main problems there should not be a void before "AddEntityCollideCallback" and that command should either be in the OnStart or OnEnter function.

I think I fixed the entire thing.
//////////////////Foodstorage Grunt void OnStart()    {AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);     }
void MonsterFunction(string &in asParent, string &in asChild, int alState){ SetEnemyIsHallucination("grunt_foodstorage", true);SetEntityActive("grunt_foodstorage", true);ShowEnemyPlayerPosition("grunt_foodstorage"); AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_1", 2, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_2", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_3", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_4", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_5", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_6", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_7", 0, "");FadeEnemyToSmoke("grunt_foodstorage", false);}

void OnLeave(){}

agh, sorry about the messiness, this forum likes to mess up all my spacing on the code >.> you may need to space it... sorry.

Insanity. Static.
(This post was last modified: 02-13-2012, 12:54 AM by Juby.)
02-13-2012, 12:53 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: 24/7 fatal errors

(02-13-2012, 12:53 AM)Juby Wrote: One of the main problems there should not be a void before "AddEntityCollideCallback" and that command should either be in the OnStart or OnEnter function.

I think I fixed the entire thing.
//////////////////Foodstorage Grunt void OnStart()    {AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);     }
void MonsterFunction(string &in asParent, string &in asChild, int alState){ SetEnemyIsHallucination("grunt_foodstorage", true);SetEntityActive("grunt_foodstorage", true);ShowEnemyPlayerPosition("grunt_foodstorage"); AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_1", 2, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_2", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_3", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_4", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_5", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_6", 0, "");AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_7", 0, "");FadeEnemyToSmoke("grunt_foodstorage", false);}

void OnLeave(){}

agh, sorry about the messiness, this forum likes to mess up all my spacing on the code >.> you may need to space it... sorry.


Put it quotes.

02-13-2012, 03:45 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: 24/7 fatal errors

(02-13-2012, 03:45 AM)flamez3 Wrote: Put it quotes.

That's worse. People just need to learn to use the Source editor of the forum.

Tutorials: From Noob to Pro
02-13-2012, 04:43 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
RE: 24/7 fatal errors

(02-13-2012, 04:43 AM)Your Computer Wrote:
(02-13-2012, 03:45 AM)flamez3 Wrote: Put it quotes.

That's worse. People just need to learn to use the Source editor of the forum.
^^ I'm hopeless with it.



02-13-2012, 06:54 AM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#7
RE: 24/7 fatal errors

Here we go again, FATAL ERROR
Main 52, 4 unexpected token {

02-13-2012, 08:05 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#8
RE: 24/7 fatal errors

Post your entire script. The script you gave is only 22 lines

02-13-2012, 08:11 AM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#9
RE: 24/7 fatal errors

(02-13-2012, 08:11 AM)flamez3 Wrote: Post your entire script. The script you gave is only 22 lines
Oh that is the script who dose'nt work, the 2 first works but, sure
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("masterbedroomdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "masterbedroomdoor", 0, false);
RemoveItem("Masterbedroomkey");
}
//////////////////Crowbar
void OnEnter()
{
AddUseItemCallback("", "crowbar_1", "crowbar_door", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}


void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("crowbar_door", false, true);
AddPropImpulse("crowbar_door", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("crowbar_door", true);
SetSwingDoorClosed("crowbar_door", false, false);
SetMoveObjectState("crowbar_door", 1);
PlaySoundAtEntity("","break_wood_metal", "BreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}
//////////////////Foodstorage Grunt void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEnemyIsHallucination("grunt_foodstorage", true);
SetEntityActive("grunt_foodstorage", true);
ShowEnemyPlayerPosition("grunt_foodstorage");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_7", 0, "");
FadeEnemyToSmoke("grunt_foodstorage", false);
}





02-13-2012, 08:35 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#10
RE: 24/7 fatal errors

You have AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); in the wrong place. Put it in void OnStart()

02-13-2012, 09:40 AM
Find




Users browsing this thread: 1 Guest(s)