How to work this?

Post » Wed Dec 30, 2009 12:33 pm

I've been fiddling with Kuertee's HUD mod and I've come across a number of stumbling blocks trying to get it to do what I want. Mainly I just don't have enough of them, but that's another story. For now, I figured I could combine a number of things into one bar if I were to set up a couple of variables in the script, and tell the ini to use those. What I want is a TotalCurrentAttributes variable which would simply come up with a total current value for all of my attributes. Then I would have a TotalBaseAttributes variable which would give a total of how much that value should be. I'd enter those in the ini file and set it so that the bar is hidden if at 100%. So anytime any of my attributes were damaged in some way, either by disease or by a spell, I'd have a message appear onscreen informing me. But I haven't a clue how to create those variables. I just tried to use the Set To command, then went Player.GetAV Strength + PlayerGetAV Intelligence and so on, but that didn't work. So basically it would work like this:

 TotalCurrentAttributes = Player.GetAV Strength + Player.GetAV Intelligence + Player.GetAV Willpower + Player.GetAV Agility + Player.GetAV Speed + Player.GetAV Endurance + Player.GetAV Personality + Player.GetAV Luck 


but I don'tknow how to set that up in the script.
User avatar
jessica sonny
 
Posts: 3531
Joined: Thu Nov 02, 2006 6:27 pm

Post » Thu Dec 31, 2009 12:28 am

Anybody? I'm getting a little tired of beating my head against the wall here. It's a pretty simple formula, it shouldn't take too long to point me in the right direction.
User avatar
Lifee Mccaslin
 
Posts: 3369
Joined: Fri Jun 01, 2007 1:03 am

Post » Wed Dec 30, 2009 10:50 am

I just tried to use the Set To command, then went Player.GetAV Strength + PlayerGetAV Intelligence and so on, but that didn't work.
How didn't it work?

So basically it would work like this:

 TotalCurrentAttributes = Player.GetAV Strength + Player.GetAV Intelligence + Player.GetAV Willpower + Player.GetAV Agility + Player.GetAV Speed + Player.GetAV Endurance + Player.GetAV Personality + Player.GetAV Luck 

That is not legal Oblivion syntax...

But something like:
Scn AttributeScriptShort TotalCurrentAttributes Begin GameMode  set TotalCurrentAttributes to Player.GetAV Strength + Player.GetAV Intelligence + ....End

...should work, and update the variable every 5th second. I'm not sure, but it may be that you need to put each Player.GetAv xxx inside parentheses , e.g. "set TotalCurrentAttributes to (Player.GetAV Strength) + (Player.GetAV Intelligence) + ...."
User avatar
Josh Trembly
 
Posts: 3381
Joined: Fri Nov 02, 2007 9:25 am

Post » Wed Dec 30, 2009 9:07 pm

How didn't it work?

That is not legal Oblivion syntax...

But something like:
Scn AttributeScriptShort TotalCurrentAttributes Begin GameMode  set TotalCurrentAttributes to Player.GetAV Strength + Player.GetAV Intelligence + ....End

...should work, and update the variable every 5th second. I'm not sure, but it may be that you need to put each Player.GetAv xxx inside parentheses , e.g. "set TotalCurrentAttributes to (Player.GetAV Strength) + (Player.GetAV Intelligence) + ...."


As far as I know the latter is true. Everything coming after a function name in Oblivion scripting is still considered another parameter. Without parantheses the compiler will choke on these when saving the script.
Sometimes even parantheses seem to not work for what you want to compute. Then you'll have to use temporary variables for each function's return value and sum these up to the final result.
User avatar
Kellymarie Heppell
 
Posts: 3456
Joined: Mon Jul 24, 2006 4:37 am

Post » Wed Dec 30, 2009 1:08 pm

That is not legal Oblivion syntax...


That's not what I used in the script, I just used that as an example of what I wanted. What I added was this:

