Jump to content

Adding script to door activator--issues !


csbx

Recommended Posts

I notice that when I add an onactivate to a door to run a bit of script when a given door opens, the door stops functioning as a door--ie., it doesn't activate when clicked. I tried including 'activate' in the script, but that didn't seem to solve things.

 

Anyone know how to add script to a door using onactivate (or another way) that will leave the door functioning as a door ?

 

Thanks !

Link to comment
Share on other sites

Thanks for responding. That's what I thought I was doing by including 'activate' in the script. But I guess I need to invoke the setopenstate function and set up the conditionals (if open, close; if closed, open). I'll give that a try.

Link to comment
Share on other sites

Hmmm ... that's odd the activate call isn't working. Just did a quick test with a ...

 

Begin OnActivate

 

ShowMessage MyMessage

Activate

End

~~~~~~~~~~~~~~~~

 

And it worked no problem. So either your door doesn't have an animation , or you didn't flag the reference as persistent ... maybe ?

Link to comment
Share on other sites

Just checked this. It's persistent (though would it even have to be if the script is attached to the object itself ?) and the door has an animation--it's the hotelblanksmL01 door. Bizarre. I'm missing something obvious, probably. Thanks, Mktavish.

Link to comment
Share on other sites

Just checked this. It's persistent (though would it even have to be if the script is attached to the object itself ?) and the door has an animation--it's the hotelblanksmL01 door. Bizarre. I'm missing something obvious, probably. Thanks, Mktavish.

 

You mean this door "OffDoorHotelBlankSmL01" ?

 

But your right ... it works without the reference being flagged persistent .

 

Did you name the door with prefix numbers ? Base / Ref ? Script name ?

Edited by Mktavish
Link to comment
Share on other sites

scn csbxAComplexDoorman


begin onActivate


if ( IsActionRef Player == 0 ) && ( csbxAComplexLooseGhoul8Doorman.getdead == 0 )


csbxAComplexLooseGhoul8Doorman.AddScriptPackage csbxAComplexdoorman01


endif
activate
end

The script will check to see that a 'door man' is alive--if he is then he'll close the door when a different npc has left the room. These details require work, but I stopped here given the issue of the door now not opening for anyone. As per script, activate should run regardless of satisfaction of conditionals.

 

csbxdoorclose01 is the ID for the door (OffDoorHotelBlankSmL01 indeed). Base name is similar. The script name is as above.

Edited by csbx
Link to comment
Share on other sites

Without seeing your doorman package and a script on them possibly ... I would guess they are shutting the door before it can play the opening animation.

 

Is that a "Find" package ? Using the "Specific Reference" option and selecting your door for it ?

 

Which you could put a condition of "GetOpenState == 1" Select run on reference , and choose your door.

 

But instead of having the door run a script ... put it on an area trigger covering the door mans space using "OnTriggerLeave" excluding the door man ... or with small multiple triggers covering the exit points of the door man space.

 

Add edit : err oh wait ... if the door man has another package ... put a condition on it of GetOpenstate == 3

 

Then they will switch packages depending on if the door is open.

 

Another add edit : To clarify ... put GetOpenstate == 3 as the only condition between 2 packages.

It will give your door man a randomness towards personality.

However ... if the timing doesn't line up enough ... may have to put a timer on the package switch ?

Edited by Mktavish
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...