Jump to content

wxyu

Members
  • Posts

    1
  • Joined

  • Last visited

Nexus Mods Profile

About wxyu

wxyu's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Hi I'm wxyu, a new beginner modder. I have a script that works, but not entirely the way I would like it. I would appreciate some input. The following script is an Enchantment Script written in Creation Kit. The purpose of the Enchantment is to: A weapon that applies three effects for each hit up to the final hit. On the final hit, a separate effect is applied; all previous effects are removed with the final hit. The number of hits to the final hit is random. What doesn't work/could be improved: 1) a damage modifier calculation 2) an array that I keep re-creating per hit instead of OnInit 3) a timer (Utility.Wait) to dispel all effects iff the player has not finished the series of hits within 30 seconds Problem 1 int Modifier = (10 - smiteCountTemp)/10 * WYUPlayerHolder.GetLevel() Debugging smiteCountTemp gives me integers 6 to 1 as expected. Debugging (10 - smiteCountTemp)/10 gives me 0. ? Integer/Float mismatch OR math fail? Also, is there a way to have int Modifier = 0.4 * WYUPlayerHolder.GetLevel() As 0.4 is a float Problem 2 Event OnEffectStart (Actor akTarget, Actor akCaster) Spell[] WYUsmiteSpellArray = new Spell[2] This means (I assume) that my array is recreated every time the Enchant is triggered (on Contact in this instance). I tried creating the Array in OnInit, but the OnEffectStart won't recognize the array then. I tried putting the Array into a GlobalVariable. Won't work. :biggrin: I tried creating the Array outside a function. Won't work. I crazily thought I could extend OnEffectStart to receive an Array as an argument. Doesn't work that way. :biggrin: Any ideas? I'd prefer to create the array only OnInit. Problem 3 My simplistic thinking was this: (pseudo) When start hitting-chain, set a timer (to dispel all effects), set a flag (to say I'm in hitting-chain) When finish hitting-chain, set flag (to say I'm not in hitting-chain) When timer fires, check if IT is the last timer, then fire (dispel all effects) My concern is a timer created in Iteration 1 of the Enchantment dispels all effects of Iteration 2 mid-way during Iteration 2's 30 second allotment (if that makes sense) A simple solution would be to delete Timer on hitting-chain end. However, I don't know of any other Timer method (that can be deleted) other than Utility.Wait Code Thank you for any help/ideas, much appreciated.
×
×
  • Create New...