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
Help with inactive statue
EddieShoe Offline
Junior Member

Posts: 28
Threads: 6
Joined: Sep 2010
Reputation: 0
#1
Information  Help with inactive statue

I've added an inactive statue on my map, I've double-checked that it has been set to inactive but still every time I try to make it appear by entering a trigger area it is already there. I have tried adding a script to set it to inactive on map entry but it does not work as well, he is still there before entering the script area. Any ideas? Here's my script file:

////////////////////////////
// Run first time starting map
void OnStart()
{
    AddEntityCollideCallback("Player", "PlateBreak", "BreakPlate", true, 1);
    AddEntityCollideCallback("Player", "Footstep", "Footsteps", true, 1);
    AddEntityCollideCallback("Player", "TriggerVoice", "VoiceTrigger", true, 1);    
    SetEntityActive("ManScare", false);
}

void BreakPlate(string &in asParent, string &in asChild, int alState)
{
    AddTimer("timer01", 1.5f, "BreakPlate1");
    PlaySoundAtEntity("", "scare_tingeling.snt", "Player", 0, false);
}

void Footsteps(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("", "scare_steps_big.snt", "candlestick_wall_10", 0, false);
}

void BreakPlate1(string &in asTimer)
{
    SetPropHealth("plate_9", 0);
    SetPropHealth("plate_3", 0);
    SetPropHealth("plate_8", 0);
    AddPropImpulse("chair_nice02_8", 4, 8, 0, "world");
    AddPropImpulse("chair_nice02_11", 6, 10, 0, "world");
    AddPropImpulse("chair_nice02_1", 0, 0, -14, "world");
    GiveSanityDamage(3, true);    
}

void ManScream(string &in asEntity, int alState)
{
    PlaySoundAtEntity("", "scare_male_terrified5.snt", "Player", 0, false);
    GiveSanityDamage(5, true);
}

void VoiceTrigger(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("ManScare", true);
    PlaySoundAtEntity("", "enemy_hallucination_disappear.snt", "Player", 0, false);
    AddTimer("timer02", 1.0f, "RemoveMan1");
}

void RemoveMan1(string &in asTimer)
{
    SetEntityActive("ManScare", false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
    StopMusic(0,1);
    PlayMusic("02_amb_strange.ogg", true, 1, 4, 0, false);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Currently working on: "Awake"
Progress: ~5%
(This post was last modified: 09-01-2013, 02:14 PM by EddieShoe.)
08-30-2013, 10:19 PM
Find
Kurton Offline
Senior Member

Posts: 533
Threads: 8
Joined: Oct 2010
Reputation: 16
#2
RE: Help with inactive statue

Most likely it's set as 'StaticProp' in the Model Editor, inhibiting any kind of script interaction. Change it to Object, subtype Static, and save it as a new entity that you include in your custom story folder.

08-30-2013, 10:38 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Help with inactive statue

That's because the statue is a static object.

You will have to change that in the model editor. Then add the new file to the "entity"-folder in your custom story

Ninjad

Trying is the first step to success.
(This post was last modified: 08-30-2013, 10:39 PM by FlawlessHappiness.)
08-30-2013, 10:39 PM
Find
DeAngelo Offline
Senior Member

Posts: 263
Threads: 26
Joined: Feb 2013
Reputation: 11
#4
RE: Help with inactive statue

Assuming it doesn't ever need to go back to being inactive, you could use the CreatePropAtArea (Not sure if that's the exact script, check the wiki) and put a script area where you want.

A Late Night Drink http://www.moddb.com/mods/a-late-night-drink
Check out my LP channel, CatBearGaming, I take all Custom Story requests!
08-30-2013, 10:42 PM
Find
EddieShoe Offline
Junior Member

Posts: 28
Threads: 6
Joined: Sep 2010
Reputation: 0
#5
RE: Help with inactive statue

Okay, I've made it a object and added a "entities" folder in my custom story where I saved it, but how do I add it in the editor now? I've googled but with no results.

EDIT: I actually thought a bit and realized how easy it was. However, even though it's an object now it is still visible when I open the door, even before entering the area. I cna confirm it's set to an object because I can see more options in the "entity" tab when having it selected. Everything else (the sound, etc) works perfectly when running into the script area.

Currently working on: "Awake"
Progress: ~5%
(This post was last modified: 08-30-2013, 11:05 PM by EddieShoe.)
08-30-2013, 10:51 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Help with inactive statue

Check the ACTIVE box in the entity's properties.

"Veni, vidi, vici."
"I came, I saw, I conquered."
08-31-2013, 01:18 AM
Find
EddieShoe Offline
Junior Member

Posts: 28
Threads: 6
Joined: Sep 2010
Reputation: 0
#7
RE: Help with inactive statue

In the model editor or in the level editor? Because it's already set to inactive in the level editor and it's transparent in the 3d view.

Currently working on: "Awake"
Progress: ~5%
08-31-2013, 12:17 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#8
RE: Help with inactive statue

Can I take a look to your model?

"Veni, vidi, vici."
"I came, I saw, I conquered."
08-31-2013, 12:18 PM
Find
EddieShoe Offline
Junior Member

Posts: 28
Threads: 6
Joined: Sep 2010
Reputation: 0
#9
RE: Help with inactive statue

I've uploaded the map file with scripts and the model here. I messed around a lot now so it might look messy in the .hps file. Thanks for the help!

Currently working on: "Awake"
Progress: ~5%
08-31-2013, 12:44 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: Help with inactive statue

Did you give the ENT a different file name than the original and then replace the one in the map with that one?

Tutorials: From Noob to Pro
09-01-2013, 02:43 AM
Website Find




Users browsing this thread: 1 Guest(s)