How to alter values of unitweights by scripting?

Interesting mapping tools and mapping help.

Re: How to alter values of unitweights by scripting?

Postby speed2 » 12 Mar 2018, 19:54

Im pretty sure I never wrote any code for damaging units in some area.

What do you mean by not working? Throwing error, not doing the damage?

I see you're hooking some function DamageArea, (I dont know where you're hooking it from), but you're not really calling it.

What you probably need, (or how I'd do it) is to ForkThread a new function that will periodically call the function that does the damage.
User avatar
Supreme Commander
Posts: 3078
Joined: 05 Jan 2013, 15:11
Has liked: 591 times
Been liked: 1036 times
FAF User Name: speed2

Re: How to alter values of unitweights by scripting?

Postby Uveso » 12 Mar 2018, 20:51


the function from the 2nd post in this topic is maybe helpfull for unitcap/UnitWeight

Code: Select all
if UnitBlueprint.CategoriesHash.TECH1 then
     UnitBlueprint.General.UnitWeight = 1

But i don't know if this works in a map file.


"DamageArea()" is an c-engine function to calculate NUKE AOE damage.
FAF already adds a hook (file DamageArea.lua) to patch this function. (Nuke AOE damage is no longer blocked from shield HP)
User avatar
Supreme Commander
Posts: 1570
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 55 times
Been liked: 244 times
FAF User Name: Uveso


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest