str8g8 on 21/6/2005 at 23:08
Ok, I've looked in the wiki and done a search so apologies in advance if this had been dealt with before (also, I didn't use the newbie thread as it's getting a bit bloated)
so ... what is the best way of making a simple switch that opens a trap door?
I have a wall switch actor which I want use to open a shutter actor (turned on its side). I have gone though the door locking tut bit couldn't apply it to this situation (ie, I don't want a lock, the switch is not attached to the door etc)
thanks in advance
str8g8
Krypt on 21/6/2005 at 23:44
You need to do this with Triggerscripts. The easiest thing would be to create a script like this:
CONDITION
-When I am frobbed by player
ACTION
-Activate object(s) at end of link [Triggerscript]
-Reset script conditions and actions
Put that on the switch then create a Triggerscript link between the switch and your trap door. Also be sure to set the HighlightDist to 0 on the trap door to make it unfrobbable so it will only be openable with the switch.
Actually I think there is an existing generic script that does this, which you could use if you don't want to make it yourself.
Ziemanskye on 22/6/2005 at 10:04
How's the trapdoor set up?
str8g8 on 22/6/2005 at 13:01
Quote:
How's the trapdoor set up?
I just took a shutter actor and turned it on its back. i added a higghlight dist of 0 to stop it frobbing, and I added a triggerscript link connecting the switch to the shutter.
Ziemanskye on 22/6/2005 at 15:30
Is it set up with a HingedAttatchment to itself? And what are the properties (under physics, I think) for it?
I'll try dig out the bookcase setup from townhouse - I had to set the case to rotate manually when the crystal was frobbed, so that should help a bit...
Okay here's how I had it set up to rotate the bookcase:
Crystal Triggerscript link to Bookcase
Crystal Properties: plus trigger script
Quote:
CONDITIONS:
When I am frobbed by player
ACTIONS:
Open any doors on linked object(s) [TriggerScript]
no reset on the script- but I didn't want it to work more than once anyway.
Bookcase: add link HingedAttachment to self
HingedAttachmentProperties:
Quote:
-Physics:
--m_hingeAxis: X=0, Y=0, Z=1 (I guess you'd want X or Y for a trapdoor)
--m_hingeFriction: 0
--m_hingeLimitMax: 85 (I think if this is 0 it keeps rotating on the spot)
--m_hingeLimitMin: 0 (or it will untrigger past it's start point, which can be interesting)
--m_hingeLocation: 0 0 0 (I wanted it to rotate around the orgin of the smesh)
StaticMeshActor: properties all over the place, though a door to start with might not need so much...
Quote:
-Actor/bNotMoveablePhysics = False
-Actor/bNotMoveableRender = False
(AIDoor, AIEvidence, AITags as you like)
Quote:
-Frob/IsFrobbable = True
Quote:
-Highlight/HighlightDist = 0
Quote:
-Movement/
--Mass = 100
--Rotation: Pitch 0 Roll 0 Yaw 16384 (unreal unit angles)
--Physics: PHYS_Havok
Quote:
-Physics/
--DoorController/
---DoorSpeed =1
---DoorType = DoorType_Conventional
---MaximumForce = 3000
---StartOpen = False (else it swings back by the difference between the hingeLimits)
--InitialHavokState = Havok_HavokControlled
--MassPounds = 100
(Render, Scripts (try the door sound scripts) and Sound/DoorSoundDamp as you want)
I don't know if all that is needed, but it worked. :thumb:
str8g8 on 22/6/2005 at 16:10
Quote:
Is it set up with a HingedAttatchment to itself?
Yes
There's no physics properties at the lowest level (though there is further up the hierarchy - there's a door controller where it's set up as a DoorType_Conventional, and a MassPounds of 100). Just as a test I added a physics property at the lowest level and changed it to a trapdoor, but this didn't seem to have any effect.
it sounds very similar to the bookcase setup, although i was trying to use this door actor rather than just a static mesh (to get sounds and so on).
thanks for your help
str8g8
Ziemanskye on 22/6/2005 at 16:12
Well, both posting, but you can add the sounds yourself - they're just TriggerScripts. It did take quite a few attemtps to make it work and not swing through the wall and stuff though.
Krypt on 22/6/2005 at 19:14
The easiest way would be to add a door from the Hinged doors section in gamesys, then you can just change the static mesh on the instance if the one you want isn't set up as a door already.
Also it could be the Activate script action that is causing problems. It may not work as reliably as the Open/Close ones. Activate is supposed to both open and close, depending on what state it's in when the script fires. If you only want it to open once then just use the Open action and take the reset action out.
str8g8 on 26/6/2005 at 19:40
At last! Got it working!
Krypt, it was indeed the activate action that was causing problems - using the open door one (as Ziemanske suggested) fixed it. Also used a door archetype and switched the smesh as suggested. Works a treat - thanks to both of you :thumb: