Forged Alliance Forever Forged Alliance Forever Forums 2017-12-27T23:47:39+02:00 /feed.php?f=41&t=15466 2017-12-27T23:46:54+02:00 2017-12-27T23:46:54+02:00 /viewtopic.php?t=15466&p=158690#p158690 <![CDATA[Re: DamageType...]]>
We just need to register all projectiles with an id so i can read any kind of custom data from all the sim way (weaponfire -> projectile -> onDamage -> dotakedamage). This is just amazing for modding because we can store on the projectile for example fx, instigator info, dodge informations, buffs, customs buffs, datatables...

In the following screenshot i read a LOG from Unit.DoTakeDamage custom data (instigator attackrating, weapon label, weapon category, custom buffs...) passed from Weapon.GetDamageTable.

Image

That solve my problem and close this post.

Statistics: Posted by Franck83 — 27 Dec 2017, 23:46


]]>
2017-11-17T21:09:06+02:00 2017-11-17T21:09:06+02:00 /viewtopic.php?t=15466&p=156662#p156662 <![CDATA[Re: DamageType...]]> Statistics: Posted by Franck83 — 17 Nov 2017, 21:09


]]>
2017-11-17T10:45:57+02:00 2017-11-17T10:45:57+02:00 /viewtopic.php?t=15466&p=156626#p156626 <![CDATA[Re: DamageType...]]> This is a critical brainstorming for very cool armors mods.

Yeah, you re right sad for adding args...

Otherwise, I went to the same way by hooking weapon.lua and projectile.lua.
For beams weapons, we need to hook the SetDamageTable in collisionBeam.lua too.

However, this way has some limitation, because of the DamageArea function. If there is a radius, this way will apply to all targets in the radius the initial target armors stats, not all target armors stats.

That's why i went to hook damagetype values, because there are passed to damagearea args.

I suspect damagetype values to be used essentially in armor (essentially overcharge). I think that there might be a more ambitious initial use of armors by GPG. Maybe some time and budget constraints. Time and testing will tell us.

Anyway, ty a lot for your help.

Statistics: Posted by Franck83 — 17 Nov 2017, 10:45


]]>
2017-11-17T04:27:34+02:00 2017-11-17T04:27:34+02:00 /viewtopic.php?t=15466&p=156616#p156616 <![CDATA[Re: DamageType...]]> WARNING: Error running OnImpact script in Entity [...]: Damage(instigator, target, amount, damageType) expected 5 args, but got 6

Also you can't change the damageType that you are getting from Unit.lua.OnDamage function.
And you "should not" change the numbers of arguments transported for any lua function.
Thats simply because if a mod hooks your function, it will crash because it will expect x numbers of arguments.

The only way i see is the projectile.lua.DoDamage function.
Inside this function you know the weapon and the unit that will be hit.
Then you need to hook weapon.lua to insert the new WeaponCategory into the damageTable

This way you have all data here to change the damageamount.

I did a small mod to show how it works:
It only uses non-destructive hooks and will work with any mod etc.
HookUnitMod-v1.0.zip

[Edit] I am not sure that you simply can replace 'normal' damagetypes. Aren't they used from the engine (ForgedAlliance.exe) ?

Statistics: Posted by Uveso — 17 Nov 2017, 04:27


]]>
2017-11-16T22:15:54+02:00 2017-11-16T22:15:54+02:00 /viewtopic.php?t=15466&p=156604#p156604 <![CDATA[Re: DamageType...]]>
There are several vanilla damagetype : normal, overcharge, Death, Nuke, EMP, OtheTacticalBomb, FireBeetleExplosion, Deathnuke, TacticalMissile.

Since damagetype are very specific; I keep all vanilla damagetype and just replace 'normal' damagetype by other values ('Missile', 'Artillery', 'Bomb', 'Kamikaze', 'Anti Air', 'Anti Navy', 'Direct Fire', 'Direct Fire Experimental'...)

So we can do all theses kind of amors in modding without touching unit bp values:
- Armor for overcharge damages, Death damages, Nuke Damages, EMP Damages, OtheTacticalBomb Damages, Deathnuke Damages, TacticalMissile Damages, Other Missile Damages (we can do separate for land / Naval), Artillery Damages, Bomb Damages, Direct Fire Damages, Direct Fire Naval Damages, Direct Fire Experimental Damages...

This gives some fantastic epic possibilites in modding . Just so crazy :) !

Statistics: Posted by Franck83 — 16 Nov 2017, 22:15


]]>
2017-12-27T23:47:39+02:00 2017-11-16T14:18:22+02:00 /viewtopic.php?t=15466&p=156591#p156591 <![CDATA[DamageType...[Solved]]]>
In my mod, i'm currently coding units Armors depending of the kind of Damages. For better damage type accuracy, i hooked the damagetable function passed to projectile and beams by switching :

Spoiler: show
By passing theses data, i can read damage.type on DoTakeDamages functions when the unit is hit.


from :
Code:
self.DamageTable.DamageType = weaponBlueprint.DamageType

to :
Code:
self.DamageTable.DamageType = weaponBlueprint.WeaponCategory

Because WeaponCategories are much accurate ('Missile', 'Artillery', 'Bomb', 'Kamikaze', 'Anti Air', 'Anti Navy', 'Direct Fire', 'Direct Fire Experimental'...), i can make specific armor depending of theses categories.

All works fine, i got some very cool armors, but, by hooking the DamageType, i must do some collateral damages, but i don't know the real impact. Maybe i can do some damage control and at the same time keeping my system.

It seems that some Damage functions are hard coded. I would like to overcharge the functions to add some parameters without touching the Damage.Type data.

But i don't know how ? Some ideas ?

Spoiler: show
You may ask why not using the internal armor system ?
Because i don't wanna touch unit bp for making mod virtually compatible with any kind of unit mods.
and i want more control on damage reduction (not only % absorbing).


I hope you understand me.

Statistics: Posted by Franck83 — 16 Nov 2017, 14:18


]]>