Aller au contenu

Photo

Scaling Talent Points


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

#1
hatstand2371

hatstand2371
  • Members
  • 14 messages
I'm trying to find where in the scripts I could place some code, so that on level up, you get an amount of talent points based on your level (2 at 1-10, 1 at 10-15, 1 every 2 levels at 15+, etc), but I can't find it... I've tried going through everything in sys_chargen, sys_chargen_h and sys_reward_h. I tried adding it under line 140 in sys_reward_h, which is where (from what I can see), it figures out if you've levelled up or not.

Could someone point me in the right direction with this?

#2
midnightgeek

midnightgeek
  • Members
  • 30 messages
EDIT: I might have misunderstood your intent when I first replied.  If you want to replace the existing talent point system, any changes you make to sys_rewards_h will not take effect unless you recompile player_core.  If you want to reward additional points, you might want to try adding some code to handle the following event, in your module_core script (For compatibility)

http://social.biowar...E_PLAYERLEVELUP

P.S. If you are intending to replace the existing system, have a look at line 600 of sys_autoscale_h.

Modifié par midnightgeek, 06 juillet 2010 - 04:25 .


#3
midnightgeek

midnightgeek
  • Members
  • 30 messages
I liked your idea so I tried to do something similar in my module and discovered a few things.

It seems in order to make this work you will need to modify a local copy of sys_autoscale_h and then recompile every script that includes sys_rewards_h.

I am able to make this work when my player gains a level caused by XP that I awarded him in my own script via console, but when he gains a level "naturally" it uses the standard system.

I am not sure what scripts need to be recompiled but I will let you know if I figure it out.

#4
midnightgeek

midnightgeek
  • Members
  • 30 messages
Turns out it would be a nightmare to recompile every script that includes sys_rewards_h.

But the same effect can be achieved by handling the EVENT_TYPE_PLAYERLEVELUP in your module_core script... You just need to adjust the available points by using SetCreatureProperty(oPlayer, PROPERTY_SIMPLE_TALENT_POINTS, fNumPoints). (You can add or subtract available points this way.)

#5
hatstand2371

hatstand2371
  • Members
  • 14 messages
Thanks for the response;

Slight problem - EVENT_TYPE_PLAYERLEVELUP is sent whenever the level up screen is entered, not on the actual event of a character levelling up. So, just modifying the available points on that event won't work, as it gets fired when use use the talent point books and such. I'm thinking, use an array, and store the level for each party member in it, then check against it when the event is fired, and modify the points based on that.

Edit: Also, line 600 in sys_autoscale_h is exactly what I was trying to find last night
 
Edit2: Hit a roadblock with arrays not remembering their states, switching to the module variable 2da

Edit3: Working, source is here. All it does currently is give you 2 talent points on level. Going to figure out the scaling thing later.

Modifié par hatstand2371, 07 juillet 2010 - 03:18 .