there is any way to make byond choose a hair style and hair color to a NPC?(i create the icon base without hair)
or even for a char you create
its would be great if it choose you a randomally hair style and hair color(i will define the hair style and the color of hair)but i dont really know how to code somthing like this.
is it even possebole?
also i want to create a mirror NPC that will look just like the player,he will have the same hair color and hair style
doest that possebole too?
tnks for reading this topic
hope you understand what i mean
ID:162211
Feb 12 2008, 1:11 am
|
|
Feb 12 2008, 1:29 am
|
|
It's really quite simple.
|
In response to Flame Sage
|
|
I like your autgen hair code :)
|
Ami425 wrote:
there is any way to make byond choose a hair style and hair color to a NPC?(i create the icon base without hair) What you would want to do for this, is to create a list that contains the names of the icon_states of the hair styles, and then when you override the New() proc for the NPC, you can use the pick() function to randomly pick a variable in that list, and then use that to create the hair style on the NPC. The same can also be used with the colour, except you use rand(0,255), and have it generate it for 3 variables that should be used for the red, green and blue component for the icon manipulation functions. also i want to create a mirror NPC that will look just like the player,he will have the same hair color and hair style One of the easier ways is to create a 'backup' set of variables that house what the player selects when creating their character, and then when you want the NPC to mirror the player, you can use those backup variables (name of hair icon_state, and the r,g,b values used to colour the hair) to determine what the NPC would look like on the fly. |
In response to Saucepan Man
|
|
but my hairs are at deffernt icons and i dont really get how to code it
example what ";" is that thing? and also { } thats making lots of errors at my code |
In response to Ami425
|
|
It's just condensing the code. It can also be written as...
/mob/npc/ Post what errors you having@ |
In response to Flame Sage
|
|
umm but how i can do this if my hairs at deffernt icons?
and the create mirror work great but its a verb and i want to make it when you teleport to place its will create you a mirror that will attack you think its possebole?(the error was src: missing comma ',' or right-paren ') and one more question how can i make that i will get attack beetween lvl 28-50 and if the player pass lvl 50 and still didn't get he will get it at the next lvl for sure |
In response to Ami425
|
|
Pseudo code
if(level <= 50 && level >= 28 && prob(20)) // 20% chance |
In response to Iuss
|
|
Iuss wrote:
Pseudo code > if(level <= 50 && level >= 28 && prob(20)) // 20% chance if(src.kombatent == "Cage"||src.kombatent == "Liu Kang") is that good if i am doing it like this? |