Thursday, April 12, 2012

[FA]Commander's enhancement apply an enhancements for units?

[:1]Hi here,
I would to know if it is possible when I build an enhancement on my commander my others units ( who are build or who are build later ) have automaticaly an special enhancement ?
For exemple imagine the commander build its enhancement who call " Nuclear ammo " after this all units who are build will have a new weapon who will use " nuclear ammo "
:)
I m not sure if you can understand me ( english skill :x ) but if you understood can you give me an exemple ? :)
Thanks a lot|||Yes, that's possible. I think someone has recently made a mod that does something very similar already. You should try to track that down.
If not, you have to script two things;
    1. When a unit is built, tell it to check if the upgrade has been built. The most efficient way of doing this would be to have something in AIBrain to flag the upgrade being built.
    2. When the upgrade is built, collect every unit on the map, and tell them to manually do the same check they would have done when they were built.
|||This I want to know to =o I can remake the Sc2 Research system with this...|||BulletMagnet|||Hi,
Sorry for the late reply abs,
this is certainly possible BUT takes a little planning before hand...
things you will need..
a hook of units.lua to add the enhancements to all units...
a modblueprints hook to add the enhancments to every units enhancements blueprint
another mod blueprints entry to add a new weapon to every unit.. (for ammo switching) --> i dont think you can swap out ammo on the fly... you have to create a new weapon with the new ammo.. and enable this weapon via the enhancement... while disabling the other..
a function in aibrain to store when the commander has the enhancement.. but also when it is removed..
a hook of unit.lua onstopbeingbuilt to check the aibrain function for if the enhancement has been built enable whichever weapon..
there are other bits and pieces... but once all this code is on place.. and working the other small parts are easy compared.. :)
this is how i would do it..|||.... If i'm on truth it is not easy ? :D|||asdrubaelvect|||as with everything, its only easy if you know how :)

No comments:

Post a Comment