Mod First Day Release Problem: Urgent help needed!

Post » Wed Jun 20, 2012 1:54 am

Hey guys and girls,

I released my mod today for auto-cast racial powers and have been notified of an issue which I have no idea how to fix/ find!

Essentially there are three racial powers, for the Orc, Argonian and Redguard which work perfectly for the human player and as intended (trigger on hit, and then not again until a cooldown effect has ended). But for some reason they do not function correctly for NPC’s.

When hit, the Visual and Sound effects of the spell effect will play properly but the actual effect itself doesn’t. What’s more the effect will be cast on each hit after its been triggered.

I can’t comprehend what may be causing it, and can not be sure if its a script issue, or something I have done within the editor.

I would really appreciate it if someone could take a look at the mod, and see if they can figure it out. I have already acknowledged a few members of the forum who have helped me in this mod, and will update this for any who can help me now.

Links to the plugin:
http://skyrim.nexusmods.com/downloads/file.php?id=12575
http://steamcommunity.com/sharedfiles/filedetails/?id=14768
User avatar
Andrew Lang
 
Posts: 3489
Joined: Thu Oct 11, 2007 8:50 pm

Post » Wed Jun 20, 2012 1:43 am

Maybe post details of how the mod works including any scripts and how you've attached them.
User avatar
Portions
 
Posts: 3499
Joined: Thu Jun 14, 2007 1:47 am

Post » Wed Jun 20, 2012 1:16 am

We can download the mod and look at the MGEF's and related records, but we cant just look the scripts in their compiled form.
So, either post the scripts here (as code and spoilers if there are many ore they are long) or include them in the mod.
I'd prefer if you included them, gives others a chance to learn.

On an unrelated note, get yourself some visual representation, something like http://doenerkinq.deviantart.com/gallery/7214541 :D.
User avatar
Cheville Thompson
 
Posts: 3404
Joined: Sun Mar 25, 2007 2:33 pm

Post » Tue Jun 19, 2012 11:49 pm

I will give a brief description with how I have organised the power.
Race is assigned an ability > ability calls a scripted effect > effect calls a spell > spell calls the effect called by the origonal racial power.

The scripts follow the same structure, I will use the most simple one as an example.
Spoiler

Scriptname modArgonianProcEffect extends activemagiceffect  actor property selfRef auto hiddenfloat property HPthreshold = 0.15 autofloat property effectChance = 0.50 auto;values that dictate when a spell is cast.int property questCheck = 0 auto; property used to track brawls/jorrvaskrspell property FortifyEffect automagicEffect property FortifyPresent auto;spells and effects that are referenced below.quest property brawlquest autolocation property companionsHouse auto;two insatnces where I do not want to autocast a powerEVENT OnEffectStart(Actor Target, Actor Caster)		selfRef = caster	endEVENT; this defines the caster of this scripted effect as a property.EVENT onHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)	if	 (brawlquest.isrunning()) || (selfref.isinlocation(companionsHouse))		questcheck = 1	else		questcheck = 0	endif; on hit, a check is performed to see if a brawl is occuring.	if (selfRef.getActorValuePercentage("Health") < HPthreshold) && \		!(selfRef.HasMagicEffect(FortifyPresent)) && \		!(selfRef.isDead()) && \		(questcheck == 0)			float dice = utility.RandomFloat(0,1)			if dice <= effectChance				FortifyEffect.cast(selfRef,selfRef)			endif	endif; if the actors hp is below a certain amount and does NOT have a dummy effect and is NOT dead and questcheck = 0. a spell is cast if randomised criteria are met.endEVENT

I will get around to an avatar some day, but right now mods need fixin'!
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Wed Jun 20, 2012 8:54 am

