Jump to content

Timers and Timing Issues in Scripts


Sealurk

Recommended Posts

The TL:DR version of this post is - how do I more precisely control the timing of events in the FO3 GECK?

 

The expanded version is this - in the Fallout 3 GECK I seem to be having some issues timing certain events and actions with scripts and I was wondering if anybody could offer some assistance.

 

Towards the very end of the quest in the mod I'm currently working on (and that is otherwise about 90-95% done) the following sequence of events is supposed to happen:

  1. The player selects a specific option on a terminal, which immediately shuts.
  2. The player's controls are disabled and a unique Mister Handy robot that has previously been 'unconscious' wakes and heads towards the player (similar to the poem-reading servant bot in the DC townhome - the robot wakes as planned but seems to do nothing else other than dance about on the spot, however this is likely a navmesh or package issue and ultimately isn't important, just annoying)
  3. A longer-than-normal fade to black imagespace modifer kicks in simulating anaesthesia.
  4. Before the imod finishes and fades from black the player's inventory is emptied into a nearby locker and the player is moved to a marker next to an operating table, simulating waking from surgery.
  5. Control is restored to the player and a message pops up informing them a new perk has been added. Optionally I would like to advance the clock a few hours or even a day to simulate a long, complicated surgical process.

Now, I can get most or all of these steps to work, but the timings for the above steps appear haphazard or worse, out of order. Similarly, earlier in the same mod I want to grab the player's attention as they walk into a large room by having groups of lights (attached to markers serving as enable parents) come on in sequence in a dramatic fashion, but the timer on that just doesn't seem to work at all.

scn BR01QuestScript

float timer
short doonce

begin gamemode

    if BR01Surgery >= 1
        set timer to (timer + getsecondspassed)

        if timer >= 1 && doonce == 0
            disableplayercontrols
            player.removeallitems BR01PlayerLockerREF 1 1
            set BR01MichelangeloREF.state to 1
            BR01MichelangeloREF.setunconscious 0
            BR01MichelangeloREF.removescriptpackage BR01VaultRobotNotActive
            BR01MichelangeloREF.addscriptpackage BR01VaultRobotSurgeryTravel
            BR01MichelangeloREF.evp
            if timer >= 6
                imod BR01FadeToBlackISFX
                Player.RemoveSpell WithdrawalQuantumNukacola
                Player.RemoveSpell WithdrawalAlcohol
                Player.RemoveSpell WithdrawalBuffout
                Player.RemoveSpell WithdrawalJet
                Player.RemoveSpell WithdrawalMentats
                Player.RemoveSpell WithdrawalMorphine
                Player.RemoveSpell WithdrawalPsycho
                Player.RestoreAV Health 1000000
                Player.RestoreAV perceptioncondition 100
                Player.RestoreAV endurancecondition 100
                Player.RestoreAV leftattackcondition 100
                Player.RestoreAV leftmobilitycondition 100
                Player.RestoreAV rightattackcondition 100
                Player.RestoreAV rightmobilitycondition 100
                player.RestoreAV RadiationRads 1000000
                if timer >= 10
                    player.moveto BR01PlayerWakeMarkerREF
                    player.addperk BR01TotalUpgrade
                    showmessage BR01TotalUpgradeMsg
                    if timer >= 16
                        rimod BR01FadeToBlackISFX
                        BR01MichelangeloREF.removescriptpackage BR01VaultRobotSurgeryTravel
                        enableplayercontrols
                        set doonce to 1
                        setstage BR01 200
                    endif
                endif
            endif
        endif
    endif
  
end
Link to comment
Share on other sites

Fantastic, it works near perfectly now. I have to tweak the timings and what happens at each stage to get the fully desired effect, but it is consistent, accurate and does what I need it to do. Many thanks!

 

Now all I need to do is get the lights to do the same and make the robot approach the player, but they're much smaller problems.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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