Aller au contenu

Photo

Script to raise attributes?


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

#1
Anysecondnow

Anysecondnow
  • Members
  • 9 messages
Hi everyone,

Maybe I am overlooking something, but I cannot figure out how to permanently raise an attribute (like strength or dexterity) of the main character and/or a companion via a script. Can anyone help please?

Thanks a lot!

#2
mogromon

mogromon
  • Members
  • 41 messages
first get the ability score without enhancements -->int GetAbilityScore(object oCreature, int nAbilityType, TRUE); (the TRUE at the end doesnt consider any enhancement)

you add a number and then using void SetBaseAbilityScore(object oCreature, int nAbilityType, int nScore);

if you want to be able to return to the original value, use SetLocalInt with the original value.

That set permanently a new ability score,

#3
Dann-J

Dann-J
  • Members
  • 3 161 messages
Keep in mind that permanently modifying ability scores via script can result in an 'illegal' character:

http://nwn2.wikia.co...aseAbilityScore

Modifié par DannJ, 27 novembre 2011 - 09:55 .


#4
Anysecondnow

Anysecondnow
  • Members
  • 9 messages
Thx, mogromon & DannJ. Just to be on the safe side: what does "illegal" mean in this context? Does this refer to mp?

#5
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
If some servers for persistant worlds or other multiplayer situations check for "illegal" characters, then this will make them "illegal". If you are making a SP module, then it probably isn't a problem. I've done this in both the modules I've made and no one has complained.

#6
Anysecondnow

Anysecondnow
  • Members
  • 9 messages
Thx, M. Rieder! I am working on a SP module indeed.

#7
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Great. You will probably be fine if you use it. I know on my first mod, I agonized about using it, but here it is about 18 months after release and no one has complained. I'm sure you will be fine.