Need advice on Player property scaling script.

Post » Sat Nov 17, 2012 4:18 pm

Hello all,

I want to create a racial ability that adds natural armor that scales with player level. The purpose is that I want the ability to be fairly low-power, yet remain relevant at higher levels, but without being of overpowering benefit.

I am by no means an expert in scripting, but I have successfully creating scripts of mild complexity for Fallout, and I have also worked with the Oblivion construction set. But this object oriented scripting is killing me, and I have no idea how to even begin to accomplish what SHOULD be a simple goal. I've been diving into scripting info off and on for months now with now solution.

In previous games I would have created an argument that went according to this formula, (and no, this is not a script):

“PlayerNakedArmorRating = 5 + (PlayerLvl * 1.25)” and used an integer argument so to truncate off any decimal places.

I created “The Naked Gun” mod for Fallout that gives a very similar perk already.

But in Oblivion's creation kit, I cannot even get an example of a script actually pointing back at the player. Further more, I have found little in the way of script type info outside of “extend” type scripts, to extend other scripts. I don't have a clue what other script I might extend, if that's even the right route to use.

I'm about to pull out my hair here. (And I'm rather fond of my hair.)

Can anyone help me, from a conceptual framework standpoint, on what I should do?

Thanks,

- Emily
User avatar
Rachell Katherine
 
Posts: 3380
Joined: Wed Oct 11, 2006 5:21 pm

Post » Sat Nov 17, 2012 9:45 pm

Bump
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Sun Nov 18, 2012 1:27 am

I can think of a couple of ways that you could implement this,

Firstly, you could create a perk, which modifies the incoming damage by a percentage. Have a look at crDragonResistNPCs or MQ101ReduceDamage perks

Another option would be to create a magic effect/spell which modifies the damage resist. You could then create a perk which modifies the magnitude of your new spell. However you would not be able to use player level, but could use actor values or if required multiple actor values.

If you wanted to use a script, you could use the following attached to a magic effect. Disclaimer i haven't tested this script in game, however it does compile.

Spoiler
Scriptname NaturalArmorScript extends ActiveMagicEffect{Increases the damage resist value }Actor Property PlayerRef Auto ;This property references the playerEvent OnEffectStart (Actor akCaster, Actor akTarget)Int PlayerLevel = PlayerRef.GetLevel()  ;Obtains the player level	 PlayerRef.ModActorValue("DamageResist" , (5+(PlayerLevel*1.25))) ;Modifies the players damage resist by (5+(playerlevel*1.25))EndEvent
User avatar
Wayne W
 
Posts: 3482
Joined: Sun Jun 17, 2007 5:49 am

Post » Sat Nov 17, 2012 7:45 pm

Thank you very much. I am trying it out now, (I am not even sure if it compiled, bit it didn't say "failed",,,but didn't say "complete" or anything similar either.)
I don't think I'm "good to go" yet, but I wanted to thank you for your response before too much time elapsed.

- E`m
User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Sat Nov 17, 2012 8:23 pm

Apologies, but some thing which i should have added but completely overlooked, if you go down the purely scripted route, you would need to have a finish event to remove the modified damage resist. Something along the lines of this
Event OnEffectFinish (Actor akCaster, Actor akTarget)	PlayerRef.ModActorValue("DamageResist", -(5+(PlayerLevel*1.25)))EndEvent

I haven't tested this or compiled it, but you should be able to add this on to end of the previous script.

An issue that i did think of is, if the player level changes before the effect finishes, eg you apply the effect at level 10 your damage resist becomes 17.5, if it ends at level 11 you lose 18.75 damage resist
User avatar
Glu Glu
 
Posts: 3352
Joined: Sun Apr 01, 2007 5:39 am


Return to V - Skyrim