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
If statement.
Scupp Offline
Junior Member

Posts: 14
Threads: 5
Joined: Jul 2012
Reputation: 0
#1
If statement.

I need little help with this if statement. How can I make it so that IF some entities in the script are active, something happes. I readed this:
http://wiki.frictionalgames.com/hpl2/tut...ner#the_if and have watched some videos but I can't find the answer or any other way to do this.

Let's say that I have this script:


void lauta(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("impact_wood_low2.ogg", false, 150.00, 0, 0, true);
SetEntityActive("lauta_1", true);
SetEntityActive("lauta", false);
}
}
void lauta2(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("impact_wood_heavy_low2.ogg", false, 150.00, 0, 0, true);
SetEntityActive("lauta_2", true);
SetEntityActive("lauta2", false);
}
}
void lauta3(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("impact_wood_heavy_low2.ogg", false, 150.00, 0, 0, true);
SetEntityActive("lauta_3", true);
SetEntityActive("lauta3", false);
}
}

I wan't that something happens when lauta_1, lauta_2 and lauta_3 are active. How can I do that? I'm not here to get whole script. I just want to know how it happens and what should I do.
07-17-2012, 01:43 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#2
RE: If statement.

You may need to add a localvar or globalvar whenever you activate an entity as a makeshift way to check if it exists. Then check the var in a function and do what you want when they are active.

Insanity. Static.
07-17-2012, 02:06 PM
Find
Scupp Offline
Junior Member

Posts: 14
Threads: 5
Joined: Jul 2012
Reputation: 0
#3
RE: If statement.

(07-17-2012, 02:06 PM)Juby Wrote: You may need to add a localvar or globalvar whenever you activate an entity as a makeshift way to check if it exists. Then check the var in a function and do what you want when they are active.
Alright I got it fixed! Thanks Smile
(This post was last modified: 07-17-2012, 02:35 PM by Scupp.)
07-17-2012, 02:25 PM
Find




Users browsing this thread: 1 Guest(s)