This should be equivalent yet simpler.
Spoiler
scriptname modArgonianProcEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Properties /////////////////////////////////////////////////////////////////////////////;Spell property FortifyEffect autoQuest property BrawlQuest autoLocation property CompanionsHouse autofloat property RechargeDelay = 4.0 auto hiddenfloat property HPThreshold = 0.15 auto hiddenfloat property EffectChance = 0.5 auto hiddenbool property IsCharging auto hidden;///////////////////////////////////////////////////////////////////////////// / Events /////////////////////////////////////////////////////////////////////////////;event OnHit(ObjectReference u1, Form u2, Projectile u3, bool u4, bool u5, bool u6, bool u7)	Actor target = GetCasterActor()	if (IsCharging || \		target.IsDead() || \		target.GetActorValuePercentage("Health") > HPThreshold || \		BrawlQuest.IsRunning() || \		target.IsInLocation(CompanionsHouse))		return	endif	if (EffectChance > Utility.RandomFloat())		RegisterForSingleUpdateGameTime(RechargeDelay)		IsCharging = true		FortifyEffect.Cast(target)	endifendeventevent OnUpdate()	IsCharging = falseendevent
The Quest related checks might only need to run if the target is the player, not sure.

Since the script is so simple, I'd wager that, if there are issues with it, they related to the first if-statement.
User avatar
Joanne
 
Posts: 3357
Joined: Fri Oct 27, 2006 1:25 pm

Post » Wed Jun 20, 2012 9:56 am

This scripted effect is applied to NPC's too, so I need to ensure that auto-cast doesn't occur when an NPC hits the player/ player hits an NPC and a NPC hits an NPC in a brawl. Saying this, these issues still occured before the first IF statement was implemented, so I am certain this is not the cause of my problem.

I am interested in the ischarging thing you have put in, is this just adding a slight delay to ensure that the spell has time to cast properly? I based my script from the dragonpriest ultra mask, some of my other racial scripts are a little more complicated/ slightly different and my knowledge of papyrus is still quite small, so I have no idea how optimised my code is: evidently - not very!
User avatar
Big Homie
 
Posts: 3479
Joined: Sun Sep 16, 2007 3:31 pm

Post » Tue Jun 19, 2012 8:02 pm

This should accommodate for brawls.
Spoiler
scriptname modArgonianProcEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Properties /////////////////////////////////////////////////////////////////////////////;Quest property DGIntimidateQuest auto	; auto-bind in CKSpell property FortifyEffect auto    	; manual-bind in CKfloat property Cooldown = 4.0 auto hidden ; hours until the ability is ready againfloat property HPThreshold = 0.15 auto hiddenfloat property EffectChance = 0.5 auto hiddenbool property IsCooling auto hidden;///////////////////////////////////////////////////////////////////////////// / Events /////////////////////////////////////////////////////////////////////////////;event OnHit(ObjectReference u1, Form u2, Projectile u3, bool u4, bool u5, bool u6, bool u7)	; Guard against brawl fights	if (DGIntimidateQuest.IsRunning() && DGIntimidateQuest.GetCurrentStageID() < 100)		return	endif	Actor target = GetCasterActor()	if (IsCooling || \		target.IsDead() || \		target.GetActorValuePercentage("Health") > HPThreshold)		return	endif	if (EffectChance > Utility.RandomFloat())		RegisterForSingleUpdateGameTime(Cooldown)		IsCooling = true		FortifyEffect.Cast(target)	endifendeventevent OnUpdate()	IsCooling = falseendevent

IsCharging (now IsCooling+Cooldown) is a way to remove the need for the modCooldownDummy effect. Now the script controls everything.

Edit: Seems I was wrong about the DGIntimidateFaction, I couldn't find any script adding anyone this faction. I updated the code to fix that, should be relatively safe now.
User avatar
Kevin S
 
Posts: 3457
Joined: Sat Aug 11, 2007 12:50 pm

Post » Tue Jun 19, 2012 7:58 pm

wow cool! this is certainly more elegant than the cooldown I implemented (I was worried that having the cooldown as an effect could be problematic with resists or immunities).

By using "return" within the IF statement, I take it this is returning a null value, and the "event" script ends until it is next called?
I also assume that "If (iscooling ||....." is checking to see if it is true?
With regards to the cooldown time, is this done in game time or real time?

