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

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
666rulerofclones
Command Sergeant Major
Command Sergeant Major
Posts: 281
Joined: Fri Aug 08, 2008 1:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Badger State!

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

Post by 666rulerofclones »

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
1st Lieutenant
Posts: 460
Joined: Wed Nov 12, 2008 5:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: a quick queston....

Post 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
YaNkFaN
Field Commander
Field Commander
Posts: 943
Joined: Sat Dec 13, 2008 8:17 am

Re: a quick queston....

Post 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
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: a quick queston....

Post 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.
User avatar
666rulerofclones
Command Sergeant Major
Command Sergeant Major
Posts: 281
Joined: Fri Aug 08, 2008 1:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Badger State!

Re: a quick queston....

Post by 666rulerofclones »

ok, thanks guys. this topic can be locked now.
Post Reply