I am trying to create an NPC with a specific gender but the gender property I set on the struct doesn't seem to work.
Here is the program I am testing with:
Code: Select all
use uo;
program text_command_cnpc(who, textline)
var props := struct;
var stuff := SplitWords(textline);
props.+ name := stuff[1];
props.+ gender := CInt(stuff[2]);
props.+ color := 33;
var loc := TargetCoordinates(who);
CreateNPCfromTemplate("peasant1", loc.x, loc.y, loc.z, props, who.realm);
endprogram
cnpc Glen 0
I get the name and colour I have set but the gender sometimes is female. I've tried the program without the CInt() wrapper and even with a CStr() wrapper but I get the same resulrs. Most times I get a male NPC but sometimes I get a female. It doesn't matter whether I specify male or female (0 or 1) I still get semi random results. Any ideas what I might be doing wrong?
Thanks.