Aller au contenu

Photo

Reset character to level 1


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

#1
Jopon

Jopon
  • Members
  • 17 messages
Anyone know how to make a script that will reset your character to level 1 with no exp/skills/etc. I saw the one script that lets you respec but that leaves your level untouched and replaces everything with points. I am pretty sure I can edit that script to make it so that it doesnt replace all your skills and resets them too zero, but that won't do my any good if my level remains the same. Anyone know how I can just reset a character?

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
Just setting your character's experience points to 0 will work, I believe. (I'm nowhere near the toolset at the moment, so I can't actually verify that.)

#3
Phaenan

Phaenan
  • Members
  • 315 messages
You could always use the sys_autoscale_h routines. From what I remember that's what the various debug scripts use. Can't try myself tho, so maybe it wouldn't work, or even go haywire.

#4
Jopon

Jopon
  • Members
  • 17 messages
The problem I am having is finding a way to set my characters experience to zero. I looked through the autoscale and couldn't find anything in there to do it, or if else I am missing it. The only thing I can find to change a characters xp is the rewardXP function, but I can only use that to reward xp, not remove it.

You know of any functions that lets to change the current amount of xp a hero has?


Well I found a way to force my character to lvl 1 but nothing else changes. He keeps all his xp/abilities/etc. Using


            object oCreature = GetHero();
            SetCreatureProperty(oCreature, PROPERTY_SIMPLE_LEVEL, 1.0);

Still looking for a way to edit my xp directly.

Update - Ok i found a way to edit the amount of xp my hero has, but it looks like setting it to zero does nothing worthwhile. what i was able to do is this


            SetCreatureProperty(oCreature, PROPERTY_SIMPLE_LEVEL, 1.0);
            SetCreatureProperty(oCreature, PROPERTY_SIMPLE_EXPERIENCE, 1.0);

To set my character to level 1 with no experience. Everything else remains untouched but it should be fairly simple to reset everything individually. If someone does figure out an easier way then please let me know, but for now I will just write a loop so remove each stat and attriubte individually. The end result should be a reset hero.

Modifié par Jopon, 28 décembre 2009 - 12:42 .


#5
Magic

Magic
  • Members
  • 187 messages
I think the best place to start is Chargen_InitializeCharacter() in sys_chargen_h.nss. There you can see what all needs to be reset. Additionally, this function grants the level 1 points to spend. An own function could get rid of it, if you want to. Setting the creature's properties is actually quite correct. The base characteristics of creatures are those creature properties.