Aller au contenu

Photo

only giving the player 12 points to spend on attributes in character creation


  • Veuillez vous connecter pour répondre
17 réponses à ce sujet

#1
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
and then the player gets no more points at  level ups. does anyone know if this can be achieved?

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
I assume the 12 points is after the race/class bonuses?
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
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i would get on this if my toolset hadn't crapped out completely. have you had the failed to refresh resources error?

#4
TimelordDC

TimelordDC
  • Members
  • 923 messages
Nope. It might be the database is locked or database server was brought down/crashed. If that is the case, try finding the application responsible or restart your machine and see.

#5
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
seems that it was caused by one or more anti-spyware/malware programs i installed yesterday.

#6
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
well i thought so because it worked again after i restarted my computer but when i did an all local posts with a level i got the same problem again. posting that level seems to mess up everything.

#7
Magic

Magic
  • Members
  • 187 messages
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.

#8
TimelordDC

TimelordDC
  • Members
  • 923 messages

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
Magic

Magic
  • Members
  • 187 messages
That's why I don't modify any core scripts but actually I disagree that it's always best, especially for a stand-alone module. Think of the projects which intend to use the DA:O engine to implement an own game system. It depends on what the module creator wants.

#10
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
what do you mean by modifying core scripts magic. i thought it was impossible to do so. i've worked around that problem by rederecting events so far but according to you there are better ways of arranging things if a mod is going to be more or less completely different from dragon age.

#11
gordonbrown82

gordonbrown82
  • Members
  • 544 messages

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
Magic

Magic
  • Members
  • 187 messages
The scripts of the original campaign you see in the toolset are all modifiable. You just need to check them out or make a local copy. Perhaps you're speaking of something different?

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
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
that should work unless there's some script somewhere that assigns a new value to PROPERTY_SIMPLE_ATTRIBUTE_POINTS somewhere.

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
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
just changing sys_chargen_h doesn't work. do i have to do that in the single player module for it to have any effect?

#15
Magic

Magic
  • Members
  • 187 messages
What are you trying to do now? If you modify sys_chargen_h.nss, you need to recompile all scripts which call the function you modified. As discussed, since this will override future patches to these files as well, I'm not sure if that's what you want.

#16
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i just wanted to try something simple to see if the general idea of changing PROPERTY_SIMPLE_ATTRIBUTE_POINTS in sys_chargen_h would work. i didn't know about having to recompile other scripts.

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
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
or rather is there a less convoluted solution.

#18
Magic

Magic
  • Members
  • 187 messages
The official scripts ending with "_h" are so called header files. They won't compile by themselves, and they aren't executed themselves. Instead, they are included into other scripts with #include. Every script having a main() or StartingConditional() function which uses your modification (directly or through other functions) needs to be recompiled to actual include the changes you've done in the header file.

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 .