Mod First Day Release Problem: Urgent help needed!

Post » Wed Jun 20, 2012 6:03 am

heh yeah, I always have the dilemma about spamming my topic with lots of my own posts to keep it high in the forum, or to by mature and edit my last psot, and risk it falling into the depths of obilvion :P

As for the rest check you have suggested, does this include auto travel? (i.e. does theg ame treat this as a rest/wait time?) If it does, I probably will consider getting this implemented, but if not, I may leave my current implementation with registerforsingleupdate() (using real life time). Its crude, but its impact on the game is not too severe.

As for your comment on the Nexus, your checks suggested above worked perfectly, I also used the form to store not just diseases, but also a couple of the poison attacks (such as spiders and charrus) that wouldn't fall under alchemy poisons.

and with regards to orc and breton powers, I may leave them as is, sometimes the illusion that a power is ebing fired is enough :P Games design is all about smoke and mirrors!
User avatar
Marcia Renton
 
Posts: 3563
Joined: Fri Jan 26, 2007 5:15 am

Post » Wed Jun 20, 2012 5:52 am

Well, it isn't regarded wrong to bump/double-post when 24 hours have passed.

Like I said, I did no tests whatsoever, that said. Yes, since fast travel advances in-game time it will affect the cooldown period.

Bretons, I though the disease/poison issue was resolved?
I'm gonna investigate the orc power and what's the issue with redgards?
User avatar
Josh Sabatini
 
Posts: 3445
Joined: Wed Nov 14, 2007 9:47 pm

Post » Wed Jun 20, 2012 4:38 am

Breton: the triggering issues are gone, but crasher reported the power not taking effect when triggering, but I think it is.
nothing is wrong with redguards I said "regards" as in "regarding these two races" hehe

I will be looking into implementing these code changes, Going to make sure I fully understand it all first, states are still new to me, and I abhorr the idea of using code I dont understand :P
User avatar
Elizabeth Lysons
 
Posts: 3474
Joined: Fri Feb 02, 2007 7:16 am

Post » Tue Jun 19, 2012 9:58 pm

Could you help me out with posting the orc script?
What I got right now suggests that the perk never gets applied.


Okay, I'm done investigating. It's just like I said, the perk never gets applied, and using a script doing Add/RemovePerk doesn't work either. So, I guess perks must be a player only feature -- nothing can be done about that.

But, there is a workaround. Using the actor values DamageResist and AttackDamageMult.
You just have to modify the power/mgef to do two http://www.creationkit.com/ModActorValue_-_Actor, one at the http://www.creationkit.com/OnEffectStart_-_ActiveMagicEffect with a positive number, the other one with the same number negated when the http://www.creationkit.com/OnEffectFinish_-_ActiveMagicEffect.
Or use two peak value modifiers, either way, it's going to work.

In the state-version, these events can just be in the default state, no reason to make that more complicated.
And some disclaimer, I didn't test anything other then DamageResist.
User avatar
Anna Krzyzanowska
 
Posts: 3330
Joined: Thu Aug 03, 2006 3:08 am

Post » Wed Jun 20, 2012 9:16 am

post went nuts :S
User avatar
Red Sauce
 
Posts: 3431
Joined: Fri Aug 04, 2006 1:35 pm

Post » Wed Jun 20, 2012 9:07 am

Woah, previous psot went nuts! Take 2!
Ok, this is food for though, the orc fix *should* be simple enough, every day is a school day in modding!
With regards to the states, I think I understand most of it.
Should this line
 RegisterForSingleUpdateGameTime(PowerReadyAt - Utility.GetCurrentGameTime()) 

Not read

RegisterForSingleUpdateGameTime(PowerReadyAt + Utility.GetCurrentGameTime()) 

So that the update occurs +5 hours to the current game time?

Also I am guessing that a lot of the rest bonus/perk stuff is a flourish of yours, to give these perks a little more impact than just levelling up abilities? If this is the case, are the following parts part of this “flourish” or necessary to the workings of the script?
if (target.HasPerk(RestedMarriagePerk))				PowerReadyAt *= 0.85			elseif (target.HasPerk(RestedWellPerk))				PowerReadyAt *= 0.9			elseif (target.HasPerk(RestedPerk))				PowerReadyAt *= 0.95			endif