I really appreicate your help, not only will your post potentially fix my problem, but you have expanded my knowledge of papyrus to a new level! be certain I shall plonk your name in my credits :P

edit: oh, also there is a point when the player first enters jorrvaskr, when the companions are fighting each other in fist fights, I need to ensure that auto-cast does not occur then. There is a quest associated with it; but figured a nice and easy way to check this would be to get the actors location (as seen in my original script)
User avatar
His Bella
 
Posts: 3428
Joined: Wed Apr 25, 2007 5:57 am

Post » Tue Jun 19, 2012 11:17 pm

Yes, the return statement will terminate an event or a function and optionally return a value, if the value is omitted, none will be returned.

And yes again, the second if-statement checks whether to exit the event. And I structured the code this way, because you might only need to modify this one statement, if lucky.

Glad this helps, but note that I didn't test ANYTHING so ... :D
User avatar
suzan
 
Posts: 3329
Joined: Mon Jul 17, 2006 5:32 pm

Post » Tue Jun 19, 2012 7:42 pm

Well I can confirm your script works properly :) the bad news is, the problem that started this thread still persists.
Your script changes (in particular the cooldown aspect) has stopped the spell effect being cast with each hit, but for some reason, the visual effect is cast, as does the sound effect associated with the effect; but the actual effects are not applied to the NPC :S

here is the editor layout for the effect:
http://i43.tinypic.com/2zz2hk5.jpg
User avatar
Cccurly
 
Posts: 3381
Joined: Mon Apr 09, 2007 8:18 pm

Post » Wed Jun 20, 2012 3:37 am

Just an idea, of using states to take some load of the script engine. No functionality changes, just another way which should create less overhead.
Spoiler
scriptname modArgonianProcEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Properties /////////////////////////////////////////////////////////////////////////////;Quest property DGIntimidateQuest autoSpell property modArgonianHistskinSpell autofloat property Cooldown = 4.0 auto hiddenfloat property HPThreshold = 0.15 auto hiddenfloat property EffectChance = 0.5 auto hidden;///////////////////////////////////////////////////////////////////////////// / Events /////////////////////////////////////////////////////////////////////////////;event OnUpdate()	GoToState("Ready")endevent;///////////////////////////////////////////////////////////////////////////// / States /////////////////////////////////////////////////////////////////////////////;auto state Ready	event OnHit(ObjectReference u1, Form u2, Projectile u3, bool u4, bool u5, bool u6, bool u7)		if (DGIntimidateQuest.IsRunning() && DGIntimidateQuest.GetCurrentStageID() < 100)			return		endif		Actor target = GetCasterActor()		if (target.IsDead() || \			target.GetActorValuePercentage("Health") > HPThreshold)			return		endif		if (EffectChance > Utility.RandomFloat())			modArgonianHistskinSpell.Cast(target)			RegisterForSingleUpdateGameTime(Cooldown)			GoToState("Cooling")		endif	endeventendstatestate Cooling	; intentional left blank - why? see this:	; http://www.creationkit.com/States_%28Papyrus%29#How_Functions_Are_Picked	; so theoretically the OnUpdate block should be here, but	; not doing so makes the script failsafe.endstate

To address the issue Ill have to actually try and see what's going on, haven't got anything right now. Well, other than think that's quite odd. Actually this... does the issue happen to new and old savegames, or only old ones?
I'm thinking that editing the race records could cause issues - my best guess currently.
User avatar
CORY
 
Posts: 3335
Joined: Sat Oct 13, 2007 9:54 pm

Post » Wed Jun 20, 2012 3:52 am

I haven't really used states, but then wouldn't the OnUpdate() event in your script be in the "empty state"? Are you sure that it will be called when you're in the Ready or Cooling states?
User avatar
Matt Terry
 
Posts: 3453
Joined: Sun May 13, 2007 10:58 am

Post » Tue Jun 19, 2012 8:30 pm

I have been intending to learn some more about states! I will take a look into this! And I am using fresh unmodded saves to test the mod.

