Demeggy Posted October 12, 2009 Share Posted October 12, 2009 Lo all, well, after a two week hol, Im back to progress with my mod. My latest headscratcher comes in the form of more scripting. Ive been sat here now for two hours trying to resolve this pickle of mine; I'm trying to have it so that the player selects a door from a terminal. Then they exit the terminal, pull a lever and the door enables. My problem is how to get from part A to part B. I can enable the door directly from the terminal (i.e. Open door 1 - Door1REF), but I dont want to do that, and I cant figure out how to set the lever to enable Door1REF. I don't think im being too descriptive, but if you can fathom out what im getting at, any help would be appreciated. Thanks :) Link to comment Share on other sites More sharing options...
Demeggy Posted October 12, 2009 Author Share Posted October 12, 2009 Idiot boy... s'alright, a quick think about things away from the computer and the answer came straight to me. *Slap* :wallbash: Sorry mods, please lock. :) EDIT: Noooo, wait - sod it, I might aswell drop this in here and hope somebody has a goosey :) Ive beent rying to get my head around the getsecondspassed function all night now, and no joy. What am i doing wrong? The player pulls a lever, a sound is played, a timer counts down from a random number of seconds (between 30 to 90 seconds), when the timer reaches 0, another sound is played and the result is played (in this case, a disabled door blocking the players exit). It all sounds unorthdox, but it has its reasons I assure y'all :P Anyhow, the code; SCN trapdoorleverSCRIPT float timer begin OnActivate TriggerHitShader 7 playsound trapdoorwhooshSOUND showMessage MovingBox if timer > 60 set timer to timer - GetSecondsPassed else playsound trapdoorwhooshSOUND lockedtrapdoorREF.disable showMessage MovingBoxStopped endif end Cheers! Link to comment Share on other sites More sharing options...
Cipscis Posted October 12, 2009 Share Posted October 12, 2009 Here's my reply from your thread on the official forums:edit: making your variable be type "short" is more typical for what you're doing (int).In Fallout 3, there is no difference between variables declared as "short", "long" or "int", so it won't matter which keyword is used here. Personally I prefer "int", but it depends entirely on personal preference. My only qualm at the moment is the getsecondspassed function. It doesnt seem to be fully working. Ive changed the 'if timer > 60' to 90, but it's still relatively quick. If I want it to take say, a minute, would I need to put something else in?You need to have another look at how your timer is running. Looking at the last script that you posted, your "timer" variable is never set to any value above 60 or 90 (remember all variables are initialised to 0), so your "if timer > 60" condition will never return true. In other words, your timer isn't running so I'd expect the sound to play as soon as the lever is pulled. If I've interpreted what you want correctly from the code you've posted, then hopefully this will work for you:ScriptName leverSCRIPT float fTimer int bActive int bDoOnce Begin OnActivate player if bDoOnce Return elseif bActive ;&& bDoOnce == 0 else ;if bActive == 0 set bActive to 1 TriggerHitShader 7 PlaySound wheezeSOUND ShowMessage Leaving endif End Begin GameMode if bActive else ;if bActive == 0 Return endif if fTimer < 60 set fTimer to fTimer + GetSecondsPassed else set bActive to 0 set bDoOnce to 1 PlaySound landSOUND intDoorLockedREF.Disable ShowMessage Landed TriggerHitShader 7 endif End Cipscis Link to comment Share on other sites More sharing options...
Recommended Posts