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
What's wrong with this script?
NylePudding Offline
Member

Posts: 77
Threads: 23
Joined: Apr 2011
Reputation: 0
#3
RE: What's wrong with this script?

(05-02-2011, 08:08 AM)Tanshaydar Wrote: This is whole script? You don't have an "OnStart" section, and you have placed a second timer function inside first timer which you shouldn't. The functions you want to call should be same level with others.

This isn't the whole script only the area which has the problem.

Here's the whole script if it helps:

void OnStart()
{
AddTimer("tut01", 3, "Intro");
AddTimer("tut02", 30, "Timer01");

SetEnemyIsHallucination("servant_grunt_1", true);
SetEnemyIsHallucination("servant_brute_1", true);

SetSwingDoorLocked("mansion_1", true, false);

PlayMusic("ambience_wind_eerie.ogg", true, 0.5f, 0, 0, true);

AddEntityCollideCallback("Player" , "ScriptArea_1" , "BodyFunc1" , true , 1);
}
void BodyFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("corpse_male_1" , true);
AddTimer("tut03", 10, "Timer02");
AddTimer("tut03", 10, "Timer03");
}


void Intro(string &in asTimer)
{
SetMessage("Example", "Entry1", 0);

}

void Timer01(string &in asTimer)

{

int RanEve_1 = RandInt(1,2);

if (RanEve_1 == 1)
{
SetEntityActive("servant_grunt_1", true);
}

else if (RanEve_1 == 2)
{
SetEntityActive("servant_brute_1", true);
}

SetEntityActive("ScriptArea_1", true);
SetMessage("Example", "Entry2", 0);
PlayMusic("10_event_coming.ogg", false, 1.0f, 0, 0, true);

void Timer02 (string &in asTimer)
{
if (RanEve_1 == 1)
{
ShowEnemyPlayerPosition("servant_grunt_1");
}

if (RanEve_1 == 2)
{
ShowEnemyPlayerPosition("servant_brute_1");
}

SetSwingDoorLocked("mansion_1", false, false);

}
}

void OnEnter()
{

}

void OnLeave()
{

}

(05-02-2011, 08:08 AM)Tanshaydar Wrote: This is whole script? You don't have an "OnStart" section, and you have placed a second timer function inside first timer which you shouldn't. The functions you want to call should be same level with others.

Okay, I'll arrange my script differently.

So you can't have another timer function within another? I just thought it would save time with the RanEve_1 variable.

So how would you make a variable effective throughout the script?
(This post was last modified: 05-02-2011, 08:16 AM by NylePudding.)
05-02-2011, 08:13 AM
Find


Messages In This Thread
What's wrong with this script? - by NylePudding - 05-02-2011, 07:41 AM
RE: What's wrong with this script? - by NylePudding - 05-02-2011, 08:13 AM
RE: What's wrong with this script? - by jens - 05-02-2011, 08:17 AM



Users browsing this thread: 1 Guest(s)