float TotalCurrentAttributesBeginGameModeset TotalCurrentAttributes to (Player.GetAV Strength) + (Player.GetAV Intelligence) + (Player.GetAV Willpower) + (Player.GetAV Agility) + (Player.GetAV Speed)  + (Player.GetAV Endurance) + (Player.GetAV Personality) + (Player.GetAV Luck)


But the value didn't register when I put the TotalCurrentAttributes variable in Kuertee's ini file. Keep in mind that I'm trying to add this routine inside of Kuertee's HUD script so I'm not sure if that the Scn Attribute Script would apply here. It sounds to me like you're presuming it will be a seperate script. I'll try adding your syntax though to see if it works.

PS: No, it didn't work. All I got was the value for HUD element above it. The variable I tried to create didn't register at all. I even used the brackets.
User avatar
Naomi Ward
 
Posts: 3450
Joined: Fri Jul 14, 2006 8:37 pm

Post » Wed Dec 30, 2009 7:42 pm

Then you'll have to use temporary variables for each function's return value and sum these up to the final result.


What do you mean by this? Sorry but I'm not too fluent with scriptese.

Another thing I wanted to do with my last remaining bar was to be able to see whether I was diseased or not. I came across the OBSE function GetSpellType and tried it in the ini file but it didn't work. Any idea how I might go about that one?

Or better yet, how can I get another script running in order to add 7 more HUD bars. I ran into a maximum scipt size error when trying to add an 8th bar to Keurtee's script and tried copying everything to a new one, renaming it and all the elements, but it didn't register in the game. That would really be my ideal solution. That way I could have a Player.GetAV and Player.GetBaseAV for each individual attribute onscreen, rather than trying to lump them all together. The only reason why I'm trying to add them all up is so I can get them all represented in a single HUD element. If I could have individual entries I wouldn't have to bother, but I just don't have enough HUD elements in order to do that.
User avatar
Marina Leigh
 
Posts: 3339
Joined: Wed Jun 21, 2006 7:59 pm

Post » Wed Dec 30, 2009 3:19 pm

What do you mean by this? Sorry but I'm not too fluent with scriptese.

Another thing I wanted to do with my last remaining bar was to be able to see whether I was diseased or not. I came across the OBSE function GetSpellType and tried it in the ini file but it didn't work. Any idea how I might go about that one?

Or better yet, how can I get another script running in order to add 7 more HUD bars. I ran into a maximum scipt size error when trying to add an 8th bar to Keurtee's script and tried copying everything to a new one, renaming it and all the elements, but it didn't register in the game. That would really be my ideal solution. That way I could have a Player.GetAV and Player.GetBaseAV for each individual attribute onscreen, rather than trying to lump them all together. The only reason why I'm trying to add them all up is so I can get them all represented in a single HUD element. If I could have individual entries I wouldn't have to bother, but I just don't have enough HUD elements in order to do that.


What I meant by "temporary variables" is, when the compiler would still be choking on the line even with brackets, then you'd for example have to use a seperate variable for every attribute, like:
short TotalCurrentAttributesshort actStrengthshort actIntelligenceshort actWillpower...set actStrength to Player.GetAV Strengthset actIntelligence to Player.GetAV Intelligenceset actWillpower to Player.GetAV Willpowerset TotalCurrentAttributes to (actStrenght + actIntelligence + actWillpower)...

But as your compiler isn't complaining to you when you save your script, you should have a correct syntax already.
Now it's a rather functional issue, in that the script doesn't do what you want, than any syntax errors somewhere.

Note, I don't know for sure about the return types of those GetAV functions, but if the return type and the type of the variable you store into don't match, things "might" go haywire in regards to the actual stored value.
Also there's a difference between "player" and "Player" in Oblivion scripting. But again I can't remember the details well enough anymore. It's all somewhere in the wiki though, I'm quite sure.

I'd have to take a look into Kuertee's example scripts to see how it's working, before I could even try and figure out how best to do what you're trying to.
User avatar
Pawel Platek
 
Posts: 3489
Joined: Sat May 26, 2007 2:08 pm

Post » Wed Dec 30, 2009 4:05 pm

