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
#11
RE: 24/7 fatal errors

(02-13-2012, 09:40 AM)flamez3 Wrote: You have AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); in the wrong place. Put it in void OnStart()
main 52,25 Expected identifier
main 53, 1 Unexpected token {
Edit: It seems like it dose'nt like
//////////////////Foodstorage Grunt void OnStart()
} < that token right there
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);
}



(This post was last modified: 02-13-2012, 10:01 AM by Saren.)
02-13-2012, 09:51 AM
Find
flamez3 Offline
Posting Freak

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

No, put
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);


in void OnStart()

02-13-2012, 10:00 AM
Find
Saren Offline
Member

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

(02-13-2012, 10:00 AM)flamez3 Wrote: No, put
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);


in void OnStart()
Oooh, I thought you meant the other 1, I'll try that
Edit: You want it to look like that correct?
//////////////////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);
}


(This post was last modified: 02-13-2012, 10:07 AM by Saren.)
02-13-2012, 10:05 AM
Find
flamez3 Offline
Posting Freak

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

No, There can't be two void OnStart().

Use this:


// Run when entering map
void OnStart()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
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()

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, 10:15 AM
Find
Saren Offline
Member

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

(02-13-2012, 10:15 AM)flamez3 Wrote: No, There can't be two void OnStart().

Use this:


// Run when entering map
void OnStart()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
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()

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);
}
Thx alot dude it works now! But the grunt don't apear...



02-13-2012, 10:22 AM
Find
flamez3 Offline
Posting Freak

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

Because you made him a hallucination. Get rid of the

SetEnemyIsHallucination("grunt_foodstorage", true);

part and go to the entity tab of the grunt in level editor and tick "Hallucination"

(This post was last modified: 02-13-2012, 10:38 AM by flamez3.)
02-13-2012, 10:38 AM
Find
Saren Offline
Member

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

(02-13-2012, 10:38 AM)flamez3 Wrote: Because you made him a hallucination. Get rid of the

SetEnemyIsHallucination("grunt_foodstorage", true);

part and go to the entity tab of the grunt in level editor and tick "Hallucination"
Done, but still nothing


02-13-2012, 11:04 AM
Find
flamez3 Offline
Posting Freak

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

My mistake:

// Run when entering map
void OnStart()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
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);
}


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, 11:15 AM
Find
Saren Offline
Member

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

(02-13-2012, 11:15 AM)flamez3 Wrote: My mistake:

// Run when entering map
void OnStart()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
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);
}


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);
}
Hmmm.... strange.... he apeared but disapeared again instantly



02-13-2012, 11:30 AM
Find
flamez3 Offline
Posting Freak

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

Ah crap, forgot to delete the hallucination part sorry.


Quote:// Run when entering map
void OnStart()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
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);
}


void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
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);
}

(This post was last modified: 02-13-2012, 12:24 PM by flamez3.)
02-13-2012, 12:24 PM
Find




Users browsing this thread: 2 Guest(s)