TypeRED on 9/10/2008 at 14:35
i want to put a handwheel in my mission that triggers something
what i need is:
on FrobWorldBegin:
send TurnOn to all controldevice-linked objects
activate its own joint animations
on FrobWorldEnd or WorldDeSelect:
send TurnOff to all controldevice-linked objects
play reverse joint animation to default position from the current state
BUT:
if the joint animation reached its final position, prevent it from sending
TurnOff / playing the reverse joint animation on FrobWorldEnd or WorldDeSelect
in that state, FrobWorldEnd or WorldDeSelect starts a timer that defines when
to send TurnOff and play the reverse joint animation
FrobWorldEnd on the wheel while the timer is running, resets the timer
this can be used for controlling translating doors, if you adjust the speed of the door to
match the time that the wheel needs to reach its final position.
so the door can be opened by holding use-button on the wheel, but if you release,
the wheel and the door move back to default. only if you open it complete,
it stays in that state for the specified amount of time before it closes
any idea, NV? ;)
i tried to realize this by using NVRotatable but no success,
i didn't work with custom scripts before...
TypeRED on 12/10/2008 at 21:25
i got this solved, using NVRelayTrap, NVRelayTrap and NVTweqDevice.
thanks for those scripts, without them it wasnt possible.
now the player has to hold the frob button on the wheel to rotate it an open a gate,
if he releases or looks away, the wheel rotates back and the door closes.
the wheel and door speed are syncronisized
this system can be used for elevators too, holding the frob button makes it moving up and releasing lets the elevator fall down :ebil:
if you are interested, i can post the settings
LarryG on 12/10/2008 at 22:10
Please post the settings. You never know.
Yandros on 10/12/2015 at 13:35
Well, I need something just like this... but he never posted the settings...
SEE WHY IT'S IMPORTANT TO ALWAYS POST THE SETTINGS, KIDDIES? :mad:
I was going to start with two NVRelays watching for FrobWorldBegin and FrobWorldEnd like he did, but in my case that may not work, as I'm actually frobbing the object in world with an object from inventory, and it shouldn't work if you just frob the object without it. Right now I'm triggering an event via S&R, but what I want is for the player to have to hold the use button down for a certain period of time. Any suggestions on how to do this are welcome. *cough* NV *cough*
LarryG on 10/12/2015 at 15:14
Here is my standard one object setup for frobbing activating an object's joints, but without the reverse on lookaway.
Scripts: TweqOnOff; NVRelayTrap; NVRelayTrap2; NVTweqDevice; NVSimpleSchemaPlayerTrap
Design Note: NVRelayTrapOn="FrobWorldBegin"; NVRelayTrapOff="FrobWorldEnd"; NVRelayTrapTDest="[Me]"; NVRelayTrap2On="Null"; NVRelayTrap2Off="WorldDeSelect"; NVRelayTrap2TDest="[Me]"; NVSchema="squeaky_lp"
FrobInfo: {Script, FocusScript; [None]; [None]}
This has a lookaway stopping the joints the same as stopping frobbing. But since you are using two objects, one the handwheel, and one the object controlled by the handwheel ... maybe something like this (just spitballing without testing it):
Handwheel
Scripts: TNVRelayTrap; NVRelayTrap2; NVTweqDevice; NVSimpleSchemaPlayerTrap
Design Note: NVRelayTrapOn="FrobWorldBegin"; NVRelayTrapOff="FrobWorldEnd"; NVRelayTrapTDest="[Me]"; NVRelayTrap2On="Null"; NVRelayTrap2Off="WorldDeSelect"; NVRelayTrap2TDest="[Me]"; NVSchema="squeaky_lp"
FrobInfo: {Script, FocusScript; [None]; [None]}
Then just have NVTweqDevice on the controlled object.
That should do everything BUT:
1. control another object
2. if the joint animation reached its final position, prevent it from sending TurnOff / playing the reverse joint animation on FrobWorldEnd or WorldDeSelect
For that you would need something that responds to TweqComplete. So my thought is to:
1. Create a metaprop with the NVRelayTraps and NVTweqDevice stuff on it.
2. Have the metaprop OFF of the Handwheel at the start.
3. Have NVMetaTrap on the Handwheel ADD the Metaprop on WorldSelect and REMOVE it on TweqComplete.
That way, looking at the handwheel will ADD the metaprop, frobbing it will start the forwards rotation, stopping the frob or looking away before TweqComplete will reverse the rotation, TweqComplete will deactivate the handle by removing the metaprop until it is looked at again AND frobbed.
I think.
Oh, you'll need another NVRelayTrap on the handwheel all the time to control the intended object with a turnon/turnoff, say NVRelayTrap3 in order to avoid confusion with the other two NVRelayTraps on the metaprop.
Something like that should work.
When you get it working, please post YOUR ultimate solution. :)
Yandros on 10/12/2015 at 15:28
I should have been more clear - there is no joint tweq to animate on the world object while the button is being held, I'm just playing a sound. Here's a full rundown of the setup.
The situation is prying open a crate with a crowbar. I want the player to have to use the crowbar on the crate and hold it while the sound of prying is played, which runs about 6 seconds. If they release the button or look away, the sound stops and it all starts over when they frob it again. If they hold it down long enough, the crate lid opens (synched to the part at the end of the sound effect of that happening). I have it all working now, except once they frob the crate with the crowbar, they can release it and the sound plays and the crate opens, so they can literally frob it and walk across the room while the sound plays and the crate then opens with them 20 feet away. So I'm trying to simulate that they have to keep applying the crowbar until the crate opens, like in real life.
LarryG on 10/12/2015 at 15:44
Quote:
NVSimpleSchemaPlayerTrap (NVTrap)
A simple script that plays the schema specified by NVSchema at its location upon receiving TurnOn, and halts the schema on TurnOff
Use the two relaytrap approach to control NVNVSimpleSchemaPlayerTrap.
Yandros on 10/12/2015 at 15:57
Yeah, I figured that much, but my stumbling block (this is all in my head mind you, haven't tried anything in Dromed yet) is how to only activate it when the crate is frobbed with the crowbar. In my case, FrobWorldEnd for the NVRelayTrapOn won't cut it. Neither will S&R I don't think, since I don't know how to detect when the button is released (i.e. the stim from the crowbar is no longer present).
LarryG on 10/12/2015 at 16:23
What about this:
1. Set up the crate with the Lock script and have it locked such that the 3rd lockpick will pick it.
Quote:
Lockgen.osm 1/G/2
Toggles the Engine Features\Locked property. TurnOn or Lock turns it on. TurnOff or Unlock turns it off. Does nothing if the property doesn't exist.
Note that LockSounds is a different script and you don't want that.
2. Set up the crowbar as a 3rd lockpick.
3. Use the NowUnlocked &ct. lock messages to control things.
This has the advantage that as you make progress "unlocking" the crate, if you stop frobbing with the crowbar (3rd lockpick), the progress is maintained, just like it would be in RL.
Yandros on 10/12/2015 at 18:30
That's a good idea I think, although I don't want to save the progress, despite it being a little more realistic. I can't pause the prying sound in the middle and restart it there, so I have to start it over each time, so I would want to start the unlocking process over too. I suppose I could do that in the PickCfg if I can make it just one tumbler, but specify the duration - then it will restart I think if they release the button and refrob. Is duration available in the advanced pick config?