Unfortunately Kuertee seems to have gone missing lately or I could just ask him how to work it in. His last thread reached the limit and he hasn't been around to open a new one. I get the impression that he's been coming around pretty sporadically lately, so I doubt I can expect any help from him.
User avatar
Amelia Pritchard
 
Posts: 3445
Joined: Mon Jul 24, 2006 2:40 am

Post » Wed Dec 30, 2009 1:11 pm

So I tried it this way:

		set ActAVStrength to Player.GetAV Strength		set ActAVIntelligence to Player.GetAV Intelligence		set ActAVWillpower to Player.GetAV Willpower		set ActAVAgility to Player.GetAV Agility		set ActAVSpeed to Player.GetAV Speed		set ActAVEndurance to Player.GetAV Endurance		set ActAVPersonality to Player.GetAV Personality		set ActAVLuck to Player.GetAV Luck		set TotalCurrentAttributes to ActAVStrength + ActAVIntelligence + ActAVWillpower + ActAVAgility + ActAVSpeed + set ActAVEndurance + ActAVPersonality + ActAVLuck


And the script won't even save. I get a syntax error message, "Undefined function:set" I tried with brackets and without. I can't believe it's turning out to be so difficult to get such a simple formula to work.
User avatar
Jynx Anthropic
 
Posts: 3352
Joined: Fri Sep 08, 2006 9:36 pm

Post » Wed Dec 30, 2009 10:46 pm

		set TotalCurrentAttributes to ActAVStrength + ActAVIntelligence + ActAVWillpower + ActAVAgility + ActAVSpeed + set ActAVEndurance + ActAVPersonality + ActAVLuck




Extra 'set' in there.
User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm

Post » Wed Dec 30, 2009 7:16 pm

Extra 'set' in there.


Doh! :facepalm:

I'll see if fixing that makes it work then. Thanks.

PS: Well it saved this time but the value is still not showing up in the game. I can't believe I can't get it to do a simple addition! :brokencomputer:
User avatar
Dominic Vaughan
 
Posts: 3531
Joined: Mon May 14, 2007 1:47 pm

Post » Wed Dec 30, 2009 6:53 pm

So obviously this approach is going nowhere, so could someone tell me why the second script I created in Kuertee's mod didn't do anything? All I did was copy all the data, create a new name and change the numbers of all the existing HUD elements but nothing showed up in the game. I would actually prefer being able to add more HUD elements, the adding up of the attribute appraoch was just a way to try and work around the limitations of the mod.
User avatar
Stryke Force
 
Posts: 3393
Joined: Fri Oct 05, 2007 6:20 am

Post » Wed Dec 30, 2009 12:44 pm

I've never looked at the HUD mod, but I'd imagine it needs some level of XML support and also a quest constantly running with the script in it.

Can you post your script here and tell us how it's implemented and what you changed?
User avatar
Loane
 
Posts: 3411
Joined: Wed Apr 04, 2007 6:35 am

Post » Wed Dec 30, 2009 4:57 pm

I've never looked at the HUD mod, but I'd imagine it needs some level of XML support


No, it uses Pluggy to create the onscreen elements. No XML is necessary.

...and also a quest constantly running with the script in it.


Yes, it does have both of those. By default it updates every 5 secs, but I've changed that to .5.

Can you post your script here and tell us how it's implemented and what you changed?


It's a pretty big script, in fact I reached the max limit when trying to add to it. If you really want to take a look at it, it would probably be more practical just to DL the mod. I didn't really change much so far in the original, I simply copied all the entries for HUD element 6 then renamed all references of that number in those lines to 7. I tried to get an 8th element working but I ran into a max script size error. Hence the desire to get a second script working. I tried to copy the entire script into a new one, renamed it and all the existing elements, but it didn't work. If you want I could always email you my revised version. Just PM me with your address and I'll send it to you.
User avatar
Trista Jim
 
Posts: 3308
Joined: Sat Aug 25, 2007 10:39 pm


Return to IV - Oblivion