Jump to content

[LE] Wanting to make Timer for OnDying Script.


wilwhitt56

Recommended Posts

I'm wanting to improve I script i'm working on with a timer connected to it. What I want to happen is, on the death of the boss, A timer will count down. At certain intervals FX's will go off connected to Xmarkers. Like at the initial trigger, rocks will fall and collapsing Audio will trigger. At 10 seconds, same thing with an affect happening on a machine in the middle of the room. 15 same thing. At 20 seconds, a Massive magic explosion goes off and a triggerbox activates that takes up the whole chamber and kills the player.

 

Speaking of the rocks, I'm trying to use the rocks from the lean-to traps, but when the initial FX goes off, using Enable parent, they appear but don't move. They just float there. I tested it with an actual movable object (bones) and it does the same thing, but when touched they fell. Am I doing something wrong?

Edited by wilwhitt56
Link to comment
Share on other sites

Post your script, so that we can see the route you have taken and provide you the answer, but everything is done with the function 'RegisterForSingleUpdate'.


That's what happens when you have an 'Initially Disabled' havok sensitive object and then you enable it, but from what I can remember this issue happens only on SSE and not on SLE, there is a workaround to this.

1) After you enable the rocks you place an 'Empty Explosion' to apply force / and movment to the objects, you can use the explosion the critter's scripts uses to scatter/disperse the insects after spawning them.

* Its not called 'Empty Explosion', I just can't remember the name.


2) Replace those rock with the 'Debris Explosion' and enable static rocks when the 'Dust' fx of the 'Debris Explosion' fires.

Link to comment
Share on other sites

 

Post your script, so that we can see the route you have taken and provide you the answer, but everything is done with the function 'RegisterForSingleUpdate'.
That's what happens when you have an 'Initially Disabled' havok sensitive object and then you enable it, but from what I can remember this issue happens only on SSE and not on SLE, there is a workaround to this.
1) After you enable the rocks you place an 'Empty Explosion' to apply force / and movment to the objects, you can use the explosion the critter's scripts uses to scatter/disperse the insects after spawning them.
* Its not called 'Empty Explosion', I just can't remember the name.
2) Replace those rock with the 'Debris Explosion' and enable static rocks when the 'Dust' fx of the 'Debris Explosion' fires.

 

here's the script so far:

Scriptname CGAlismaDeathScript extends Actor
ObjectReference Property CGCollapseFX Auto
Event OnDying(Actor CGNPCAlisma)
CGCollapseFX.Enable()
EndEvent
I found this one called fakeForceFakeCritter as an explosion, is that it? How do I put it in, cause it's not letting me place it in the scene? Do I attach it somewhere?
Edited by wilwhitt56
Link to comment
Share on other sites

Might just need a little push

 

WhateverObject.ApplyHavokImpulse(0.1,0.1,1.0,0.1) but do make sure it has loaded 3D before attempting this

 

Play with the floats as needed. May not even solve your issue, just making you aware of that potentially useful call

 

As for timing, there is also OnDeath() which occurs a few moments after OnDying() and then theres also just plain ole Utility.Wait(1.0) for however long you want to delay beyond that to nudge or collapse something

Link to comment
Share on other sites

Your description made thought that you were doing some sort of complex quest scene, that's why I asked you to post your scripts.

Yeap, you can just use 'Utility.Wait()'


Event OnDying(Actor CGNPCAlisma)
CGCollapseFX.Enable()
Utility.Wait(10)
:Do my awesome stuff
Utility.Wait(20)
:Do my other awesome stuff
EndEvent



It could be this one 'fakeForceFakeCritter', but I'm not sure (I can't remember), just find a critter and open its script's property to see the name of the explosion used.

You could also use 'ApplyHavokImpulse()', but I think that is kind of an overkill if you have like 20 rocks whilw placing an explosion will do the same thing is only 1 line of code instead of using 20 lines 1 for each rock.



To use an explosion you need to use the function 'PlaceAtMe().

Example:


ObjectReference Property TargetToPlaceExplosion Auto
Explosion Property MyCoolExplosion Auto

EVENT Some Event....
TargetToPlaceExplosion.PlaceAtMe(MyCoolExplosion)
ENDEVENT


Link to comment
Share on other sites

 

