Frictional Games Forum (read-only)

Full Version: Secret door won't work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I want to make a secret door like in the "old Archives". But it doesn't work, if i use the lever nothing happens.

[attachment=2933]


My DoorScript:
void OnStart()
{

SetEntityConnectionStateChangeCallback("Lever_1", "Lever");
}


void Lever(string &in asEntity, int alState)
{
if (alState == 1)
{
CreateParticleSystemAtEntity("", "ps_dust_falling.ps", "ScriptArea_24", false);
SetMoveObjectState("Secret",1.0f);
CreateParticleSystemAtEntity("", "ps_dust_falling.ps", "ScriptArea_25", false);
CreateParticleSystemAtEntity("", "ps_dust_falling.ps", "ScriptArea_26", false);
CreateParticleSystemAtEntity("", "ps_dust_falling.ps", "ScriptArea_27", false);
CreateParticleSystemAtEntity("", "ps_dust_falling.ps", "ScriptArea_28", false);
PlaySoundAtEntity("", "quest_completed.snt", "ScriptArea_7", 0, false);
}
}
Do you have a Rotate Area that the shelf can rotate around?
MoveObjects are required for SetMoveObjectState.
Oh, I don't get it Confused
So what I have to write in the script?
Below is copied code from old_archives. They did the same thing you're trying to do; this is how you accomplish moving a secret door.

When in doubt, always check to see how the creators did it.

Code:
ConnectEntities("door_connection",        //Name of connection
        "secret_lever",     //Parent entity (Affects)
        "secret_door",    //Child entity     (Affected)
        false,        //Invert the state sent
        1,         //States used (0=both), checked before invertion.
        "CreateDust");    //callback
(06-02-2012, 07:16 PM)Shives Wrote: [ -> ]Oh, I don't get it Confused
So what I have to write in the script?

It's not necessarily about the script, it's about the object you're trying to move. Not all objects can be moved through scripts, and i have no reason to believe the object in the image is a MoveObject entity.