Dizturbed
Member
Posts: 160
Threads: 39
Joined: Jun 2011
Reputation:
0
|
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.
void Onstart() { SetPlayerMoveSpeedMul(0.75f); SetPlayerRunSpeedMul(0.90f); PlayMusic("22_amb.ogg", true, 5, 4.0f, 0, false); //Plays music. AddEntityCollideCallback("Player", "SpawnSuitor", "SpawnMonster", true, 0); AddEntityCollideCallback("Suitor", "DepawnSuitor", "DespawnMonster", true, 0); AddUseItemCallback("", "key_tower_1", "level_wood_1", "UnlockDoor", true); } void SpawnMonster(string &in asParent, string &in asChild, int alState) { SetEntityActive("Suitor", true); AddEnemyPatrolNode("Suitor", "PathNodeArea_1", 0, ""); AddEnemyPatrolNode("Suitor", "PathNodeArea_2", 0, ""); StartPlayerLookAt("Suitor", 10.0f, 10.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.0f, 10.0f, ""); PlayGuiSound("joint_bend_door.ogg", 10.0f); StartScreenShake(1.0f, 1.0f, 2.0f, 3.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.0f, 10.0f, ""); SetPlayerCrouching(true); GiveSanityDamage(50.0f, true); PlayGuiSound("react_pant2.ogg", 0.4f); PlayGuiSound("react_breath3.ogg", 1.0f); FadeOut(3.0f); } void DespawnMonster(string &in asParent, string &in asChild, int alState) { SetEntityActive("Suitor", false); }
-Dizturbed
|
|
07-31-2011, 04:56 PM |
|
ObsidianLegion
Member
Posts: 173
Threads: 53
Joined: Jun 2011
Reputation:
0
|
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.
void Onstart() { SetPlayerMoveSpeedMul(0.75f); SetPlayerRunSpeedMul(0.90f); PlayMusic("22_amb.ogg", true, 5, 4.0f, 0, false); //Plays music. AddEntityCollideCallback("Player", "SpawnSuitor", "SpawnMonster", true, 0); AddEntityCollideCallback("Suitor", "DepawnSuitor", "DespawnMonster", true, 0); AddUseItemCallback("", "key_tower_1", "level_wood_1", "UnlockDoor", true); } void SpawnMonster(string &in asParent, string &in asChild, int alState) { SetEntityActive("Suitor", true); AddEnemyPatrolNode("Suitor", "PathNodeArea_1", 0, ""); AddEnemyPatrolNode("Suitor", "PathNodeArea_2", 0, ""); StartPlayerLookAt("Suitor", 10.0f, 10.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.0f, 10.0f, ""); PlayGuiSound("joint_bend_door.ogg", 10.0f); StartScreenShake(1.0f, 1.0f, 2.0f, 3.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.0f, 10.0f, ""); SetPlayerCrouching(true); GiveSanityDamage(50.0f, true); PlayGuiSound("react_pant2.ogg", 0.4f); PlayGuiSound("react_breath3.ogg", 1.0f); FadeOut(3.0f); } void DespawnMonster(string &in asParent, string &in asChild, int 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 |
|
Dizturbed
Member
Posts: 160
Threads: 39
Joined: Jun 2011
Reputation:
0
|
RE: Script wont work
No errors, it just wont work.
|
|
07-31-2011, 05:01 PM |
|
ObsidianLegion
Member
Posts: 173
Threads: 53
Joined: Jun 2011
Reputation:
0
|
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 |
|
MrCookieh
Member
Posts: 157
Threads: 8
Joined: Jul 2011
Reputation:
0
|
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
(This post was last modified: 07-31-2011, 05:06 PM by MrCookieh.)
|
|
07-31-2011, 05:05 PM |
|
Dizturbed
Member
Posts: 160
Threads: 39
Joined: Jun 2011
Reputation:
0
|
RE: Script wont work
Still doesn't work : /
|
|
07-31-2011, 05:09 PM |
|
MrCookieh
Member
Posts: 157
Threads: 8
Joined: Jul 2011
Reputation:
0
|
RE: Script wont work
ah, now I see.
you wrote void Onstart()
it should be void OnStart()
|
|
07-31-2011, 05:11 PM |
|
Dizturbed
Member
Posts: 160
Threads: 39
Joined: Jun 2011
Reputation:
0
|
RE: Script wont work
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH.. MYY.. GOD!
Thanks, im so freakin dumb!
|
|
07-31-2011, 05:13 PM |
|
ObsidianLegion
Member
Posts: 173
Threads: 53
Joined: Jun 2011
Reputation:
0
|
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
"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 |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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
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.
(This post was last modified: 07-31-2011, 05:29 PM by Kyle.)
|
|
07-31-2011, 05:28 PM |
|
|