PDA

View Full Version : Using player attributes


desophos
02-08-2012, 03:41 PM
Would it be possible to change what attributes do per level, or is that hardcoded? Even if it is, can I still access player attributes in other places for calculations? It's clear how to modify attributes, but not so much how to access the modified value.

Bluddy
02-12-2012, 10:08 AM
Would it be possible to change what attributes do per level, or is that hardcoded? Even if it is, can I still access player attributes in other places for calculations? It's clear how to modify attributes, but not so much how to access the modified value.

I guess you mean things like STR and such? I found a way to do it, but it's a little tricky. You can make skills that add to one stat when another attribute changes. Look at the SkillBonusDefensePerDex skill for an example. You can combine many stats this way. For more flexibility, you can look at my SkillPowerGainBonusBal skill in the mod. This allows you to really connect almost anything to anything else.

The trick is doing this globally for all classes, as well as canceling out bonuses that are hard-wired into the game. Doing things globally this way is hard because each class has a different skill tree. Also, each skill tree is limited to 20 skills, so you can't just tack on extra stuff. The solution I found is to add in extra 'hidden' skill trees. You can look at skilltrees.gdb and classesBal.gdb in my mod to see how I did this.

A down side -- if you connect an attribute to some new thing, you won't get text when mousing over the stat explaining the new connection. That part is hard-wired.

desophos
02-12-2012, 03:08 PM
What I really want to do is make identify speed scale with INT. I was hoping there was some way to just access PlayerINT or something so I could use it outside of skills.

Bluddy
02-12-2012, 03:54 PM
What I really want to do is make identify speed scale with INT. I was hoping there was some way to just access PlayerINT or something so I could use it outside of skills.

I'm pretty sure there's no way to do that. What you'd want is to make a skill that automatically does it, but there's no way of accessing the identify speed -- it's handled by system.gdb and nothing else touches it.

desophos
02-12-2012, 08:42 PM
But can't I access the player's INT from systems.gdb to calculate identify speed? Or does it just not work that way?

Bluddy
02-12-2012, 09:05 PM
But can't I access the player's INT from systems.gdb to calculate identify speed? Or does it just not work that way?

Nope, it doesn't. The stuff in systems.gdb is all completely hard-coded global variables -- it's just what Shadow stuck in there. The flexibility exists in the skill files, because that's the part that's more generic. The skills, status effects, monster files etc were built so that you could easily create new stuff without having to recompile the code every time, and that's where you can sometimes come up with tricks to make the system do things it wasn't planned for, like having extra hidden skill trees (actually in this case, it's making the DC system do things DoP could do which were still in the codebase).

dnken
02-13-2012, 09:56 AM
If you want change atributes go to classes.gdb and edit base strength from 5 to 10 etc

Shadow
02-13-2012, 06:00 PM
You can for example change how much Power, PowerRegen, Critical, and Perception the player gets per point of intelligence but you can't make intelligence do random other things.