kane4355 Posted July 8, 2012 Author Share Posted July 8, 2012 im coming close to just giving up on my intricate boss fight. the way i had the while loop set up above did nothing different and i been messing around with while loops in other areas and it just seems to be causing issues..... this crap is beyond me and i wish i could showvars on an actor im in combat with but unfortunately i cannot. it can tell me which part of the script, whether its the increment or the health isnt working right. Link to comment Share on other sites More sharing options...
kane4355 Posted July 8, 2012 Author Share Posted July 8, 2012 ah so ur not gonna believe this! and i do believe that it has to do with something dealing with variables locking up. I was able to make the next phase happen but i had to split it up into two seperate scripts and it worked perfectly fine! here are the scripts: Scriptname DKRashPhaseset01 extends Actor Actor Property NPC1 Auto int NPC1Phase = 0 ;initiates phase increment value ObjectReference Property teleportnointeraction01 auto Quest Property myQuest01 auto int Property StageSet01 auto int Property StageSet02 auto int Property StageSet03 auto ObjectReference Property DKRAGfake01 auto ObjectReference Property DKRAGfake02 auto ObjectReference Property DKRAGdraugrthrall01 auto ObjectReference Property DKQRAGDP01 auto ObjectReference Property DKQRAGDP02 auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) float NPC1Health = NPC1.GetAVPercentage("Health") ; Obtain NPC1's current health actor value to establish phase lines if NPC1Phase == 0 if (NPC1Health <= 0.75 && NPC1Health > 0.5) ;Initiate Phase 2 NPC1.MoveTo(teleportnointeraction01) DKRAGdraugrthrall01.Enable() NPC1.Disable() myQuest01.SetStage(StageSet01) DKRAGfake01.Enable() Debug.Trace("NPC1 has less then 75% health remaining") NPC1Phase = NPC1Phase +1 endif endif endevent Scriptname DKRashPhaseset02 extends Actor Actor Property NPC1 Auto int NPC1Phase = 0 ;initiates phase increment value ObjectReference Property teleportnointeraction01 auto Quest Property myQuest01 auto int Property StageSet02 auto ObjectReference Property DKRAGfake01 auto ObjectReference Property DKRAGfake02 auto ObjectReference Property DKQRAGDP01 auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) float NPC1Health = NPC1.GetAVPercentage("Health") ; Obtain NPC1's current health actor value to establish phase lines if NPC1Phase == 0 if (NPC1Health <= 0.5 && NPC1Health > 0.25) ;Initiate Phase 4 NPC1.MoveTo(teleportnointeraction01) DKQRAGDP01.Enable() NPC1.Disable() myQuest01.SetStage(StageSet02) DKRAGfake02.Enable() Debug.Trace("NPC1 has less then 50% health remaining") NPC1Phase = NPC1Phase +1 endif endif endevent i also removed the while loop because it was not needed and voila! it works.... but is this satisfactory being two scripts? they work... or does it tell us where the problem lies? i still have so much to do with the next phase.... im wondering if a while loop will do good at all. Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 8, 2012 Share Posted July 8, 2012 (edited) If the script works but you have to separate it out into a different script, then that is still great :) but have you tried using states? I just thought of states when I was looking at how one time activation scripts work. Phase1 will be in the default state then you change it to a new state for the next phase. Maybe this script might work as well as your multiple script per phase, if not the as long as your multiple scripts work out the way you want them your fine :) Scriptname CoT00Test extends ObjectReference Actor Property NPC1 Auto ObjectReference Property teleportnointeraction01 auto Quest Property myQuest01 auto int Property StageSet01 auto int Property StageSet02 auto int Property StageSet03 auto ObjectReference Property DKRAGfake01 auto ObjectReference Property DKRAGfake02 auto ObjectReference Property DKRAGdraugrthrall01 auto ObjectReference Property DKQRAGDP01 auto ObjectReference Property DKQRAGDP02 auto Auto State Phase1 Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) ; Obtain NPC1's current health actor value to establish phase lines float NPC1Health = NPC1.GetAVPercentage("Health") if(NPC1Health <= 0.75) ;Initiate Phase 2 NPC1.MoveTo (teleportnointeraction01) DKRAGdraugrthrall01.Enable() myQuest01.SetStage(StageSet01) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 75% health remaining") GoToState("Phase2") endif EndEvent State Phase2 Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) ; Obtain NPC1's current health actor value to establish phase lines float NPC1Health = NPC1.GetAVPercentage("Health") if (NPC1Health <= 0.50) ;Initiate Phase 4 NPC1.MoveTo (teleportnointeraction01) DKQRAGDP01.Enable() myQuest01.SetStage(StageSet02) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 50% health remaining") GoToState("Phase3") endif EndEvent EndState State Phase3 Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) ; Obtain NPC1's current health actor value to establish phase lines float NPC1Health = NPC1.GetAVPercentage("Health") if (NPC1Health <= 0.25) ;Initiate Phase 6 NPC1.MoveTo (teleportnointeraction01) DKQRAGDP02.Enable() myQuest01.SetStage(StageSet03) DKRAGfake02.Enable(true) Debug.Trace("NPC1 has less then 25% health remaining") endif endEvent EndState Edited July 8, 2012 by Lucasistheman Link to comment Share on other sites More sharing options...
kane4355 Posted July 8, 2012 Author Share Posted July 8, 2012 i will try that... i actually moved onto the next confusing part of the script where it becomes even more complicated. i dont know if this will work but i put it together for the next phase where he teleports to random locations until he reaches 25% health... noting my luck with previous scripts i took it and put it in a seperate script, attached to a trap linker. when the quest is set to the next stage from killing off the dragon priests, the trap linker is activated by a fragment script in the quest stage. here is the script attached to the trap linker: Scriptname DKRashteleportPhaseset01 extends ObjectReference Actor Property NPC1 Auto int NPC1Phase = 0 ;initiates phase increment value ObjectReference Property teleportnointeraction01 auto Quest Property myQuest01 auto int Property StageSet01 auto int Property StageSet02 auto int Property StageSet03 auto ObjectReference Property DKRAGfake01 auto ObjectReference Property DKRAGfake02 auto ObjectReference Property DKRAGdraugrthrall01 auto ObjectReference Property DKQRAGDP01 auto ObjectReference Property DKQRAGDP02 auto ObjectReference Property teleport01 auto ObjectReference Property teleport02 auto ObjectReference Property teleport03 auto ObjectReference Property teleport04 auto ObjectReference Property teleport05 auto ObjectReference Property teleport06 auto event onActivate(objectReference akActivator) while NPC1Phase < 1 Utility.Wait(15) NPC1.MoveTo(teleport01) Utility.Wait(15) NPC1.MoveTo(teleport02) Utility.Wait(15) NPC1.MoveTo(teleport03) Utility.Wait(15) NPC1.MoveTo(teleport04) Utility.Wait(15) NPC1.MoveTo(teleport05) Utility.Wait(15) NPC1.MoveTo(teleport06) float NPC1Health = NPC1.GetAVPercentage("Health") if (NPC1Health <= 0.25) NPC1Phase = NPC1Phase +1 endif endwhile if NPC1Phase == 1 ;Initiate Phase 6 NPC1.MoveTo(teleportnointeraction01) DKQRAGDP02.Enable() myQuest01.SetStage(StageSet03) DKRAGfake02.Enable() Debug.Trace("NPC1 has less then 25% health remaining") endif endevent it activates once the trap linker activates and im hoping the while loop will teleport this guy every 15 seconds until he reaches 25% health. right now i just want this thing to become possible and with seperate scripts it is. I can come back later to fine tune it but for now it works. i havent tested the above script but it compiles. Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 8, 2012 Share Posted July 8, 2012 float NPC1Health = NPC1.GetAVPercentage("Health") if (NPC1Health <= 0.25) NPC1Phase = NPC1Phase +1 endif This bit here might want to go to the top otherwise this bit will be run last after all the Utility.Wait(15) 's Link to comment Share on other sites More sharing options...
kane4355 Posted July 8, 2012 Author Share Posted July 8, 2012 float NPC1Health = NPC1.GetAVPercentage("Health") if (NPC1Health <= 0.25) NPC1Phase = NPC1Phase +1 endif This bit here might want to go to the top otherwise this bit will be run last after all the Utility.Wait(15) 's changed. im going out on a limb whether this is gonna work.. i also have to put in between the utility waits, an enable/disable on xmarkers control lights and embers in the alcove where the dragon priest will be at. Link to comment Share on other sites More sharing options...
kane4355 Posted July 8, 2012 Author Share Posted July 8, 2012 and linking aptrolidlemarkers to the xmarkerheadings set up as the teleport locations... and setting an idle time. im hoping this keeps the NPC1 in place and not moving around up top. i may have to put collisions planes in place. thats IF the script works lol Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 8, 2012 Share Posted July 8, 2012 There actually is a function to disable a actor's ai so they will just stand still. So if you want him to ignore the player and just stand there you can disable his/her AI by: ActorRefNameHere.EnableAI(false) However if you want them to do certain idles and animations while teleporting you might want to make them appear StopCombat() with the player. Link to comment Share on other sites More sharing options...
kane4355 Posted July 8, 2012 Author Share Posted July 8, 2012 There actually is a function to disable a actor's ai so they will just stand still. So if you want him to ignore the player and just stand there you can disable his/her AI by: ActorRefNameHere.EnableAI(false) However if you want them to do certain idles and animations while teleporting you might want to make them appear StopCombat() with the player. no, i want combat to persist. the 6 locations the player and the NPC1 can interact with eachother as far as combat, but the 4 locations on the ledge i want NPC1 to stay on the ledge and not move anywhere at all, but can bombard and shoot magic at the player. the other 2 locations he can move around and he so chooses. but now im thinking collision markers will also effect magic so... im stuck on that now. Link to comment Share on other sites More sharing options...
kane4355 Posted July 8, 2012 Author Share Posted July 8, 2012 do you know what this does? i read somewhere that variable 6 controls certain functions on an actor, possibly idle functions. Self.GetActorRef().SetAV("Variable06", 1) Link to comment Share on other sites More sharing options...
Recommended Posts