EDIT: also, just had a thought, with the way you have implemented the cooldowns (in the non-state form), would issues likely occur if multiple NPC's used the effect? (would the "onUpdate" affect all insatnces of the script being run?)
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm

Post » Tue Jun 19, 2012 11:41 pm

RandomNoob
Yes exactly, yet the script works beautifully. The empty state has a naming problem, it should be called implicit default state, because that's what it is.

On topic: Anyway, I just did a series of tests using my script but I failed to reproduce the issue. I used an old nord character, added the argonian power via console and it worked fine. Actually, both powers worked fine the nord and the argonian one.
So, I guess you can ask the users who have problems, for their savegames and we you can try to reproduce it that way.
Edit: We, if you need me.

Well, since you are interested in states, here a more proper/safe version.
Why this is the safest version yet, is left up to the you to figure out :wink:. This might not be that easy, concurrency can be quite complicated.
Spoiler
scriptname modArgonianProcEffect extends ActiveMagicEffect;////////////////////////////////////////////////////////////////////////////// Properties/////////////////////////////////////////////////////////////////////////////;Quest property DGIntimidateQuest autoSpell property modArgonianHistskinSpell autofloat property Cooldown = 4.0 auto hiddenfloat property HPThreshold = 0.15 auto hiddenfloat property EffectChance = 0.5 auto hidden;////////////////////////////////////////////////////////////////////////////// Events/////////////////////////////////////////////////////////////////////////////;event OnUpdate()	GoToState("Ready")endevent;////////////////////////////////////////////////////////////////////////////// States/////////////////////////////////////////////////////////////////////////////;auto state Ready	event OnHit(ObjectReference u1, Form u2, Projectile u3, bool u4, bool u5, bool u6, bool u7)		GoToState("Cooling")		; disables power in brawls		if (DGIntimidateQuest.IsRunning() && DGIntimidateQuest.GetCurrentStageID() < 100)			GoToState("Ready")			return		endif		; check power specific requirements		Actor target = GetCasterActor()		if (target.IsDead() || target.GetActorValuePercentage("Health") > HPThreshold)			GoToState("Ready")			return		endif		; lastly, add some randomness		if (EffectChance <= Utility.RandomFloat())			GoToState("Ready")			return		endif		RegisterForSingleUpdateGameTime(Cooldown)		modArgonianHistskinSpell.Cast(target)	endeventendstatestate Coolingendstate

EDIT: also, just had a thought, with the way you have implemented the cooldowns (in the non-state form), would issues likely occur if multiple NPC's used the effect? (would the "onUpdate" affect all insatnces of the script being run?)
No, because every magic effect gets its own script instance - nothing is shared.
User avatar
Sarah Edmunds
 
Posts: 3461
Joined: Sat Jul 08, 2006 8:03 pm

Post » Wed Jun 20, 2012 4:59 am

Xetrill, the powers work fine when you use them as the player: It just doesnt work when the powers activate on NPC characters. Best way to test, is to apply the script and go beat up some argonians in windhelm. The effect appears to trigger under the correct circumstances, but their health doesn't regenerate.
User avatar
Kyra
 
Posts: 3365
Joined: Mon Jan 29, 2007 8:24 am

Post » Wed Jun 20, 2012 2:17 am

Okay after another round of tests, I think I got it. Basically the effects work, they just don't do anything.

This is tested, verified:
The argonian effect (RaceArgonianFortifyHealthRate) changes the CombatHealthRegenMult actor value, it sets it to 10.0 which works as intended, but it doesn't do anything since the HealRate actor value is set to 0.0.
Changing the HealRate value to 1.0 (via console for example) makes the effect work.

This is untested:
The redguard effect (RaceRedguardFortifyStaminaRate) changes the StaminaRate which http://uesp.net/wiki/Tes5Mod:Actor_Value_Indices says is a non-combat value, so it's basically useless. It should modify the StaminaRateMult actor value instead, and StaminaRate probably needs to be non-zero, like with the argionians.

