LUA SetClassProperty commands questions (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
yukisuna
Rebel Sergeant
Rebel Sergeant
Posts: 210
Joined: Wed Jan 28, 2009 5:50 am
Projects :: My new PC hates the Mod Tools
Games I'm Playing :: See Interests
xbox live or psn: Samura Yukisuna
Location: Stuck in a place full of happy happiness known as Steam.

LUA SetClassProperty commands questions (SOLVED)

Post by yukisuna »

yes, i have read all the lua threads, but i couldnt find what to write; i tryed SetClassProperty("myweaponname","Shotdelay*",0.3) and such but nothing happens!


* SingleClick/SalvoCount/SalvoDelay etc.


and, is it possible to change a weapons ordnance commands (MaxDamage/DamageFinalDamage etc.) this way?


i read what SHOOT ME DEAD! wrote, and he said he could change weapon properties, so i thought i should ask some of the professional lua coders...

ok, thank you! :D
Last edited by yukisuna on Wed Oct 28, 2009 5:19 am, edited 2 times in total.
mswf
Master Bounty Hunter
Master Bounty Hunter
Posts: 1674
Joined: Tue Mar 31, 2009 3:40 pm
Location: Twello, The Netherlands
Contact:

Re: LUA SetClassProperty commands questions

Post by mswf »

No. (If I remember this correctly)
You cannot edit .odf properties through .lua commands. I'm not sure about this, but you could try to let the .lua activate parts of the .odf that are already in the .odf.
MandeRek
Sith Master
Sith Master
Posts: 2766
Joined: Tue Oct 02, 2007 10:51 am
Projects :: Battlefront Zer0
Games I'm Playing :: SWTOR
xbox live or psn: No gamertag set
Location: Ghosting around GT
Contact:

Re: LUA SetClassProperty commands questions

Post by MandeRek »

mswf wrote:No. (If I remember this correctly)
You cannot edit .odf properties through .lua commands. I'm not sure about this, but you could try to let the .lua activate parts of the .odf that are already in the .odf.
Not entirely true, you can change all properties for an unit/vehicle/prop odf, which are possible parameters for those (so not "SkeletonLowrez" for vehicles, etc.) Weapons are not to be changed through lua. What I suggest, is make another weapon odf with the changes you want, and add this line:
Hidden/Spoiler:
SetClassProperty("theclassusingthenewweapon", "WeaponName1"(or 2, 3, whatever slot it's in), "newweaponodfname")
The weaponodf, however, needs to be loaded. I did this by making a 'dummyunit' odf, with this as a weapon, and I didn't use it in the teamsetup. Still, all weapons he has will be loaded Note: This is how i changed the old BF0 heroes; i made a new dummyunit in a new side, with a lot of new forcepowers, and changed the old unit odfs through these SetClassProperty lines to have the new weapons ;)
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: LUA SetClassProperty commands questions (SOLVED)

Post by [RDH]Zerted »

MandeRek is right. We can't change weapon properties through the Lua the way you want to change them.

MandeRek's work around is the best way to do it. However if you only wanted to change the weapon's damage, another way to do it would be to listen for objects being damaged. When the object is damaged, check to see what weapon damaged it. If it's the right weapon, increase/decrease the object's health based on how you wanted to change the weapon.
Post Reply