Author Topic: Changing race via script?  (Read 329 times)

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Changing race via script?
« on: January 06, 2014, 06:23:15 pm »


               Say I want to have an NPC of random race, gender and class (no multiclassing, only base classes and only playable races, though) summoned. Any combination of these three is supposed to be possible.

Do I have to make blueprints of all possible combinations for that, or is there a way I could summon this NPC and then change his, for example, race via script, so that I could use fewer blueprints?

I'm afraid I know the answer, but wanted to make sure before making a hundred blueprints. '<img'>
               
               

               


                     Modifié par Grani, 06 janvier 2014 - 06:26 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Changing race via script?
« Reply #1 on: January 06, 2014, 06:36:08 pm »


               with the basic NWN scripting hooks available to you, you can not change race. You would need NWNX for that. One way around this might be to play with polymorphs. I believe the race is changed to the form of the polymorph. Nevertheless I do not recommend this solution.

I have not tried changing class yet, so can not speak authoritatively on that.

If I was attempting to do what you are with Vanilla scripting I'd inventory what I can and can not change via script. Then I would create base blueprints of creatures with the characteristics I can not change.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Changing race via script?
« Reply #2 on: January 07, 2014, 12:48:00 am »


               If you don't mind the race selection only being cosmetic, you can just set the NPC's appearance to that of the desired race.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Changing race via script?
« Reply #3 on: January 07, 2014, 04:46:39 am »


               If you are concerned about the character sheet, you can use a subrace to display a racial name in the location the race would normally be displayed.  For classes, you can use LevelUpHenchman() (provided the NPC starts at level one) to level up the NPC in any chosen class.
               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Changing race via script?
« Reply #4 on: January 08, 2014, 10:58:19 am »


               Thanks for suggestions. However, I'd rather have them have all the characteristics of their race (including bonuses for favored enemy feat, if their opponent happens to have it).
I think I'll resort to creating blueprints for all combinations.
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Changing race via script?
« Reply #5 on: January 17, 2014, 05:49:08 am »


               There are some other threads around here where very intelligent people warn that this can cause unexpected bugs. However I have done this for my player world and though in the early stages, I cannot find any issues.

As suggested above this is done through NWNX_funcs