This leaves orcs and the RaceOrcBerserkEffect effect, which applies a perk. Why that would or more likely wouldn't work, I don't know.
I think the effect works, the reports are just false positives. This should be test-/verifiable by attaching a script to the perk that halla's when applied.
User avatar
Tina Tupou
 
Posts: 3487
Joined: Fri Mar 09, 2007 4:37 pm

Post » Tue Jun 19, 2012 10:50 pm

Hey Xetril. just note that RaceArgonianFortifyHealthRate is not actualy used, the power uses the "PerkArgonianFortifyRateNonCombat". (which modifies HealRate)

I am still confused though, becuase the effects work fine for the player but not NPC. Is this because the player has a different "heal rate"/stamina rate etc? (and the argonian perk works in combat for the player :P)

-on a slightly unrelated note, does the below look ok if i wanted to cast breton power when hit by a hostile spell?
Spoiler
scriptname modBretonProcEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Properties /////////////////////////////////////////////////////////////////////////////;Quest property DGIntimidateQuest auto   ; auto-bind in CKSpell property RacePower auto       ; manual-bind in CKlocation property WhiterunJorrvaskrLocation autofloat property Cooldown = 3.0 auto hidden ; hours until the ability is ready againfloat property EffectChance = 0.25 auto hiddenbool property IsCooling auto hidden;///////////////////////////////////////////////////////////////////////////// / Events /////////////////////////////////////////////////////////////////////////////;event OnHit(ObjectReference u1, Form u2, Projectile u3, bool u4, bool u5, bool u6, bool u7)        ; Guard against brawl fights        Actor target = GetCasterActor()		if (DGIntimidateQuest.IsRunning() && \				DGIntimidateQuest.GetCurrentStageID() < 100 || \				target.isinlocation(WhiterunJorrvaskrLocation))                return        endif        if (u2 as spell)			if (u2 as spell).ishostile()				return			endif		endif				if (IsCooling || \                target.IsDead())                return        endif        if (EffectChance > Utility.RandomFloat())                RegisterForSingleUpdateGameTime(Cooldown)                IsCooling = true                RacePower.Cast(target)        endifendeventevent OnUpdate()        IsCooling = falseendevent
User avatar
Love iz not
 
Posts: 3377
Joined: Sat Aug 25, 2007 8:55 pm

Post » Wed Jun 20, 2012 8:57 am

Hm, yeah I saw that argonians use that perk, I figured that was an error. Anyway you have to apply two effects, one for HealRate - as otherwise the effect would only work outside of combat - and, of course, CombatHealthRegenMult.

Yes, the player has differant (non-zero) values for these multipliers.

About the script, lets see ...
Well, first you should give u2 a proper name, I only named it that because I wasn't using, so I marked it unused.
Second, yes, but I would write it something like this:
if (IsCooling || target.IsDead()) 	returnendifSpell spellSource = source as Spellif (spellSource && spellSource.IsHostile())	returnendif
Like this because, it allows for consistency for all scripts in your mod. You see, spotting a possible error becomes almost trivial once you have a pattern to follow. Any deviation from a - verified to be working - pattern would look suspicious.
Besides the first if-statement is universally required, so why not put it first?

Diseases: The IsHostile way might not work. Because disease-magic-effects don't have the hostile-flag set - only the detrimental-flag. So it could be that IsHostile doesn't return true, besides this would also prevent the power triggering from any and all destruction spells.
But there aren't many diseases so it's easy to check for them.

Just create a FormList, lets name it modDiseases and add every disease spell. This allows for a simple is spell in list check:
FormList property modDiseases auto; ...Spell spellSource = source as Spellif (spellSource && modDiseases.HasForm(spellSource))	returnendif

Poisons: This seems harder than diseases. Sigh, BGS did really under utilize the keyword system. Anyway, poisons usually don't originate from Spell's but rather from potions, so I expect that the source (or u2) parameter is either that, a Potion or a MagicEffect or in the worst case scenario it could be none.
Lets leave the none case aside, because there isn't anything that could be done.

So, assuming poisons originate from potions:
Potion potionSource = source as Potionif (potionSource && potionSource.IsHostile())	returnendif
This should work, because all the AlchDamage* effects have the hostile-flag set.

