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
Secret door won't work
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#1
Secret door won't work

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.


.jpg   LevelEditor 2012-06-02 15-16-22-13.jpg (Size: 329.39 KB / Downloads: 186)


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);
}
}

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


06-02-2012, 02:19 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Secret door won't work

Do you have a Rotate Area that the shelf can rotate around?

"What you think is irrelevant" - A character of our time

A Christmas Hunt
06-02-2012, 02:25 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Secret door won't work

MoveObjects are required for SetMoveObjectState.

Tutorials: From Noob to Pro
06-02-2012, 03:14 PM
Website Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#4
RE: Secret door won't work

Oh, I don't get it Confused
So what I have to write in the script?

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


06-02-2012, 07:16 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#5
RE: Secret door won't work

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.

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:26 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Secret door won't work

(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.

Tutorials: From Noob to Pro
06-02-2012, 07:28 PM
Website Find




Users browsing this thread: 1 Guest(s)