Hi another question ;)

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
richardali
New User
Posts: 7
Joined: Tue Sep 09, 2008 4:27 am

Hi another question ;)

Post by richardali »

/*
var npcdatabase := ReadConfigFile("npcdesc");
var alignment := npcdatabase[npc.npctemplate].alignment;

Print( npc.alignment );

If( npc.alignment == "evil" )
Return TEXT_MURDER_COLOR;
EndIf

if( npc.alignment == "good" )
Return TEXT_INNOCENT_COLOR;
EndIf
*/

i'm working on my singleclickhook system, adapting for zuluhotel system, builded by beaud, i don't know why i used print after the variable 'alignment', and returning <unitialized object> i don't know what to do =/, i'm working in pol 096.7 core

thanks

Ps: MontuZ, thanks by the other post
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Hi another question ;)

Post by Pierce »

You already read out the alignment from the npcdesc.
Assuming that the npc has an alignment it should
look this way:

Code: Select all

var npcdatabase := ReadConfigFile("npcdesc");
var alignment := npcdatabase[npc.npctemplate].alignment;

Print( alignment );

If( alignment == "evil" )
Return TEXT_MURDER_COLOR;
EndIf

If( alignment == "good" )
Return TEXT_INNOCENT_COLOR;
EndIf
richardali
New User
Posts: 7
Joined: Tue Sep 09, 2008 4:27 am

Re: Hi another question ;)

Post by richardali »

yes dude i did that and returning <unitialized object>

thanks
richardali
New User
Posts: 7
Joined: Tue Sep 09, 2008 4:27 am

Re: Hi another question ;)

Post by richardali »

solved :)

the problem are was:

var npcdatabase := ReadConfigFile("::npcdesc");
var alignment := npcdatabase[npc.npctemplate].alignment;

in the '::'

i put it and now the script can read the config file :)
Post Reply