Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
58 stars 47 forks source link

Faction cant be read from chardef #1083

Closed GladieUO closed 1 year ago

GladieUO commented 1 year ago

Faction on npcs cant be read from chardef. Im setting the faction in on@create.

image

with .xshow faction image

DavideRei commented 1 year ago

You can't read properties declared under @create with serv.chardef

I think that faction should work in chardef. Otherwise all the sphere x chardef scripts are wrong

xwerswoodx commented 1 year ago

Honestly as DavideRei said you can't get variables set after char created by using chardef or itemdef etc. Because the values is not saved on anywhere as they defined after you created the npc.

The only way to get these variables ia spawning invisible new npc and get the variable and remove it. Or you can place one hidden in your star chamber and you can put it's uid to your scripts for checks. Or you can search map with forchars to get one npc with same id to take info from him.

This is not a bug at all, serv.chardef is for the properties that defined inside [chardef c_...] section. Any property defined under triggers cannot be readn with it.