Your description made thought that you were doing some sort of complex quest scene, that's why I asked you to post your scripts.
Yeap, you can just use 'Utility.Wait()'
Event OnDying(Actor CGNPCAlisma)
    CGCollapseFX.Enable()
    Utility.Wait(10)
    :Do my awesome stuff
    Utility.Wait(20)
    :Do my other awesome stuff
EndEvent
It could be this one 'fakeForceFakeCritter', but I'm not sure (I can't remember), just find a critter and open its script's property to see the name of the explosion used.
You could also use 'ApplyHavokImpulse()', but I think that is kind of an overkill if you have like 20 rocks whilw placing an explosion will do the same thing is only 1 line of code instead of using 20 lines 1 for each rock.
To use an explosion you need to use the function 'PlaceAtMe().
Example:
ObjectReference Property TargetToPlaceExplosion Auto
Explosion Property MyCoolExplosion Auto
 
EVENT Some Event....
       TargetToPlaceExplosion.PlaceAtMe(MyCoolExplosion)
ENDEVENT

 

Here's the script I got so far:

Scriptname CGAlismaDeathScript extends Actor
ObjectReference Property CGCollapseFX Auto
ObjectReference Property CGCollapseFX02 Auto
ObjectReference Property CGCollapseFX03 Auto
ObjectReference Property CGCollapseFX04 Auto
ObjectReference Property CGBOOMFX Auto
ObjectReference Property CGRocks01 Auto
Explosion Property MyCoolExplosion Auto
Event OnDying(Actor CGNPCAlisma)
CGCollapseFX.Enable()
CGCollapseFX.ApplyHavokImpulse(1,1,0.1,1) <<<<------------
RegisterForSingleUpdate(15)
endEvent
Event OnUpdate()
Utility.Wait(5)
CGCollapseFX02.Enable()
Utility.Wait(5)
CGCollapseFX03.Enable()
Utility.Wait(5)
CGCollapseFX04.Enable()
CGBOOMFX.Enable()
CGBOOMFX.PlaceAtMe(MyCoolExplosion)
endEvent
The explosion is working, but the rocks still won't fall. Not sure what I did wrong. The rocks are connected to Xmarkers, which has them initially disabled. When the boss dies, the rocks shoudl re-enable and fall. They're not. Sorry if this sounds to the point, work kicked my butt today.
Edited by wilwhitt56
Link to comment
Share on other sites

 

 

Your description made thought that you were doing some sort of complex quest scene, that's why I asked you to post your scripts.
Yeap, you can just use 'Utility.Wait()'
Event OnDying(Actor CGNPCAlisma)
    CGCollapseFX.Enable()
    Utility.Wait(10)
    :Do my awesome stuff
    Utility.Wait(20)
    :Do my other awesome stuff
EndEvent
It could be this one 'fakeForceFakeCritter', but I'm not sure (I can't remember), just find a critter and open its script's property to see the name of the explosion used.
You could also use 'ApplyHavokImpulse()', but I think that is kind of an overkill if you have like 20 rocks whilw placing an explosion will do the same thing is only 1 line of code instead of using 20 lines 1 for each rock.
To use an explosion you need to use the function 'PlaceAtMe().
Example:
ObjectReference Property TargetToPlaceExplosion Auto
Explosion Property MyCoolExplosion Auto
 
EVENT Some Event....
       TargetToPlaceExplosion.PlaceAtMe(MyCoolExplosion)
ENDEVENT

 

Here's the script I got so far:

Scriptname CGAlismaDeathScript extends Actor
ObjectReference Property CGCollapseFX Auto
ObjectReference Property CGCollapseFX02 Auto
ObjectReference Property CGCollapseFX03 Auto
ObjectReference Property CGCollapseFX04 Auto
ObjectReference Property CGBOOMFX Auto
ObjectReference Property CGRocks01 Auto
Explosion Property MyCoolExplosion Auto
Event OnDying(Actor CGNPCAlisma)
CGCollapseFX.Enable()
CGCollapseFX.ApplyHavokImpulse(1,1,0.1,1) <<<<------------
RegisterForSingleUpdate(15)
endEvent
Event OnUpdate()
Utility.Wait(5)
CGCollapseFX02.Enable()
Utility.Wait(5)
CGCollapseFX03.Enable()
Utility.Wait(5)
CGCollapseFX04.Enable()
CGBOOMFX.Enable()
CGBOOMFX.PlaceAtMe(MyCoolExplosion)
endEvent
The explosion is working, but the rocks still won't fall. Not sure what I did wrong. The rocks are connected to Xmarkers, which has them initially disabled. When the boss dies, the rocks shoudl re-enable and fall. They're not. Sorry if this sounds to the point, work kicked my butt today.

 

