only giving the player 12 points to spend on attributes in character creation
#1
Posté 30 mars 2010 - 07:35
#2
Posté 30 mars 2010 - 08:55
One method I can think of is to override the chargen events in your module script. The property you should be looking for is PROPERTY_SIMPLE_ATTRIBUTE_POINTS
During character creation, set PROPERTY_SIMPLE_ATTRIBUTE_POINTS to 12 (this is set in the Chargen_InitializeCharacter function in sys_chargen_h).
During character level-up, check the totals of the base values of the six attributes (lets call this nCurrentTotal). Get the current value of PROPERTY_SIMPLE_ATTRIBUTE_POINTS (lets call this nCurrentAttrPoints).
If nCurrentAttrPoints > 86 - nCurrentTotal, reset nCurrentAttrPoints to (86-nCurrentTotal)
86 here is the base stat values (74 after race/class bonuses) + 12 (initial points given during chargen)
Now, if you have any rewards or items that give attribute points to level up, the above will remove them. In order to have them, you can assign the extra points to a creature variable and use that to calculate the current attribute points the player will have to spend.
The above method is hacky at best but I don't know where the game assigns the 3 attribute points on level-up. If you can find that, you can try and override that to give zero points.
More elegant solutions are welcome!
#3
Posté 31 mars 2010 - 08:47
#4
Posté 31 mars 2010 - 09:11
#5
Posté 31 mars 2010 - 10:45
#6
Posté 31 mars 2010 - 10:55
#7
Posté 01 avril 2010 - 05:21
#8
Posté 01 avril 2010 - 05:56
Magic wrote...
I have no clue what problem you encountered but in case the original question is still open, the 3 attribute points per level are given in Levelup_SetReadyToLevelUp() of sys_autoscale_h.nss. To remove the 3 points here is a bit tricky because you'd need to recompile every script which calls RewardXP() in sys_rewards_h.nss. Not sure if you want this.
Modifying a core include file and recompiling other core scripts for distribution is really not a good idea given that these scripts can change via patches/DLC/expansions. It is always best form to override specific events and use custom functions/scripts to do changes so that any changes to core scripts are reflected in your module without you having to recompile and redistribute a new mod version everytime the scripts change.
#9
Posté 01 avril 2010 - 07:33
#10
Posté 01 avril 2010 - 09:36
#11
Posté 01 avril 2010 - 10:13
During character level-up, check the totals of the base values of the six attributes (lets call this nCurrentTotal). Get the current value of PROPERTY_SIMPLE_ATTRIBUTE_POINTS (lets call this nCurrentAttrPoints).
If nCurrentAttrPoints > 86 - nCurrentTotal, reset nCurrentAttrPoints to (86-nCurrentTotal)
86 here is the base stat values (74 after race/class bonuses) + 12 (initial points given during chargen)
given that there are a lot of scripts that calls the Levelup_setreadytoleavelup function then this seems to be the best solution. the level up event is sent to a script. do you know which script that is?
#12
Posté 01 avril 2010 - 11:10
If you're going to make your own game system - let's say including own talents, spells, scaling, and balancing - you might want patches actually not to alter your system, no? Otherwise you probably need to rebalance again and again. Since you're going to remove the attribute gain from level-up, I assumed you have an own system in mind. Otherwise, bonuses on equipment will be much more important, and some talent combinations will be pretty hard to get if at all, don't you think? So it depends on what you want to achieve in total. I fully agree that recompiling all scripts with Levelup_SetReadyToLevelUp() calls, is something you'd usually avoid.
On the other hand, you could simply
SetCreatureProperty(GetHero(),PROPERTY_SIMPLE_ATTRIBUTE_POINTS,-100.0);
after EVENT_TYPE_CHARGEN_END. That worked for me in a quick test.
Edit: Oops, -100.0 won't be sufficient with the new level cap but you get the idea. -1000.0, for example.
Modifié par Magic, 01 avril 2010 - 11:23 .
#13
Posté 01 avril 2010 - 11:43
regarding balancing none of the patches released so far has made any significant changes that could offset current gameplay. that doesn't mean that it's not going to become a problem but i don't have a good enough grasp of how to avoid that from happening to do anything about it.
Modifié par gordonbrown82, 01 avril 2010 - 11:45 .
#14
Posté 05 avril 2010 - 04:15
#15
Posté 05 avril 2010 - 04:36
#16
Posté 05 avril 2010 - 06:57
what about these two ways of rederecting events to make it work:
1. redirect all the events in sys_chargen.nss that calls Chargen_InitializeCharacter()
to a new script that contains the changed Chargen_initializeCharacter() function and the code for those events that was originally in sys_chargen.nss
2. redirect all events that goes to sys_chargen.nss to a copy of the sys_chargen.nss file with changes that gives 12 attribute points at character creation.
Modifié par gordonbrown82, 05 avril 2010 - 06:58 .
#17
Posté 05 avril 2010 - 07:12
#18
Posté 06 avril 2010 - 07:21
Both 1. and 2. will work and are basically the same. It doesn't really matter if the script is a copy or a new one. When redirecting events, one thing to remember is that other add-ons might want to redirect events as well.
The change to the character initialization is not as problematic as the change per level, as the character initialization is basically called only through one script: module_core.nss. For a custom module, it's a sound solution to use an own module script and handle the chargen events there.
Edit: Bah, the system is by far not as obvious as you'd think it should be. 1) If you modify sys_chargen_h.nss, you need to recompile sys_chargen.nss. 2) If you want an own module script, module_core.nss has to be replaced because the events are sent there. 3) Redirecting the events is as you intended.
Modifié par Magic, 06 avril 2010 - 07:30 .





Retour en haut






