Jump to content

Need scripter for advanced boss fight


Vandrath

Recommended Posts

Tried a couple of ways to get the FX in but none worked. the script wont compile. Ii found one way and got only one error when compiling.

function MistPhase(VisualEffect Property fx)
Fx.play(self, 2.0)
      disableNoWait(True)      ; fades-out the actor without pausing the script.
      mist.enable(True)        ; fades-in the mist. The script pauses until the fade-in has completed.
      utility.wait(10.0)

 

using that i still got the error:

 

Starting 1 compile threads for 1 files...

Compiling "BossFight"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\BossFight.psc(21,32): extraneous input 'Property' expecting ID

No output generated for BossFight, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on BossFight

 

Does this mean I have to have the specific ID of the effect i want to play in the script itself?

Link to comment
Share on other sites

do i put the Visualeffect property line any where in the script? i tried removing it and got this error

 

Starting 1 compile threads for 1 files...

Compiling "BossFight"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\BossFight.psc(22,1): variable Fx is undefined

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\BossFight.psc(22,4): none is not a known user-defined type

No output generated for BossFight, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on BossFight

Edited by Vandrath
Link to comment
Share on other sites

I finnaly got the script to work and decided to add a sound effect to play on the actors death. the problem now is the game wont play the visual effects or the sound effects even though the script compiles successfully. Here is the current script.

 

Scriptname BossFight extends Actor  

Sound Property soundFX Auto
VisualEffect Property FX  Auto  
ObjectReference Property Mist auto ; set to the mist
ObjectReference[] Property teleportMarkers auto ; fill the array with teleport markers

int stage = 0

event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \
 bool abBashAttack, bool abHitBlocked)
       float fHealthPercent = getAVPercentage("health")

       if  stage == 0 && fHealthPercent <= 0.75
               stage += 1
               MistPhase()
       elseif  stage == 1 && fHealthPercent <= 0.25
               stage += 1
               MistPhase()
       endif
endEvent

function MistPhase() 
Fx.play(self)
      disableNoWait(True)      ; fades-out the actor without pausing the script.
      mist.enable(True)        ; fades-in the mist. The script pauses until the fade-in has completed.
      utility.wait(10.0)

      int randomMarker = utility.RandomInt(0, teleportMarkers.length - 1) ; don't forget that the first item# in the array is ZERO, so the last item#  is "length - 1"
      moveTo(teleportMarkers[randomMarker])

      mist.disableNoWait(True) ; fade-out the mist without pausing the script
      enableNoWait(True)       ; fade-in the actor without pausing the script
endFunction

Event OnDeath(Actor akKiller)

 if (akKiller == Game.GetPlayer())
soundFX.play(self)

 endIf

endEvent

Link to comment
Share on other sites

@Vandrath: your script looks OK, so I suspect that you have not set the soundFX and FX properties correctly.

 

Here's a small improvement to the script. Playing sound from OnDeath() might make the sound play a bit late, you might get getter sound sync if you play it from OnDying():

 

 

Scriptname BossFight extends Actor  

Sound Property soundFX Auto
VisualEffect Property FX  Auto  
ObjectReference Property Mist auto ; set to the mist
ObjectReference[] Property teleportMarkers auto ; fill the array with teleport markers

int stage = 0

event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \
 bool abBashAttack, bool abHitBlocked)
       float fHealthPercent = getAVPercentage("health")

       if  stage == 0 && fHealthPercent <= 0.75
               stage += 1
               MistPhase()
       elseif  stage == 1 && fHealthPercent <= 0.25
               stage += 1
               MistPhase()
       endif
endEvent

function MistPhase() 
Fx.play(self)
disableNoWait(True)      ; fades-out the actor without pausing the script.
mist.enable(True)        ; fades-in the mist. The script pauses until the fade-in has completed.
utility.wait(10.0)

int randomMarker = utility.RandomInt(0, teleportMarkers.length - 1) ; don't forget that the first item# in the array is ZERO, so the last item#  is "length - 1"
moveTo(teleportMarkers[randomMarker])

mist.disableNoWait(True) ; fade-out the mist without pausing the script
enableNoWait(True)       ; fade-in the actor without pausing the script
endFunction

Event OnDying(Actor akKiller)
{it is probably preferable to play the death sound in OnDying rather than OnDeath to avoid sound delay}
if akKiller == Game.GetPlayer()
	int instanceID = soundFX.play(self)
	Sound.SetInstanceVolume(instanceID, 1.0)
endIf
endEvent

 

 

EDIT: depending on which visual fx you choose, you MIGHT have to specify the play duration: "fx.play(self, 10)" for example.

Edited by steve40
Link to comment
Share on other sites

Thanks Steve. That helped with the ondeath sound effect. The visual effect still wont play. I chose a couple of different effects and tested each one but they still wont play. Could it be an issue with the effect itself or could it be that the game sees that i have a sound effect played in the script so it decides not to play the sound on the visual effect and by extension the visual as well?

The arrays still dont work. The boss keep re appearing in one spot. Is there another way to script the arrays? There are 4 arrays on xmarker headings and they are labeled 0-3.

Edited by Vandrath
Link to comment
Share on other sites

D'oh.

 

You know what, I think the problem is that the actor is disabled immediately after playing the shader ... so the effect is played on the disabled actor ie. you can't see the effect because the actor is invisible :facepalm: :tongue:

 

Try putting a "utility.wait(5)" immediately after "fx.play(self)" just to confirm if that is the case.

 

I'll test the script in-game tonight and see if I can get the teleportation to work properly, and I'll try to figure out how to get the mist to play. Maybe an explosion effect would work better.

Edited by steve40
Link to comment
Share on other sites

lol im glad you realized the fx problem because thats something i never would have guessed. An explosion is nice (who doesnt love a good explosion) but that would contradict the lore of the fight. these types of vampires turn into mist and if you wanted to be sneaky when you had the ability to turn into mist i doubt you would want to "go out with a bang" .:P Thank you so much for your help guys. This wouldnt have happened without you two.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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