And
* SleepCooldownBonusMult - SleepTimeUntilBonus
User avatar
Becky Palmer
 
Posts: 3387
Joined: Wed Oct 04, 2006 4:43 am

Post » Tue Jun 19, 2012 10:00 pm

Looks you got an unclosed code tag in there. Timing...

Oh yes, that minus should be a plus, just another bug. At average everyone introduces about 5 bugs every 1000 lines of code. Guess it was time for one more. :happy:

Sure all the Sleep/Rested stuff is just to shorten the cooldowns if the player is rested or sleeping. None of it is necessary.
User avatar
Eve(G)
 
Posts: 3546
Joined: Tue Oct 23, 2007 11:45 am

Post » Wed Jun 20, 2012 12:20 am

Great, I understand it all :smile: time to implement and test! Btw, you are now the "Scripting Wizard" :biggrin:

oops: powerreadyat -= effective time slept (is this right?)
yes it is :D assignment operators ftw
User avatar
Amie Mccubbing
 
Posts: 3497
Joined: Thu Aug 31, 2006 11:33 pm

Post » Wed Jun 20, 2012 6:44 am

bah, the script doesnt seem to work. :( even when not sleeping and stuff.. I wonder if its to do with the format of "game time"? if we are going to add to it inputting a figure of 1 could be teh equivelant of a day, therefore an hour could be more akin to .000100 ? it seems to be a figure with 6 decimal places, but I cant think how that can be split into s/m/h ?
User avatar
Antony Holdsworth
 
Posts: 3387
Joined: Tue May 29, 2007 4:50 am

Post » Wed Jun 20, 2012 6:21 am

The *GameTime functions typically take an argument which is in (game) hours. But yeah, the global GameDaysPassed (which is what Uilitiy.GetCurrentGameTime returns) is as the name says, in days.

If you wanted to make the update trigger in one day, you would need to pass 1*24.

Edit: ROFL I love moments like these :biggrin: remember that earlier bug... it's not a bug. RegisterForSingleUpdateGameTime takes an argument relative to now, so of course the now part has to be subtracted.
Hah, congrats to me getting that right late at night.


Heh, I did leave a bug, a few lines earlier, it should be
PowerReadyAt += Utility.GetCurrentGameTime()
after the "reduction".

Complete script:
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)		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

Okay, that was more complicated than it needed to be, but I am done now.
User avatar
priscillaaa
 
Posts: 3309
Joined: Sat Dec 30, 2006 8:22 pm

Post » Tue Jun 19, 2012 9:26 pm

