Frictional Games Forum (read-only)

Full Version: Help with inactive statue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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:

Code:
////////////////////////////
// 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()
{

}
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.
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
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.
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.
Check the ACTIVE box in the entity's properties.
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.
Can I take a look to your model?
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!
Did you give the ENT a different file name than the original and then replace the one in the map with that one?
Pages: 1 2