Author Topic: APPEARANCE_TYPE_* creation?  (Read 446 times)

Legacy_The Great Thief

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
APPEARANCE_TYPE_* creation?
« on: May 14, 2012, 07:59:53 am »


               I need help with this since I suck at the whole coding aspect, and Google has failed me.  Gonna quote someone from ages ago on this forum:


Xardex wrote...

If you are talking about adding a new "APPEARANCE_TYPE_..." to the regular list, I dont think its possible. You can create an include script where you define them as constant ints, but you'll need to find the appearance's line number in the 2da.

Find the cep's version of "appearance.2da", found in the cep 'top' haks. You can use NWN Explorer to browse the .hak and extract the .2da. (you can find it at nwvault) (Can't search text files with nwnexplorer, thats why you need to extract it and open it with nopepad/whatever)

Search for your appearance type. The line you find it in has a number before it. You can use the line number with the SetAppearance function or create constant ints like APPEARANCE_TYPE_TREANT = #;

It might sound difficult but once you get the tools and figure out how to use them, which isnt hard, it takes about 30 seconds to find that number.



I have NWNexplorer. I found the ID of the creature I want to add as a subrace appearance (Shayan's 3.0). .... But I have no idea how to make a const int, or where it would even work. I tried :


    const int APPEARANCE_TYPE_GNOLL_VISHTANI = 1554;
    CreateSubraceAppearance("Gnoll", TIME_BOTH, APPEARANCE_TYPE_GNOLL_VISHTANI, APPEARANCE_TYPE_GNOLL_VISHTANI);
 
Mind you, this is still in the same subrace file, as I really haven't the slightest clue where I'd put this. I also don't know how to use "SetAppearance" that Xardex was speaking of. Any ideas?
               
               

               


                     Modifié par The Great Thief, 14 mai 2012 - 07:01 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
APPEARANCE_TYPE_* creation?
« Reply #1 on: May 14, 2012, 09:02:17 am »


               Have you tried just entering the appearance number directly?

CreateSubraceAppearance("Gnoll", TIME_BOTH, 1554, 1554);

Might be the easiest solution rather than trying to make a new CONSTANT list or looking around for includes.
If you'd rather have the name then you might need to find the CEP include script that contains the constants for their appearances and reference it at the top of one or more of Shayan's scripts with a line kinda like so:

#include "cep_script_here"

I haven't used Shayan's but i took a quick peek. I also haven't tested this in any way. It's just an educated guess. Hopefully it will work for you. Good luck.
               
               

               


                     Modifié par GhostOfGod, 14 mai 2012 - 08:11 .
                     
                  


            

Legacy_The Great Thief

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
APPEARANCE_TYPE_* creation?
« Reply #2 on: May 14, 2012, 06:42:31 pm »


               Thanks. I haven't exactly got it working because of some other nonsense, but it IS compiling.

Now I have another problem that just.. makes zero sense to me. The syntax seems correct. When I start as the Gnoll subrace, it gives me this:

Character has failed to meet the following criteria required to be part of this subrace:
Your sub-race has been removed because you did not meet the criteria.

And this is the syntax:

//Subrace name: Gnoll

//Properties of the skin:
   //+2 strength
   //+2 cons
   //-2 Int
   //-2 Cha
   //Darkvision
   //Power Attack

    CreateSubrace(RACIAL_TYPE_HUMAN, "Gnoll", "skin_gnoll", "", FALSE, 0, FALSE, 0, 0);

   //Abilities
   struct SubraceBaseStatsModifier GnollStats = CustomBaseStatsModifiers(2, 0, 2, 0, -2, -2, MOVEMENT_SPEED_CURRENT);
   CreateBaseStatModifier("Gnoll", GnollStats, 1);

   //Feats
    ModifySubraceFeat("Gnoll", FEAT_DARKVISION, 1);
    ModifySubraceFeat("Gnoll", FEAT_POWER_ATTACK, 1);

    CreateSubraceAlignmentRestriction("Gnoll", TRUE, TRUE, TRUE, TRUE, TRUE);  //I did this one just out of guessing for the stupid criteria error.

    //Appearance: Gnoll - Permanent.
    CreateSubraceAppearance("Gnoll", TIME_BOTH, 1554, 1782);

    AddSubraceFavoredclass("Gnoll", class_TYPE_BARBARIAN, class_TYPE_BARBARIAN);

It doesn't actually tell me what criteria, it just says it doesn't meet it. ...My character isn't good enough to meet zero criteria. :3 He's an underachiever. I did test this with the old appearance that was working before, which was "APPEARANCE_TYPE_GNOLL_WARRIOR" and that's giving me the same error, so it's not that.


EDIT: I got it to work by changing the name (which I just set as Gnoll Berserker). Though if I type in "Gnoll" as the subrace, it still declines me, meaning there's probbaly some hidden crouton-in-the-lettuce that I need to weed out. Thanks again for making my gnoll pretty.
               
               

               


                     Modifié par The Great Thief, 14 mai 2012 - 06:49 .
                     
                  


            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
APPEARANCE_TYPE_* creation?
« Reply #3 on: May 15, 2012, 02:12:49 pm »


               I skipped the traditional subrace creation route, making a conversation for the PC for after they enter the module, this way they can select or remove a subrace in game...

I use nwnx_funcs

The beauty of the system is, it's easy to code!
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
APPEARANCE_TYPE_* creation?
« Reply #4 on: May 17, 2012, 03:33:46 pm »


               

void SetCreatureAppearanceType(
    object oCreature,
    int nAppearanceType
);

oCreature
Creature to change appearance of

nAppearanceType
APPEARANCE_TYPE_*
^ APPEARANCE_TYPE_* or .2da line number.

As for constant ints, you declare them outside functions.
               
               

               


                     Modifié par Xardex, 17 mai 2012 - 03:09 .