If poisons are MagicEffect's, than there is no IsHostile function to be called, but there are keywords. The keyword MagicAlchHarmful should do the trick. And the code becomes:
Keyword property MagicAlchHarmful auto; ...MagicEffect magicSource = source as MagicEffectif (magicSource && magicSource.HasKeyword(MagicAlchHarmful))	returnendif
User avatar
Josh Lozier
 
Posts: 3490
Joined: Tue Nov 27, 2007 5:20 pm

Post » Tue Jun 19, 2012 6:25 pm

oh thats some good checks! I just realised that I didnt want a return for the hostile spell, I wanted the spell to cast when hit by a spell. that was jsut me being tierd! However having the ability to rule out poison and disease is a fix for a bug I didnt think was possible! :biggrin:
Spoiler
event OnHit(ObjectReference u1, Form source, Projectile u3, bool u4, bool u5, bool u6, bool u7)		; Guard against brawl fights		Actor target = GetCasterActor()		if (DGIntimidateQuest.IsRunning() && \				DGIntimidateQuest.GetCurrentStageID() < 100 || \				target.isinlocation(WhiterunJorrvaskrLocation))				return		endif				if (IsCooling || target.IsDead())				return		endif				potion potionsource = source as potion		if (potionSource && potionSource.IsHostile())			return		endif				MagicEffect magicSource = source as MagicEffect		if (magicSource && magicSource.hasKeyword(MagicAlchHarmful))			return		endif						spell spellsource = source as spell		if (spellsource && modDiseases.hasForm(spellsource))			return		endif				if (spellsource && spellSource.IsHostile())			if (EffectChance > Utility.RandomFloat())				RegisterForSingleUpdateGameTime(Cooldown)				IsCooling = true				RacePower.Cast(target)			endif		endif	   		endevent

should work!

