Aller au contenu

Photo

Creating random appearances


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

#1
Nebril2

Nebril2
  • Members
  • 59 messages

Hi all!

 

 

 

I use to had a module months ago where every created npc character had a random appearance. I mean i created a script where when they spawn they get a random head, skin color, phenotype etc. So there was no identical people. 

 

But that module got deleted by a problem in my pc and all my scripts. Now im trying to start over and i cant remember how i did it!

 

I cant find a way to change with a script the appearance (head skin color etc).

 

Maybe i had installed a .hak or something that allowed me to do it adding functions to scripts, but now i dont remember....

 

Can you help me? 



#2
Proleric

Proleric
  • Members
  • 2 354 messages

The essential OnSpawn code will look something like this:

      SetCreatureBodyPart(CREATURE_PART_HEAD, nHead, oNPC);
      SetColor(oNPC, COLOR_CHANNEL_SKIN,     nSkin);
      SetColor(oNPC, COLOR_CHANNEL_HAIR,     nHair);
      SetColor(oNPC, COLOR_CHANNEL_TATTOO_1, nTatoo1);
      SetColor(oNPC, COLOR_CHANNEL_TATTOO_2, nTatoo2);

where the integers nHead, nSkin etc are values chosen at random from a list.

 

For example, you might choose from the following colours:

 

const string SKIN_COLOR    = "000 001 002 004 005 008 009 012";
const string HAIR_COLOR    = "000 004 008 012 020 116 124";

 

Unfortunately, there is an engine bug which can spawn NPCs with no head or other invisible parts. This can be minimised by

 

  1. Choosing a random NPC template with the desired clothing (rather than equipping random clothing).
  2. Actioning the NPC to jump to an empty area, then immediately jump back.

I imagine you can tint the clothing randomly, too, but I haven't tested that.


  • henesua aime ceci

#3
Nebril2

Nebril2
  • Members
  • 59 messages

Ohhh right... that is. Thanks man....

 

 

 

The problem is that for some reason i don have the "setcreaturebodypart" on my functions list so i cant compile... what im missing here? i have diamond edition, with both expansions of course... 



#4
henesua

henesua
  • Members
  • 3 878 messages

look up that function in the lexicon and investigate which include you need for it.



#5
Nebril2

Nebril2
  • Members
  • 59 messages

Well cant find it in lexicon.

 

Im missing a lot of functions it seems. reinstalled and nothing. 

 

Im missing something big here. Game version 1.69.



#6
henesua

henesua
  • Members
  • 3 878 messages

hmm if it is a standard function (requires no include) then you should patch your game again.



#7
Nebril2

Nebril2
  • Members
  • 59 messages

Done. Working. 

 

Thanks guys :)