Page 1 of 1

Function to set a unit to take points to unlock (solved)

Posted: Sun Feb 08, 2009 6:31 pm
by 666rulerofclones
i was wondering which one of the .lua functions can set a unit to take points to unlock. thanks.

Re: a quick queston....

Posted: Sun Feb 08, 2009 6:37 pm
by fiddler_on_the_roof
under

Code: Select all

function ScriptPostLoad()
type ( i think)

Code: Select all

SetClassProperty("rep_inf_ep3_rifleman", "PointsToUnlock", 12)
change the "rep_inf_ep3_rifleman" to whatever you want, and the same with the 12

Re: a quick queston....

Posted: Sun Feb 08, 2009 6:40 pm
by YaNkFaN
it's not a .lua function is an .odf function add this you the unit's default .odf

ie rep_inf_default_rifleman.odf

PointsToUnlock = ##

## can be any integer ie 1...2...3...4...etc

you can also do it through the .lua but i like this way better

Re: a quick queston....

Posted: Sun Feb 08, 2009 7:19 pm
by [RDH]Zerted
You could change it through the lua or through the odf files (ODF is preferred). Also, the SetClassProperty() doesn't have to be in ScriptPostLoad(), but it must be after that unit class is loaded by ReadDataFile(). That posted code looks fine.

Re: a quick queston....

Posted: Sun Feb 08, 2009 11:49 pm
by 666rulerofclones
ok, thanks guys. this topic can be locked now.