How to alter values of unitweights by scripting?

Interesting mapping tools and mapping help.

Moderator: Morax

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
speed2
Contributor
 
Posts: 3189
Joined: 05 Jan 2013, 15:11
Has liked: 636 times
Been liked: 1119 times
FAF User Name: speed2

Re: How to alter values of unitweights by scripting?

Postby Uveso » 12 Mar 2018, 20:51

@Ghoustaq:

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
end

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


@Speed2:

"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
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Previous

Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest