kane4355 Posted July 6, 2012 Author Share Posted July 6, 2012 yea that didint work either... im wondering if even on an onhit event i will still need the increment function... ill try the onhit. Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 6, 2012 Share Posted July 6, 2012 Functions have to be called or that will not activate so when you replaced Event OnActivate() with Function IncrementNPC1Phase(), there was nothing to call this function. You could just add Event OnHit(), IncrementNPC1Phase() and EndEvent and in theory that should call the function and the function should then run. Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 (edited) so onhit worked! he teleported out, next stage was set and the fake visual of him was displayed (like a mannaquin) however, him teleporting out was abrupt and the fake visual of him stands still just like a mannaquin. is there anyway to get it to play a certain animation in a loop?also, the script seems to stop once It hits 75 percent health and doesnt do anything for the 50% health iteration. it could be because the script isnt incrementing... i tried doing a function increment after the event but it seems to conflict. id either get an error for end of function or end of event even when it was specified. I am going to try an elseif for the 50% and 25% iteration, if that doesnt help then its the increment problem. here is what i have so far: 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) ; Obtain NPC1's current health actor value to establish phase lines float NPC1Health = NPC1.GetAVPercentage("Health") if (NPC1Health <= 0.75) if NPC1Phase == 0 ;Initiate Phase 2 NPC1.MoveTo (teleportnointeraction01) DKRAGdraugrthrall01.Enable() myQuest01.SetStage(StageSet01) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 75% health remaining") NPC1Phase = NPC1Phase +1 elseif (NPC1Health <= 0.50) elseif NPC1Phase == 1 ;Initiate Phase 4 NPC1.MoveTo (teleportnointeraction01) DKQRAGDP01.Enable() myQuest01.SetStage(StageSet02) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 50% health remaining") NPC1Phase = NPC1Phase +1 elseif (NPC1Health <= 0.25) elseif NPC1Phase == 2 ;Initiate Phase 6 NPC1.MoveTo (teleportnointeraction01) DKQRAGDP02.Enable() myQuest01.SetStage(StageSet03) DKRAGfake02.Enable(true) Debug.Trace("NPC1 has less then 25% health remaining") NPC1Phase = NPC1Phase +1 endif endIf endEvent and i am having issues understanding the whole playidle script:http://www.creationkit.com/PlayIdle_-_Actor Edited July 7, 2012 by kane4355 Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 7, 2012 Share Posted July 7, 2012 (edited) I think your missing a few endifs at the end of each section. Try this below and see if it resolves some of your problems. Event OnHit(ObjectReferenceakAggressor, 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) if NPC1Phase == 0 ;Initiate Phase 2 NPC1.MoveTo (teleportnointeraction01) DKRAGdraugrthrall01.Enable() myQuest01.SetStage(StageSet01) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 75% health remaining") NPC1Phase = NPC1Phase +1 endif elseif (NPC1Health <= 0.50) if NPC1Phase == 1 ;Initiate Phase 4 NPC1.MoveTo (teleportnointeraction01) DKQRAGDP01.Enable() myQuest01.SetStage(StageSet02) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 50% health remaining") NPC1Phase = NPC1Phase +1 </div><div>endif elseif (NPC1Health <= 0.25) if NPC1Phase == 2 ;Initiate Phase 6 NPC1.MoveTo (teleportnointeraction01) DKQRAGDP02.Enable() myQuest01.SetStage(StageSet03) DKRAGfake02.Enable(true) Debug.Trace("NPC1 has less then 25% health remaining") NPC1Phase = NPC1Phase +1 endif endIf endEvent As for the PlayIdle() I don't exactly know what issues your having, but if he will ignore the idle and go into combat it may be a good idea to make the player and boss StopCombat() with each other then use PlayIdle() so the boss will play the idle and then make him StartCombat() after the idle animation is complete. If his health recovers and you get the NPC1Health <= 0.5 again, for example, the NPC1Phase should stop the idle from occurring again. Edited July 7, 2012 by Lucasistheman Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 I think your missing a few endifs at the end of each section. Try this below and see if it resolves some of your problems. 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 linesfloat NPC1Health = NPC1.GetAVPercentage("Health") if (NPC1Health <= 0.75) if NPC1Phase == 0 ;Initiate Phase 2 NPC1.MoveTo (teleportnointeraction01) DKRAGdraugrthrall01.Enable() myQuest01.SetStage(StageSet01) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 75% health remaining") NPC1Phase = NPC1Phase +1 endifelseif (NPC1Health <= 0.50) if NPC1Phase == 1 ;Initiate Phase 4 NPC1.MoveTo (teleportnointeraction01) DKQRAGDP01.Enable() myQuest01.SetStage(StageSet02) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 50% health remaining") NPC1Phase = NPC1Phase +1 endifelseif (NPC1Health <= 0.25) if NPC1Phase == 2 ;Initiate Phase 6 NPC1.MoveTo (teleportnointeraction01) DKQRAGDP02.Enable() myQuest01.SetStage(StageSet03) DKRAGfake02.Enable(true) Debug.Trace("NPC1 has less then 25% health remaining") NPC1Phase = NPC1Phase +1 endifendIfendEvent As for the PlayIdle() I don't exactly know what issues your having, but if he will ignore the idle and go into combat it may be a good idea to make the player and boss StopCombat() with each other then use PlayIdle() so the boss will play the idle and then make him StartCombat() after the idle animation is complete. If his health recovers and you get the NPC1Health <= 0.5 again, for example, the NPC1Phase should stop the idle from occurring again. well i havent been able to test the elseif loop because as soon as i tried, the next test in game, the NPC1 ended up coming back during a stage when he wasnt supposed to, more than likely traveled through the walls and i dont know how. i set up collion layers all all four sides, an xmarker heading set up as the teleport location in the script (teleportnointeraction01). so im trying to figure this one out. maybe a stop combat will do. because he dissappears and once i start fighting the draugr he walks in from the general location where the silence room is set up. would a disable/enable hold his health? as far as the idle, its not necessarily whether it plays or not, its the fact that the creation kit tells me the function doesnt exist. so i dropped it and i cant play an animation either on an actor, apparently. Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 7, 2012 Share Posted July 7, 2012 A way of holding his health easily I would find is to create an int Property called NPC1Health and when the phase happens you use NPC1Health.SetValueInt((NPC1.GetActorValue("Health") as int) and when he reappears after the encounter you can make it NPC1.SetAV("Health", NPC1Health), reenable combat so his health should stop regenerating and continue the fight.The endif and changing elseif to if should allow the game to detect the phases much better and should prevent the repeating of phases that have already happened. So try out the new script and see if that helps in any way :) Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 (edited) A way of holding his health easily I would find is to create an int Property called NPC1Health and when the phase happens you use NPC1Health.SetValueInt((NPC1.GetActorValue("Health") as int) and when he reappears after the encounter you can make it NPC1.SetAV("Health", NPC1Health), reenable combat so his health should stop regenerating and continue the fight.The endif and changing elseif to if should allow the game to detect the phases much better and should prevent the repeating of phases that have already happened. So try out the new script and see if that helps in any way :) i replaced "if"s with elseif's because it wasnt looping at all. it would go through the first iteration of the 75%, teleport him out, call in the draugr, draugr die, bring him in and then id fight him until he was close to death. with elseif and with endif's etc... it is still not looping and I know the incrementing is working because its not looping back in a circle, but neither is he healing himself. the disable/enable idea i had worked and his health did persist through being disabled/enabled. he does not have any healing powers so that works. and now the first part of the fight is working (somewhat) but the next phase is not triggering, the part that starts at 50%. i never had an issue with the first phase happening more than once, it just would not trigger into the 50% phase. here is what i have so far on the script: Scriptname DKRashPhaseset01 extends Actor Actor Property NPC1 Auto int NPC1Phase = 0 ;initiates phase increment valueObjectReference Property teleportnointeraction01 autoQuest Property myQuest01 autoint Property StageSet01 autoint Property StageSet02 autoint Property StageSet03 autoObjectReference Property DKRAGfake01 autoObjectReference Property DKRAGfake02 autoObjectReference Property DKRAGdraugrthrall01 autoObjectReference Property DKQRAGDP01 autoObjectReference Property DKQRAGDP02 auto 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 linesfloat NPC1Health = NPC1.GetAVPercentage("Health") if (NPC1Health <= 0.75) if NPC1Phase == 0 ;Initiate Phase 2 NPC1.MoveTo(teleportnointeraction01) DKRAGdraugrthrall01.Enable() NPC1.Disable() myQuest01.SetStage(StageSet01) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 75% health remaining") NPC1Phase = NPC1Phase +1elseif (NPC1Health <= 0.50) elseif NPC1Phase == 1 ;Initiate Phase 4 NPC1.MoveTo(teleportnointeraction01) DKQRAGDP01.Enable() myQuest01.SetStage(StageSet02) DKRAGfake01.Enable(true) Debug.Trace("NPC1 has less then 50% health remaining") NPC1Phase = NPC1Phase +1elseif (NPC1Health <= 0.25) elseif NPC1Phase == 2 ;Initiate Phase 6 NPC1.MoveTo(teleportnointeraction01) DKQRAGDP02.Enable() myQuest01.SetStage(StageSet03) DKRAGfake02.Enable(true) Debug.Trace("NPC1 has less then 25% health remaining") NPC1Phase = NPC1Phase +1 endifendIfendEvent Edited July 7, 2012 by kane4355 Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 7, 2012 Share Posted July 7, 2012 elseif NPC1Phase == 1 ;Initiate Phase 4 Should that NPC1Phase == 1 ? Or should it be 3 if it says Phase 4? Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 it would if the increment value added up to 3 but since the last phase only added +1 then it only equals 1. it is phase 4, because its phase 4 of the whole fight whereas its the second phase of the script. its just there to help me label everything going on. Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 7, 2012 Share Posted July 7, 2012 (edited) In between these two add an endif and see if this helps in any way. NPC1Phase = NPC1Phase +1 endif elseif (NPC1Health <= 0.50) Edited July 7, 2012 by Lucasistheman Link to comment Share on other sites More sharing options...
Recommended Posts