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 Help "if" script doesn't work
ooadrianoo Offline
Member

Posts: 82
Threads: 29
Joined: Apr 2012
Reputation: 0
#1
"if" script doesn't work

This is my first "if" script and I don't know why it doesn't work.
void monsterbreakdoor(string &in asTimer)
{
if (GetSwingDoorClosed("cellar_wood01_5") == true)
{
CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "ScriptArea_53", false);
SetEntityActive("servant_grunt_3", true);
SetEntityActive("cellar_wood01_broken_2", true);
SetEntityActive("cellar_wood01_5", false);
PlaySoundAtEntity("", "break_wood.snt.snt", "ScriptArea_53", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "ScriptArea_53", false);
ShowEnemyPlayerPosition("servant_grunt_3");
}

else
{ if(GetSwingDoorClosed("cellar_wood01_5") == false)
{
SetEntityActive("ScriptArea_54", true);
}
}
}

If the door will be open, there shouldn't be door breaking effects and an area should be true. On the other side the door should be breaking.
But both is happening. Why?
08-16-2012, 05:02 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: "if" script doesn't work

void monsterbreakdoor(string &in asTimer)
{
if(GetSwingDoorClosed("cellar_wood01_5") == true)
{
CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "ScriptArea_53", false);
SetEntityActive("servant_grunt_3", true);
SetEntityActive("cellar_wood01_broken_2", true);
SetEntityActive("cellar_wood01_5", false);
PlaySoundAtEntity("", "break_wood.snt.snt", "ScriptArea_53", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "ScriptArea_53", false);
ShowEnemyPlayerPosition("servant_grunt_3");
}

if(GetSwingDoorClosed("cellar_wood01_5") == false)
{
SetEntityActive("ScriptArea_54", true);
}
}

This should work; you had a few extra brackets and the organization was a bit off. If this doesn't solve your problem, please post the full hps file.

I rate it 3 memes.
08-16-2012, 05:35 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#3
RE: "if" script doesn't work

Or:

void monsterbreakdoor(string &in asTimer)
{
if(GetSwingDoorClosed("cellar_wood01_5") == true){

CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "ScriptArea_53", false);
SetEntityActive("servant_grunt_3", true);
SetEntityActive("cellar_wood01_broken_2", true);
SetEntityActive("cellar_wood01_5", false);
PlaySoundAtEntity("", "break_wood.snt.snt", "ScriptArea_53", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "ScriptArea_53", false);
ShowEnemyPlayerPosition("servant_grunt_3");
}else if(GetSwingDoorClosed("cellar_wood01_5") == false){

SetEntityActive("ScriptArea_54", true);
}
}

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
(This post was last modified: 08-16-2012, 06:00 PM by GoranGaming.)
08-16-2012, 05:59 PM
Website Find




Users browsing this thread: 1 Guest(s)