Function to set a unit to take points to unlock (solved)
Moderator: Moderators
- 666rulerofclones
- Command Sergeant Major

- Posts: 281
- Joined: Fri Aug 08, 2008 1:30 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The Badger State!
Function to set a unit to take points to unlock (solved)
i was wondering which one of the .lua functions can set a unit to take points to unlock. thanks.
-
fiddler_on_the_roof
- 1st Lieutenant

- Posts: 460
- Joined: Wed Nov 12, 2008 5:28 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: a quick queston....
under
type ( i think)
change the "rep_inf_ep3_rifleman" to whatever you want, and the same with the 12
Code: Select all
function ScriptPostLoad()Code: Select all
SetClassProperty("rep_inf_ep3_rifleman", "PointsToUnlock", 12)
-
YaNkFaN
- Field Commander

- Posts: 943
- Joined: Sat Dec 13, 2008 8:17 am
Re: a quick queston....
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
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
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: a quick queston....
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.
- 666rulerofclones
- Command Sergeant Major

- Posts: 281
- Joined: Fri Aug 08, 2008 1:30 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The Badger State!
Re: a quick queston....
ok, thanks guys. this topic can be locked now.
