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
Why wont this script work?
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#1
Why wont this script work?

Heres the script

////////////////////////////
// Run when the map starts
void OnStart()
{
AddEntityCollideCallback("Player", "FlyingJesus_1", "HolyJesus", true, 1);
AddEntityCollideCallback("Jesus1", "FlyingJesus_1", "Sound", true, 1);
SetEntityCallbackFunc("Avain", "OnPickup");
}


void HolyJesus(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Jesus1");
AddPropForce("Jesus1", 0, 0, 30000, "World");
}


void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, false);
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("grunt_1", true);
GiveSanityDamage(10.0f, true);
AddEnemyPatrolNode("grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_2", 1, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_3", 1, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_4", 1, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_5", 1, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_6", 1, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_7", 1, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_8", 2, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_9", 1, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_10", 1, "");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Whats wrong with it?


(This post was last modified: 01-09-2012, 07:28 PM by Datguy5.)
01-09-2012, 05:46 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#2
RE: Why wont this script work?

You tell us. If you want help, tell us what's wrong.

What do you want to happen, and what happens instead?

[Image: 16455.png]
01-09-2012, 05:50 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#3
RE: Why wont this script work?

(01-09-2012, 05:50 PM)MulleDK19 Wrote: You tell us. If you want help, tell us what's wrong.

What do you want to happen, and what happens instead?
The first map works fine,but when i enter through the level door the game crashes.It started crashing when i added the flying jesus script.And the crash report is just random.It says something about doooors.

01-09-2012, 06:00 PM
Find
Inurias Offline
Junior Member

Posts: 20
Threads: 0
Joined: Jan 2012
Reputation: 2
#4
RE: Why wont this script work?

On your first use of "SetEntityActive" in your "HolyJesus" function you are missing the second parameter.

Also, I found another little flaw in your script, but I'm not sure if it is important:
AddPropForce("Jesus1", 0, 0, 30000, "World");
You should use "world" instead of "World", it is probably case sensitive.

I am not sure what you want to reach with your script so I did not check if it would really work, I just checked if you used your calls correctly.

- Inurias
(This post was last modified: 01-09-2012, 07:27 PM by Inurias.)
01-09-2012, 07:25 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#5
RE: Why wont this script work?

Oh nvm,i fixed it Big Grin Apparently i was missing one function from Setentityactive script.Just like Inurias said.
(This post was last modified: 01-09-2012, 07:28 PM by Datguy5.)
01-09-2012, 07:27 PM
Find




Users browsing this thread: 1 Guest(s)