heh yeah, ok so undoing my "fix" sorted out normal wait time, but the cooldown and sleeping behaviour seems to be odd. i have teh cooldown field set to 5 in the script, but after 1 hour resting the power triggers :(

I will take a look around, also, I cant be too sure, but is the script in its current form robust enough to handle a situation where the player takes multiplr 1 hour rest breaks?
User avatar
Lance Vannortwick
 
Posts: 3479
Joined: Thu Sep 27, 2007 5:30 pm

Post » Tue Jun 19, 2012 7:56 pm

Robustness is not quite the issue. They way I set it up, is that the player needs to sleep at least a specific time before the reduction kicks. This delay is controlled by SleepTimeUntilBonus; I set to to 0.75 meaning it the cooling-down would accelerate after an initial sleep time of 45 minutes.
But if you are worried about robustness, just move the OnSleep* events to the default state, they will only ever be triggered if requested anyway.

Just thought of an issue which could arise if you use that script, as is. It can cause problems for users currently using your mod, because I renamed some properties...
These users would need to disable the mod, and the scripts, create a clean save and after than update the mod, and re-activate it.
But that's pretty universal to all mods using scripts.
User avatar
Robert Bindley
 
Posts: 3474
Joined: Fri Aug 03, 2007 5:31 pm

Post » Wed Jun 20, 2012 3:54 am

Right I see, Should be good then. I have adapted the script to the high elf power for ease of testing
scriptname modHighElfProcEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Properties /////////////////////////////////////////////////////////////////////////////;; Specific to this race powerSpell property modHighElfHighbornSpell auto; Common to all race powersQuest property DGIntimidateQuest autoQuest property C00JorrvaskrFight autoLocation property WhiterunJorrvaskrLocation autofloat property PowerReadyAt auto hiddenfloat property BeganSleepingAt auto hidden;///////////////////////////////////////////////////////////////////////////// / Constants /////////////////////////////////////////////////////////////////////////////;; Specific to this race powerfloat property ManaThreshold				  = 0.4 auto;/readonly/; hidden; Common to all race powersfloat property Cooldown				    = 5.0 auto;/readonly/; hiddenfloat property ActivationChance    = 0.6 auto;/readonly/; 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 OnSpellcast(Form akSpell)        GoToState(State_Cooldown)        	    Actor target  = GetCasterActor()	    ; 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("magicka") >= ManaThreshold)		    GoToState(State_Ready)		    return	    endif	    ; passed all guards, therefore power-up	    PowerReadyAt = Cooldown	    if (target == Game.GetPlayer())		    RegisterForSleep()	    endif	    RegisterForSingleUpdateGameTime(PowerReadyAt - Utility.GetCurrentGameTime())	    modHighElfHighbornSpell.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)	    if (effectiveTimeSlept + now >= PowerReadyAt)		    GoToState(State_Ready)		    UnregisterForSleep()	    elseif (effectiveTimeSlept > 0.0)		    PowerReadyAt -= effectiveTimeSlept		    RegisterForSingleUpdateGameTime(PowerReadyAt - now)	    endif    endeventendstate

Should be all good, however even when resting for 1 hour the racial power will still proc despite the fact it hasnt met the cooldown time. Maybe I dont understand the code as much as I thought :(
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Wed Jun 20, 2012 6:37 am

Fixed it finally...
Spoiler
scriptname modArgonianProcEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Imports /////////////////////////////////////////////////////////////////////////////;import Utility;///////////////////////////////////////////////////////////////////////////// / 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 hidden{unit: game days}float property BeganSleepingAt auto hidden{unit: game days};///////////////////////////////////////////////////////////////////////////// / Constants /////////////////////////////////////////////////////////////////////////////;; Specific to this race powerfloat property HPThreshold            = 0.9 auto;/readonly/; hidden; Common to all race powersfloat property Cooldown               = 5.0 auto;/readonly/; hidden{unit: game hours}float property ActivationChance       = 0.7 auto;/readonly/; hiddenfloat property SleepTimeUntilBonus    = 0.75 autoreadonly hidden{unit: game hours}float property SleepCooldownBonusMult = 1.5 autoreadonly hidden{unit: game hours}string 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 <= 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		float effectiveCooldown = Cooldown ; unit: game hours		if (target == Game.GetPlayer())			RegisterForSleep()			if (target.HasPerk(RestedMarriagePerk))				effectiveCooldown *= 0.85			elseif (target.HasPerk(RestedWellPerk))				effectiveCooldown *= 0.9			elseif (target.HasPerk(RestedPerk))				effectiveCooldown *= 0.95			endif		endif		PowerReadyAt = GetCurrentGameTime() + effectiveCooldown / 24.0		RegisterForSingleUpdateGameTime(effectiveCooldown)		modArgonianHistskinSpell.Cast(target)	endeventendstatestate Cooldown	event OnSleepStart(float u1, float u2)		UnregisterForUpdateGameTime()		BeganSleepingAt = GetCurrentGameTime()	endevent	event OnSleepStop(bool u1)		float gtDays  = GetCurrentGameTime()		float gtHours = gtDays * 24.0		float actualHoursSlept = (gtDays - BeganSleepingAt) * 24.0		float effectiveHoursSlept = \			(actualHoursSlept - SleepTimeUntilBonus) * SleepCooldownBonusMult		float effectiveDaysSlept = effectiveHoursSlept / 24.0		if ((effectiveDaysSlept + gtDays) >= PowerReadyAt)			GoToState(State_Ready)			UnregisterForSleep()		elseif (effectiveHoursSlept > 0.0)			PowerReadyAt -= effectiveDaysSlept			float effectiveCooldown = PowerReadyAt - gtDays / 24.0			RegisterForSingleUpdateGameTime(effectiveCooldown)		endif	endeventendstate
User avatar
Chris Johnston
 
Posts: 3392
Joined: Fri Jul 07, 2006 12:40 pm

Post » Wed Jun 20, 2012 9:23 am

cool :) The other method worked too after the little prompt, but this has all the rest bonus stuff too! :D

I was taking a look at sorting out the orc thing, and was wondering if I could just modify the actor values (damageresist and attackDmgMult) using a peakmodifier magic effect, much like we did with the elf/redguard effects (or are these values dependent on others?)
If it is, I have no idea what values I should be using though, not much info about them :(

Once this is done I pretty much just need some toggle nighteye chucked in to keep kitty fans happy and then I think the mod is all ready for another version! :D your name will probably be whacked up as a co-author tbh, the code is more or less yours now after all lol.
User avatar
jenny goodwin
 
Posts: 3461
Joined: Wed Sep 13, 2006 4:57 am

Post » Tue Jun 19, 2012 9:14 pm

Yes, peak value modifiers should work just fine.

Kitty fans, hmm. Well, the vanilla nighteye magic effect is already toggle-able, just set duration to 0.
User avatar
Kat Ives
 
Posts: 3408
Joined: Tue Aug 28, 2007 2:11 pm

Post » Tue Jun 19, 2012 8:28 pm

oh! easy as that? lol and in your expertise have any recommendatinos for values I should whack in for the orc actor values?
User avatar
Monika Krzyzak
 
Posts: 3471
Joined: Fri Oct 13, 2006 11:29 pm

Post » Wed Jun 20, 2012 12:19 am

I think vanilla, gives a 50% bonus to each, right?
Lets see, usep.net lists DamageResist as of type Resist, so a resistance value which is I believe capped by some game setting. But it's basically a percentage, so it should be 50.0.
AttackDamageMult is listed as simple multiplier so a value of 1.5 should do the trick.
User avatar
Andy durkan
 
Posts: 3459
Joined: Fri Aug 03, 2007 3:05 pm

Post » Tue Jun 19, 2012 6:35 pm

cool will test this tomorrow, sleep for me! ive done a lot of work with a paddy's day hangover! :D cheers for the help m8.
User avatar
(G-yen)
 
Posts: 3385
Joined: Thu Oct 11, 2007 11:10 pm

Post » Wed Jun 20, 2012 1:39 am

nighteye stuff works gravy! I cant tell any difference with the orcs though. Do you know if damageResist and attackdamagemult rely on other attributes? Im gonig to have a nose around some websites to see if I can find some answers, I have no idea where you learnt them from!
User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Tue Jun 19, 2012 11:11 pm

From http://uesp.net/wiki/, that's http://uesp.net/wiki/User:Daveh website he is also the author of Skyedit.

DamageResist should be easy to verify, simple use the console ref.SetAV DamageResist 100.
Then verify if that AV is actually 100 with GetAV DamageResist.
Now, if you hit whoever ref might be, and he takes damage it doesn't quite work.

AttackDamageMult, same story. Try using a ridiculous huge value on some enemy NPC, if he hits you and you one-hit die, that's success.

Update: I looked myself just now an can report that AttackDamageMult works as expected -- weird when some level 1 NPC almost kills me, a truly terrifying vampire.
But, DamageResist does not work as I thought, nonetheless now I know what it actually is -- the actors total armor value.
Need to find some other AV looking ...

Actually, using a script you can do something like a DamageResistMult. Just get the targets current value, and multiply that by 0.5 and add (and later remove it) it using ModActorValue.
User avatar
Jonathan Egan
 
Posts: 3432
Joined: Fri Jun 22, 2007 3:27 pm

Post » Tue Jun 19, 2012 7:28 pm

hmm it is rather annoying that it works in a script, but not in a peakvaluemodifier magic effect. just makes life more tough! How would I define the actor value property? what type is it?

string property Damageresist auto ?
I've looked on the wiki but 20 mins of searching doesnt seem to come up with anythning good! and also, what would be the easiest way to remove this modifier considering it is applied on an onHit event?

heres the orcy code!
Spoiler

scriptname modOrcProcEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Properties /////////////////////////////////////////////////////////////////////////////;; Specific to this race powerSpell property modOrcBeserkSpell autospell property npcPower auto; Common to all race powersQuest 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.6 auto;/readonly/; hidden; Common to all race powersfloat property Cooldown				    = 3.0 auto;/readonly/; hiddenfloat property ActivationChance    = 0.25 auto;/readonly/; 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  = GetCasterActor()	    ; 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()            RegisterForSingleUpdateGameTime(PowerReadyAt)            PowerReadyAt += Utility.GetCurrentGameTime()            modOrcBeserkSpell.Cast(target)	    else            RegisterForSingleUpdateGameTime(PowerReadyAt)            modOrcBeserkSpell.cast(target)           ; npcPower.cast(target)  this is the defunct spell which wont work.    endif    endeventendstatestate Cooldown    event OnSleepStart(float startTime, float u1)	    UnregisterForUpdateGameTime()	    BeganSleepingAt = startTime    endevent    event OnSleepStop(bool u1)	    float now = Utility.GetCurrentGameTime()	    float effectiveTimeSlept = (now - BeganSleepingAt)	    if (effectiveTimeSlept + now >= PowerReadyAt)		    GoToState(State_Ready)		    UnregisterForSleep()	    elseif (effectiveTimeSlept > 0.0)		    PowerReadyAt -= effectiveTimeSlept		    RegisterForSingleUpdateGameTime(PowerReadyAt - now)	    endif    endeventendstate
User avatar
victoria gillis
 
Posts: 3329
Joined: Wed Jan 10, 2007 7:50 pm

Post » Tue Jun 19, 2012 7:21 pm

A simple string, the simplest way would be to hardcode everything.

What you need, is script which in OnEffectStart calculates the proper amount to adjust DamageResist by based on the actors current value, and then apply that amount using ModActorValue.
Lastly, in OnEffectFinish you need to remove the calculated amount by again using ModActorValue, this time with a negative number.
It's basically a three line script.

Well since I already wrote the script before I posted this. Note this is a generic version, you can just as well hardcode the mult, AV and remove the related properties.
Spoiler
scriptname XsActorValueMultEffect extends ActiveMagicEffect;///////////////////////////////////////////////////////////////////////////// / Properties /////////////////////////////////////////////////////////////////////////////;string property ActorValue auto{REQUIRED; The _exact_ name of the actor value to modify.}float property Mult auto{REQUIRED; The amount to modify the actor value by as a multiplier.}float property Amount = 0.0 auto hidden;///////////////////////////////////////////////////////////////////////////// / Events /////////////////////////////////////////////////////////////////////////////;event OnEffectStart(Actor target, Actor caster)	Amount = target.GetActorValue(ActorValue) * Mult	target.ModActorValue(ActorValue, Amount)endeventevent OnEffectFinish(Actor target, Actor caster)	target.ModActorValue(ActorValue, Amount * -1.0)endevent
User avatar
Sun of Sammy
 
Posts: 3442
Joined: Mon Oct 22, 2007 3:38 pm

Post » Tue Jun 19, 2012 9:07 pm

heh here is me trying to whack all this code on the proc effect, I just need to chuck this on the new spell effect :tongue: I've spent too long looking at these darn scripts! lol I cant wait to get this orc thing done and release V2!
User avatar
Margarita Diaz
 
Posts: 3511
Joined: Sun Aug 12, 2007 2:01 pm

Post » Wed Jun 20, 2012 1:13 am

This, and it would still produce the sleep/gametime issue.
User avatar
Soph
 
Posts: 3499
Joined: Fri Oct 13, 2006 8:24 am

PreviousNext

Return to V - Skyrim