Lucasistheman Posted July 7, 2012 Share Posted July 7, 2012 Since we're saying to run the phase once a 1/4 or more of the health is gone that means if the player deals damage that gets it to 1/2 or the 50% phase then the 75% stage would be triggered instead of the 50% or 25% stage if (NPC1Health <= 0.75) so here we would have to mention if NPC1Health <= 0.75 && NPC1Health > 0.5 aswell Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 Since we're saying to run the phase once a 1/4 or more of the health is gone that means if the player deals damage that gets it to 1/2 or the 50% phase then the 75% stage would be triggered instead of the 50% or 25% stage if (NPC1Health <= 0.75) so here we would have to mention if NPC1Health <= 0.75 && NPC1Health > 0.5 aswell ok i can add that. thats also why i set up the increment to NPC1phase... once the .75 is hit... then it adds +1 to NPC1Phase thats why there are two if functions one for the health and one for the phase. Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 7, 2012 Share Posted July 7, 2012 (edited) Maybe the phase should be the first and then it should check to see the health of the NPC. So simply swap the NPC1Phase and NPC1Health so if NPC1Phase is before if NPC1Health 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 dont know what u just typed there but how can i make it first? it adds the increment based on whether the health is at .75... i cant just add an increment without an IF value. Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 7, 2012 Share Posted July 7, 2012 Sorry for some reason when I copy and paste the Nexus Forums are adding all that extra code which shouldn't show up. Hopefully they stop doing that with this.Scriptname CoT00Test extends ObjectReference 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 NPC1Phase == 0 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") NPC1Phase = NPC1Phase +1 endifelseif NPC1Phase == 1 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") NPC1Phase = NPC1Phase +1 endifelseif NPC1Phase == 2 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") NPC1Phase = NPC1Phase +1 endifendIfendEvent Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 ok i will try that. i am reading up on literal references. Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 have you ever messed with while statements? i did a bit in my college programming essentials class, but never really seen it used much in papyrus, but it compiles. it creates a loop until the while statement is untrue. http://www.creationkit.com/Statement_Reference Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 here: 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") while NPC1Phase >= 0 && NPC1Phase < 3 if (NPC1Health <= 0.75 && NPC1Health > 0.5) if NPC1Phase == 0 ;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 NPC1Health == 0 endif elseif NPC1Phase == 1 if (NPC1Health <= 0.5 && NPC1Health > 0.25) ;Initiate Phase 4 NPC1.MoveTo(teleportnointeraction01) DKQRAGDP01.Enable() NPC1.Disable() myQuest01.SetStage(StageSet02) DKRAGfake01.Enable() Debug.Trace("NPC1 has less then 50% health remaining") NPC1Phase = NPC1Phase +1 NPC1Health == 0 endif elseif NPC1Phase == 2 if (NPC1Health <= 0.25) ;Initiate Phase 6 NPC1.MoveTo(teleportnointeraction01) DKQRAGDP02.Enable() myQuest01.SetStage(StageSet03) DKRAGfake02.Enable() Debug.Trace("NPC1 has less then 25% health remaining") NPC1Phase = NPC1Phase +1 NPC1Health == 0 endif endIf endwhile endevent Link to comment Share on other sites More sharing options...
Lucasistheman Posted July 7, 2012 Share Posted July 7, 2012 I've never messed around or attempted to use the While function but it does seem to help in a way and might help you make this script, I'm just no so sure how :S Link to comment Share on other sites More sharing options...
kane4355 Posted July 7, 2012 Author Share Posted July 7, 2012 this also might help me me out with the random location part, creating a loop and running him through each location. Link to comment Share on other sites More sharing options...
Recommended Posts