Now to get at this NPC thing, which I understand in theory, but have no idea how to do this =S I havea worrying fealing that this issue is occuring for all poweres except for dark elf, imperial, woodelf and nord (and the woodelf, imperial and nord NPC's have alternative spells- a decision I made becuase they didnt really ahve the same effect when an NPC cast it))

On the magic effects window, I generaly understand most of teh contents there, but the "associated item" part leaves me clueless, I cannot find any good documentation for it, and when i select "eidt form" nothing happens.
User avatar
pinar
 
Posts: 3453
Joined: Thu Apr 19, 2007 1:35 pm

Post » Wed Jun 20, 2012 4:09 am

Hmm what does the target.IsInLocation(WhiterunJorrvaskrLocation) accomplish? - I'm asking because I don't know. Would be good to know how to properly avoid brawl fights in scripts.

And to clarify on what prevents the powers taking effect on some races.
I'm gonna use the Argonian case to explain. It basically comes down to how the effects are calculated. I don't know the exact formula, but clearly CombatHealthRegenMult is depended on HealRate. If HealRate is 0 the power doesn't actually do anything since multiplying by 0 fields 0. And HealRate does not take affect during combat, so using .
To fix this you need to apply two separate magic effects, one for changing each multiplier.
Set HealRate to 1 and CombatHealthRegenMult to 10 like intended.

The resulting spell (modArgonianHistskinSpell) will look something like this:
  • PerkArgonianFortifyHealRateNonCombat - changing HealRate, mag 1, dur 60.
  • RaceArgonianFortifyHealthRate - changing CombatHealthRegenMult, mag 10, dur 60.

And lastly about my last post, don't forget that I didn't test the scripts! You will need to figure out if I am right nor not yourself. You can do this by placing a http://www.creationkit.com/Notification_-_Debug call inside the respective if-clauses and see which one triggers - if any.

Edit: About Actor Values: http://www.creationkit.com/Actor_Value http://uesp.net/wiki/Tes5Mod:Actor_Value_Indices these are what you select from the Assoc. Item # menu. And that menu is called that, because in it can be different things, depending on which Effect Archtype is selected.
User avatar
John Moore
 
Posts: 3294
Joined: Sun Jun 10, 2007 8:18 am

Post » Wed Jun 20, 2012 3:12 am

I used the jorrvaskr check because there is an event inside there on the first time you enter where the companions haeva few fist fights. It is associated witha quest, but that quest is always running until you witness the event.

I contemplated doing a quest check and perhaps a queststage check too, but figured it would be less risky to jsut turn off the power when inside this locatino (irrc there is no expected fighting in this hall anyway?)

I did test the scripts (after I made the slight change after my fail) and it works fine, although I think the issue we are seeing with the argonian also affects the breton. (so the issue is with argonian, redguard, high elf, orc, breton)

I am at work right now, so will ahev to take a peek at the magic effect tweaking when i get home!
User avatar
Darlene Delk
 
Posts: 3413
Joined: Mon Aug 27, 2007 3:48 am

Post » Tue Jun 19, 2012 9:00 pm

I am still a little confused :tongue: Xetril.

So the current "vanilla" powers require me to set the actor value to 1, so that they have something to work from (this I get). But its how I do that? Should I be using a value modifier magic effect as opposed to a peak value modifier? When I saw this at work the other day I thought it was clear, until I realised that CombatHealthMult is'nt a actor value, but an effect based on the actor value thats already being change :S

ahhhhhhh lol this is such a ballache!

Do you think it would be wise to perform a script check to ensure the actor is not the player, and if this rings true, use modActorValue(value, amount) in the script? then firing the vanilla effect? and then on effect end modify the value back to 0?

then its all neat in the script?

I ask this because using a value modifier effect set to 1 had no effect :( I am more at home in notepad than I am in the edditor GUI :(
User avatar
Kelly Osbourne Kelly
 
Posts: 3426
Joined: Sun Nov 05, 2006 6:56 pm

Post » Wed Jun 20, 2012 4:14 am

Look at the relevant vanilla magic effects for reference or the spoiler below...
Spoiler
Peak Value Modifiers

And sure CombatHealthRegenMult is an actor-value, why do you think it isn't?
Is it because it isn't listed in the CK wiki? That just means that this AV (like others) is undocumented, but it's there.
User avatar
lilmissparty
 
Posts: 3469
Joined: Sun Jul 23, 2006 7:51 pm

Post » Wed Jun 20, 2012 6:02 am

heh so it worked :tongue: Argonian power fixed for all :smile:

I tried changing the redguard as suggested, where the
StaminaRate was set to 1 and StaminaRateMult was set to 50 but as the player, the stamina regen rate was not as good. little annoying, if they all acted the same then life would ahve been easy! :(

I think I am jsut going to change both sta changes to 50 it may eb quicker for the player (although I cant notice) but it seems to work for the npc too.


Heres the annoying bugger though. Xetril, i just found an issue with the script you provided, I think the registerforsingleupdategametime() call breaks if the player were to wait or fast travel. I used debugmessagebox to confirm the state of "iscooling" and it returns true after waiting for a period of time longer than the set cooldown period. This then puts the player in the unfortunate state of never being able to change this back to false :(
User avatar
Alisia Lisha
 
Posts: 3480
Joined: Tue Dec 05, 2006 8:52 pm

Post » Tue Jun 19, 2012 9:13 pm

Interesting; now reading http://www.creationkit.com/RegisterForSingleUpdateGameTime_-_Form ... of course it must fail! You mustn't use http://www.creationkit.com/OnUpdate_-_Form but rather http://www.creationkit.com/OnUpdateGameTime_-_Form.
Sigh, I never noticed since I always tested using http://www.creationkit.com/RegisterForSingleUpdate_-_Form with a very low value... :ermm: sorry.

Okay now that, that is settled. Here, an updated version of the argonian script with the fix. I also incooperated what I myself suggested over at the http://forums.nexusmods.com/index.php?/topic/606627-auto-cast-racial-powers-plugin/page__view__findpost__p__4891420 :happy:.
And as usual I didn't test a thing.
Spoiler
scriptname modArgonianProcEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Properties /////////////////////////////////////////////////////////////////////////////;; Specific to this race powerSpell property modArgonianHistskinSpell auto; Common to all race powersPerk property RestedPerk autoPerk property RestedWellPerk autoPerk property RestedMarriagePerk autoQuest property DGIntimidateQuest autoQuest property C00JorrvaskrFight autoLocation property WhiterunJorrvaskrLocation autofloat property PowerReadyAt auto hiddenfloat property BeganSleepingAt auto hidden;///////////////////////////////////////////////////////////////////////////// / Constants /////////////////////////////////////////////////////////////////////////////;; Specific to this race powerfloat property HPThreshold		    = 0.9 auto;/readonly/; hidden; Common to all race powersfloat property Cooldown			   = 5.0 auto;/readonly/; hiddenfloat property ActivationChance	   = 0.7 auto;/readonly/; hiddenfloat property SleepTimeUntilBonus    = 0.75 autoreadonly hiddenfloat property SleepCooldownBonusMult = 1.5 autoreadonly hiddenstring property State_Ready    = "Ready" autoreadonly hiddenstring property State_Cooldown = "Cooldown" autoreadonly hidden;///////////////////////////////////////////////////////////////////////////// / Events /////////////////////////////////////////////////////////////////////////////;event OnUpdateGameTime()    GoToState(State_Ready)endevent;///////////////////////////////////////////////////////////////////////////// / States /////////////////////////////////////////////////////////////////////////////;auto state Ready    event OnHit(ObjectReference u1, Form u2, Projectile u3, bool u4, bool u5, bool u6, bool u7)        GoToState(State_Cooldown)        Actor target  = GetTargetActor()        ; checks required, regardless of which race power this is        if (target.IsDead() || ActivationChance <= Utility.RandomFloat() || \            (DGIntimidateQuest.IsRunning() && DGIntimidateQuest.GetCurrentStageID() < 100) || \            (target.GetCurrentLocation() == WhiterunJorrvaskrLocation && \             C00JorrvaskrFight.IsRunning() && C00JorrvaskrFight.GetCurrentStageID() < 100))            GoToState(State_Ready)            return        endif        ; check power specific requirements        if (target.GetActorValuePercentage("Health") >= HPThreshold)            GoToState(State_Ready)            return        endif        ; passed all guards, therefore power-up        PowerReadyAt = Cooldown        if (target == Game.GetPlayer())            RegisterForSleep()            if (target.HasPerk(RestedMarriagePerk))                PowerReadyAt *= 0.85            elseif (target.HasPerk(RestedWellPerk))                PowerReadyAt *= 0.9            elseif (target.HasPerk(RestedPerk))                PowerReadyAt *= 0.95            endif        endif        RegisterForSingleUpdateGameTime(PowerReadyAt - Utility.GetCurrentGameTime())        modArgonianHistskinSpell.Cast(target)    endeventendstatestate Cooldown    event OnSleepStart(float startTime, float u1)        UnregisterForUpdateGameTime()        BeganSleepingAt = startTime    endevent    event OnSleepStop(bool u1)        float now = Utility.GetCurrentGameTime()        float effectiveTimeSlept = \            (now - BeganSleepingAt) * SleepCooldownBonusMult - SleepTimeUntilBonus        if (effectiveTimeSlept + now >= PowerReadyAt)            GoToState(State_Ready)            UnregisterForSleep()        elseif (effectiveTimeSlept > 0.0)            PowerReadyAt -= effectiveTimeSlept            RegisterForSingleUpdateGameTime(PowerReadyAt - now)        endif    endeventendstate
You can easily remove the Sleep/Rested stuff you if you don't like it.
Also I adjusted the Jorrvaskr check, I think I got the right quest... I checked with the CK and the quest gets disabled at stage 100.

And the reason I respond so late even though I'm following the thread is, because edits don't raise an update -- I didn't get notified.
User avatar
Kim Bradley
 
Posts: 3427
Joined: Sat Aug 18, 2007 6:00 am

Next

Return to V - Skyrim