How do I work with ModAV?

Post » Wed Oct 20, 2010 4:52 am

I've been trying to add an attribute modifier to one of my actor values, Fatigue. I've tried several variations in order to get it to work and while this one will actually save, it's having no effect in the game:

scn a2zNoAPScriptBegin GameModeshort BaseFatiguefloat FatigueModifierfloat FatigueBonusfloat AttributeBonusset AttributeBonus to (player.getav Endurance * .01) + (player.getav Strength * .01)set BaseFatigue to player.GetBaseActorValue Fatigueset FatigueModifier to BaseFatigue * AttributeBonusset FatigueBonus to BaseFatigue + FatigueModifierplayer.modAV Fatigue FatigueBonusEnd


So what am I doing wrong here? I should be seeing a modified base value of 220 for Fatigue, but it's still coming out as 200. And it's not because Fatigue can't be modified since I substituted ActionPoints and it still had no effect. I just don't see what's wrong with this picture, logically it should work but it doesn't.

PS: OK, now this is odd. I tried using just the FatigueModifier value and while it's having an effect, it's totally out of whack. I'm getting an ingame AV Fatigue value of 1920 instead of 220, the way it should be. What the hell is going on here?

PS: Man, this is totally screwed. I tried using SetAV instead, using the FatigueBonus value, and ended up with an ingame Fatigue AV of 59,000+. But using FatigueModifier gave me 0.
User avatar
Marina Leigh
 
Posts: 3339
Joined: Wed Jun 21, 2006 7:59 pm

Post » Tue Oct 19, 2010 8:00 pm

So I think I see the problem with that SetAV value. The script is running every 1/10 of a second so every time it cycles through, the FatigueBonus value is being added. Would I be able to use an Effect in order to accomplish what I'm trying to do here, so that it only gets applied whenever the attributes in the AttributeBonus are changed?
User avatar
Crystal Birch
 
Posts: 3416
Joined: Sat Mar 03, 2007 3:34 pm

Post » Tue Oct 19, 2010 6:58 pm

So another problem I see now is that I'm looping the Fatigue Base AV. I'm calling it up and using it as part of an equation, then adjusting it again in the same script. How do I get around that? Would using a Return after "set FatigueModifier to BaseFatigue * AttributeBonus" stop it from looping?

And as usual the Wiki is absolutely useless to me. I get 10,000 entries that have the word "return" in them, but none of them really tell what Return actually does in a script. So I sure hope someone comes along and helps me out here.
User avatar
mishionary
 
Posts: 3414
Joined: Tue Feb 20, 2007 6:19 am

Post » Wed Oct 20, 2010 1:10 am

The Return command simply ends the current script for the current FPS cycle. Nothing more, nothing less.

In your script above you have no conditions on 'adding' to the variable. I have no idea what your current script looks like but the one above will never stop adding to the variable. Once per FPS cycle.

What exactly do you have the script attached to? That will depend on how often and 'when' it runs.

The game engine might also be modifying the fatigue variables so it could interfer.
User avatar
Chenae Butler
 
Posts: 3485
Joined: Sat Feb 17, 2007 3:54 pm

Post » Wed Oct 20, 2010 5:47 am

Thank you, WillieSea to the rescue once again.

The Return command simply ends the current script for the current FPS cycle. Nothing more, nothing less.


So that doesn't help me here then.

In your script above you have no conditions on 'adding' to the variable. I have no idea what your current script looks like but the one above will never stop adding to the variable. Once per FPS cycle.


That's what I've come to realize. That would explain the 59,000+ Base Fatigue points I was seeing at one point. But how do I get around that? I was looking at a DoOnce condition, but I want the Base Fatigue AV to adjust if my character's Strength and/or Endurance changes. And what do you mean about "conditions on adding"? I also tried using an Actor Effect after creating a new Base Effect to modify my Fatigue, but that didn't work either. While GetBaseActorValue is listed as a condition, the Wiki doesn't have it listed as such so I'm guessing it doesn't actually do anything in that context. One thing I didn't try though was using the "Cast Immediate on Self" command. Maybe that would work.

What exactly do you have the script attached to? That will depend on how often and 'when' it runs.


Well the full script is getting a bit large to post here, but it runs every 1/10 of a second. I've been thinking that I'm going to need to create a new script just for this, since I don't think it will work in my main one because of the timing. But I'm not sure how I would go about it. I'm kind of out of my league at this point. The bottom line is that I'm trying to add an attribute modifier to my Base Fatigue points, just like the Attributes currently modify my skills. Unlike Oblivion, there's nothing that adjusts the Fatigue pool, every character gets a flat 200 points regardless of their stats. I want to change that so that Strength and Endurance have an effect on the total points available. But I can't figure out how. I've been beating my head against the wall all day on this. Any help you can provide at this point would be greatly appreciated.

The game engine might also be modifying the fatigue variables so it could interfer.


Well I hope that's not the case.

PS: No Cast Immediate on Self didn't work either. I created an Actor Effect, setting it as an Ability, that was supposed to raise my Fatigue by 20 points, with a condition of GetBaseAV Strength == 8, which is what my character has at the moment. While the script saved as valid, it did nothing to my base Fatigue points.
User avatar
Rudi Carter
 
Posts: 3365
Joined: Fri Sep 01, 2006 11:09 pm

Post » Wed Oct 20, 2010 8:16 am

OK, never mind. I'm going to take a different approach with my Attribute Modifier.
User avatar
Taylor Thompson
 
Posts: 3350
Joined: Fri Nov 16, 2007 5:19 am


Return to Fallout 3