Increase a units health through lua?
Moderator: Moderators
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Increase a units health through lua?
I want to make a new mode where it is some units vs a hero but want the hero to be stronger.is there a way to increase a units health through lua or make him heal if so how? or do i need to make a new hero that heals?
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: units heal
You can add more health through the odf but I found a piece of code in the coruscant campaign script and I think it set the health for the bookcases, I say have a look at the script and see what you think, but I know you can add health using this line in the odf: MaxHealth= X
Just make sure you add that lin under the properties line.
Please do not type in all bold, it is against the rules, -Staff
Just make sure you add that lin under the properties line.
Please do not type in all bold, it is against the rules, -Staff
-
myers73
- Lieutenant General

- Posts: 690
- Joined: Fri Apr 03, 2009 11:04 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Atlanta, GA xfire=myers73 IngameName=mYers
Re: units heal
SetClassProperty("cis_inf_rifleman", "MaxHealth", 5000) --makes super b-droid have health of normal hero
do and search here on the forrums and you will get plenty of other examples
do and search here on the forrums and you will get plenty of other examples
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: units heal
Instead of MaxHealth, you can try AddHealth with the SetClassProperty function (following value indicates how much health a unit recovers per second).skelltor wrote:or make him heal
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: units heal
Ok so just add that line into the lua?
- Filipinio
- Master Sergeant

- Posts: 178
- Joined: Fri Jan 22, 2010 3:29 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Mygeeto's Bridge Battle's
Re: units heal
No, into the units odf under properties, either the defualt odf, or the units odf.
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: units heal
oh well i am asking for a way to do it through the lua.
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: units heal
SetClassProperty is a LUA function so that would mean the line goes in your LUA. MaxHealth and AddHealth are ODF functions by themselves.
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: units heal
ok thx everyone
. Hey would the setclassproperty also work with wepons or mshs?
-
kinetosimpetus
- Imperial Systems Expert

- Posts: 2381
- Joined: Wed Mar 25, 2009 4:15 pm
- Projects :: A secret project
Re: units heal
Yes and No, depends on whether you want multiplayer to work.
Player models, addon meshes, first persons can be swapped, playermodels will affect new spawning units, the others affect all, and weapons will crash multiplayer.
SetClassProperty cannot be called directly on a weapon odf.
Player models, addon meshes, first persons can be swapped, playermodels will affect new spawning units, the others affect all, and weapons will crash multiplayer.
SetClassProperty cannot be called directly on a weapon odf.