Alright. I think I got it the way I wanted it to look. Decided to remove the boulders and replace them with havokRockExplosions ( since I figured out how to do it :smile:).

Michael Bay eat your heart out:

Scriptname CGAlismaDeathScript extends Actor

ObjectReference Property CGCollapseFX Auto
ObjectReference Property CGCollapseFX02 Auto
ObjectReference Property CGCollapseFX03 Auto
ObjectReference Property CGCollapseFX04 Auto
ObjectReference Property CGRocks01 Auto
ObjectReference Property CGRocks002 Auto
ObjectReference Property CGRocks003 Auto
ObjectReference Property CGRocks004 Auto
ObjectReference Property CGRocks005 Auto
ObjectReference Property CGRocks006 Auto
ObjectReference Property CGBOOMFX Auto
ObjectReference Property CGSparks01 Auto
ObjectReference Property CGSparks02 Auto
ObjectReference Property CGSparks03 Auto
Explosion Property MyCoolExplosion Auto
Explosion Property MyCoolExplosion02 Auto
Explosion Property MyCoolExplosion03 Auto
Explosion Property MyCoolExplosion04 Auto
Explosion Property MyCoolExplosion05 Auto
Explosion Property MyCoolExplosion06 Auto
Explosion Property MyCoolExplosion07 Auto
Explosion Property MyCoolExplosion08 Auto
Explosion Property MyCoolExplosion09 Auto
Event OnDying(Actor CGNPCAlisma)
CGCollapseFX.Enable()
CGRocks01.Enable()
CGRocks01.PlaceAtMe(MyCoolExplosion02)
CGSparks01.Enable()
CGSparks01.PlaceAtMe(MyCoolExplosion03)
CGRocks002.Enable()
CGRocks002.PlaceAtMe(MyCoolExplosion04)
CGSparks02.Enable()
CGSparks02.PlaceAtMe(MyCoolExplosion08)
RegisterForSingleUpdate(15)
endEvent
Event OnUpdate()
Utility.Wait(5)
CGCollapseFX02.Enable()
CGRocks003.Enable()
CGRocks003.PlaceAtMe(MyCoolExplosion05)
CGRocks004.Enable()
CGRocks004.PlaceAtMe(MyCoolExplosion06)
CGSparks03.Enable()
CGSparks03.PlaceAtMe(MyCoolExplosion09)
Utility.Wait(5)
CGCollapseFX03.Enable()
CGRocks005.Enable()
CGRocks005.PlaceAtMe(MyCoolExplosion07)
CGRocks006.Enable()
CGRocks006.PlaceAtMe(MyCoolExplosion07)
Utility.Wait(5)
CGCollapseFX04.Enable()
CGBOOMFX.Enable()
CGBOOMFX.PlaceAtMe(MyCoolExplosion)
endEvent
Edited by wilwhitt56
Link to comment
Share on other sites

I didn't reply to your previous post because I've been very busy with work (I've been working my a** off), but it's clear that you are trying to do this on SSE, which has this bug with enabling Havok sencetive objects and not responding.


But, it looks that you took the other option I propose by using the 'Debris Explosion' (I named it like this because I couldn't remember the exact name.


As for the script, it looks all right for what you are aiming to achieve.


TIP

- Writing this just in case you don't already know it: The 'OnDying()' event fires the minute the actor starts dying, when the blow kills the actor and he is still standing.

The 'OnDeath()' event fires when the actor actually touches thew ground and all movement stops, this does not includes any other 'force' that may move the actor further, like and explosion or falling from a cliff near his death.


- If you place the actual name ID of the reference in your script, and in your script, the explosion, you can then just press the 'autofill' button and the property will be automatically filled.

This is very usuful and time saving if you have a large script.

For example:


Explosion Property havokRockExplosion Auto

EVENT Some Event...
CGRocks01.PlaceAtMe(havokRockExplosion)
ENDEVENT

Link to comment
Share on other sites

  • Recently Browsing   0 members

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