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
Script wont work
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#1
Script wont work

This is my script that wont work in-game, well I want a monster to spawn whenthe player enters an area, pretty easy I know, but it wont work, help please.

PHP Code: (Select All)
void Onstart()
{
SetPlayerMoveSpeedMul(0.75f);
SetPlayerRunSpeedMul(0.90f);
PlayMusic("22_amb.ogg"true54.0f0false); //Plays music.
AddEntityCollideCallback("Player""SpawnSuitor""SpawnMonster"true0);
AddEntityCollideCallback("Suitor""DepawnSuitor""DespawnMonster"true0);
AddUseItemCallback("""key_tower_1""level_wood_1""UnlockDoor"true);
}
void SpawnMonster(string &in asParentstring &in asChildint alState
{
SetEntityActive("Suitor"true);
AddEnemyPatrolNode("Suitor""PathNodeArea_1"0"");
AddEnemyPatrolNode("Suitor""PathNodeArea_2"0"");
StartPlayerLookAt("Suitor"10.0f10.0f"");
SetPlayerActive(false);
PlayGuiSound("react_breath6.ogg"1.0f);
AddTimer("Timer"2.5f"NoLook");
}
void NoLook(string&in asTimer)
{
StopPlayerLookAt();
AddTimer("Timer"1.0f"LookAtTree");
SetEntityActive("Suitor_1"false);
}
void LookAtTree(string&in asTimer)
{
StartPlayerLookAt("falling_tree_1"10.0f10.0f"");
PlayGuiSound("joint_bend_door.ogg"10.0f);
StartScreenShake(1.0f1.0f2.0f3.0f);
AddTimer("Timer"1.0f"LookAtTree2");
}
void LookAtTree2(string&in asTimer)
{
SetEntityActive("falling_tree_2"true);
SetEntityActive("falling_tree_1"false);
PlayGuiSound("lurker_hit_wood4.ogg"10.0f);
AddTimer("Timer"1.0f"LookAtMonster");
}
void LookAtMonster(string&in asTimer)
{
AddEnemyPatrolNode("Suitor""PathNodeArea_3"0"");
SetEntityActive("Suitor"true);
StartPlayerLookAt("Suitor"10.0f10.0f"");
SetPlayerCrouching(true);
GiveSanityDamage(50.0ftrue);
PlayGuiSound("react_pant2.ogg"0.4f);
PlayGuiSound("react_breath3.ogg"1.0f);
FadeOut(3.0f);
}
void DespawnMonster(string &in asParentstring &in asChildint alState
{
SetEntityActive("Suitor"false);

-Dizturbed

07-31-2011, 04:56 PM
Find
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#2
RE: Script wont work

(07-31-2011, 04:56 PM)Dizturbed Wrote: This is my script that wont work in-game, well I want a monster to spawn whenthe player enters an area, pretty easy I know, but it wont work, help please.

PHP Code: (Select All)
void Onstart()
{
SetPlayerMoveSpeedMul(0.75f);
SetPlayerRunSpeedMul(0.90f);
PlayMusic("22_amb.ogg"true54.0f0false); //Plays music.
AddEntityCollideCallback("Player""SpawnSuitor""SpawnMonster"true0);
AddEntityCollideCallback("Suitor""DepawnSuitor""DespawnMonster"true0);
AddUseItemCallback("""key_tower_1""level_wood_1""UnlockDoor"true);
}
void SpawnMonster(string &in asParentstring &in asChildint alState
{
SetEntityActive("Suitor"true);
AddEnemyPatrolNode("Suitor""PathNodeArea_1"0"");
AddEnemyPatrolNode("Suitor""PathNodeArea_2"0"");
StartPlayerLookAt("Suitor"10.0f10.0f"");
SetPlayerActive(false);
PlayGuiSound("react_breath6.ogg"1.0f);
AddTimer("Timer"2.5f"NoLook");
}
void NoLook(string&in asTimer)
{
StopPlayerLookAt();
AddTimer("Timer"1.0f"LookAtTree");
SetEntityActive("Suitor_1"false);
}
void LookAtTree(string&in asTimer)
{
StartPlayerLookAt("falling_tree_1"10.0f10.0f"");
PlayGuiSound("joint_bend_door.ogg"10.0f);
StartScreenShake(1.0f1.0f2.0f3.0f);
AddTimer("Timer"1.0f"LookAtTree2");
}
void LookAtTree2(string&in asTimer)
{
SetEntityActive("falling_tree_2"true);
SetEntityActive("falling_tree_1"false);
PlayGuiSound("lurker_hit_wood4.ogg"10.0f);
AddTimer("Timer"1.0f"LookAtMonster");
}
void LookAtMonster(string&in asTimer)
{
AddEnemyPatrolNode("Suitor""PathNodeArea_3"0"");
SetEntityActive("Suitor"true);
StartPlayerLookAt("Suitor"10.0f10.0f"");
SetPlayerCrouching(true);
GiveSanityDamage(50.0ftrue);
PlayGuiSound("react_pant2.ogg"0.4f);
PlayGuiSound("react_breath3.ogg"1.0f);
FadeOut(3.0f);
}
void DespawnMonster(string &in asParentstring &in asChildint alState
{
SetEntityActive("Suitor"false);

-Dizturbed

Tell me what the error is. Assuming it comes up with one

"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
07-31-2011, 05:00 PM
Find
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#3
RE: Script wont work

No errors, it just wont work.

07-31-2011, 05:01 PM
Find
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#4
RE: Script wont work

(07-31-2011, 05:01 PM)Dizturbed Wrote: No errors, it just wont work.

I have the same problem. I don't know what's wrong I'm sorry. Suffice to say your script is fine.

"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
07-31-2011, 05:02 PM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#5
RE: Script wont work

Are you sure that your areas/your monster has the right name?

Otherwise,
AddEntityCollideCallback("Player", "SpawnSuitor", "SpawnMonster", true, 1);
AddEntityCollideCallback("Suitor", "DepawnSuitor", "DespawnMonster", true, 1);

try this. I don't know why it shouldn't work with 0, but I only took a fast look at it and couldn't find anything else

The Well: Descent - Take a look at it!
(This post was last modified: 07-31-2011, 05:06 PM by MrCookieh.)
07-31-2011, 05:05 PM
Find
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#6
RE: Script wont work

Still doesn't work : /

07-31-2011, 05:09 PM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#7
RE: Script wont work

ah, now I see.
you wrote void Onstart()
it should be void OnStart()

The Well: Descent - Take a look at it!
07-31-2011, 05:11 PM
Find
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#8
RE: Script wont work

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH.. MYY.. GOD!
Thanks, im so freakin dumb!

07-31-2011, 05:13 PM
Find
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#9
RE: Script wont work

(07-31-2011, 05:11 PM)MrCookieh Wrote: ah, now I see.
you wrote void Onstart()
it should be void OnStart()

Dude!!! :S Help meeee! No solution to mine Angry

"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
07-31-2011, 05:27 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#10
RE: Script wont work

(07-31-2011, 05:27 PM)Lolnesia09 Wrote:
(07-31-2011, 05:11 PM)MrCookieh Wrote: ah, now I see.
you wrote void Onstart()
it should be void OnStart()

Dude!!! :S Help meeee! No solution to mine Angry

No solution to yours what? Show your script so I can look at it if it's a script.

Edit: Nevermind, I know what you're asking for. Tongue

(This post was last modified: 07-31-2011, 05:29 PM by Kyle.)
07-31-2011, 05:28 PM
Find




Users browsing this thread: 1 Guest(s)