Aller au contenu

Photo

Question - Perminantly adding health after skipping character generation.


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

#1
Rogue World

Rogue World
  • Members
  • 46 messages
I am trying to experiment with bypassing the normal leveling system with a custom one and I think I am missing something obvious... I tried Get/SetMaxHealth() and the like but I am unable to apply a new max health value to a blank PC (a PC that skipped the character generation process).

Can someone point out what, if anything, I am missing?

Thanks. :blush:

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
Have you tried SetCurrentHealth? It's basically a wrapper for
SetCreatureProperty(oObject,PROPERTY_DEPLETABLE_HEALTH, fNewValue, PROPERTY_VALUE_CURRENT);
If you specifcally want to set the max health when you don't know the current health, you could try PROPERTY_VALUE_BASE instead of PROPERTY_VALUE_CURRENT.

Modifié par Craig Graff, 12 avril 2010 - 06:12 .


#3
Rogue World

Rogue World
  • Members
  • 46 messages

Craig Graff wrote...

Have you tried SetCurrentHealth? It's basically a wrapper for
SetCreatureProperty(oObject,PROPERTY_DEPLETABLE_HEALTH, fNewValue, PROPERTY_VALUE_CURRENT);
If you specifcally want to set the max health when you don't know the current health, you could try PROPERTY_VALUE_BASE instead of PROPERTY_VALUE_CURRENT.


[nwscript]
SetCreatureProperty(oUser, PROPERTY_DEPLETABLE_HEALTH, 10.0, PROPERTY_VALUE_BASE);
SetCreatureProperty(oUser, PROPERTY_DEPLETABLE_HEALTH, 10.0, PROPERTY_VALUE_CURRENT);
[/nwscript]

Worked. Thanks a bunch. I had tried using the SetCreatureProperty() function but must have done something wrong.

#4
Rogue World

Rogue World
  • Members
  • 46 messages
I have not spent to much time figuring exactly why, but it seems that after a PC is assigned a class thought the Chargen_SelectCoreclass() function that the base health value can not be changed via the SetCreatureProperty() function as easily, if at all.

#5
TimelordDC

TimelordDC
  • Members
  • 923 messages
Are you overriding the sys_chargen script and adding your code in the EVENT_TYPE_CHARGEN_SELECT_class?

If so, you need to add the code into EVENT_TYPE_CHARGEN_SELECT_BACKGROUND too since till (and including) that point, the character is reinitialized every time you select a race, class or background.

#6
Magic

Magic
  • Members
  • 187 messages
Maybe EVENT_TYPE_MODULE_CHARGEN_DONE is an option for you as well. The additional health won't be visible in the character creation anyway.

#7
Rogue World

Rogue World
  • Members
  • 46 messages

TimelordDC wrote...

Are you overriding the sys_chargen script and adding your code in the EVENT_TYPE_CHARGEN_SELECT_class?
If so, you need to add the code into EVENT_TYPE_CHARGEN_SELECT_BACKGROUND too since till (and including) that point, the character is reinitialized every time you select a race, class or background.


No actually I am not. I am just toying with how far I can push the toolset with what little I can find out about it. In the note I made above, I had gotten the health change to work, only to see it stop working once I assigned the PC a class for temporary skill availability. I entended on seeing if I could switch the PC's class on the fly... Only to find that once I defined the PC's class, I could no longer freely define its health.

When you say that the character is initialized, what does that mean in game terms? Would it matter if I was to completely remove the default leveling system including the perminant selection of classes, skills, etc?

#8
Rogue World

Rogue World
  • Members
  • 46 messages
Bump.

#9
Magic

Magic
  • Members
  • 187 messages
The problem can be found a lot easier when it is known what you're actually changing and where. As Timelord wrote, mostly like the Chargen_InitializeCharacter() calls in sys_chargen.nss are resetting what changes you made to the health property.

#10
Rogue World

Rogue World
  • Members
  • 46 messages

Magic wrote...

The problem can be found a lot easier when it is known what you're actually changing and where. As Timelord wrote, mostly like the Chargen_InitializeCharacter() calls in sys_chargen.nss are resetting what changes you made to the health property.


Ah, I see. Thank you for clarifying.