Custom Formations
Moderator: Moderators
Custom Formations
How to prevent custom formations from working on air units?
I have another widget that i want to control air units and i need custom formations to stop doing anything with air units,completely.
I have another widget that i want to control air units and i need custom formations to stop doing anything with air units,completely.
Re: Custom Formations
not sure if that is correct, i just looked at the widget.
There seems to be this array
where it puts units that will be affected.
So during the creation of this array the air units must be filterd out. Maybe this way?
The cap stuff should check if the is air by looking at a tag all air units share, like uhm no idea what this could be you probally know better.
edit
if you add any planes in the selection will not get the order to spread across the curvy formation line. if you just click they will fly there. crtl click works too but not line move. dont know how to fix line move sorry.
edit
wtf am i writing
There seems to be this array
Code: Select all
-- Get units command applies to
local mUnits = {}
So during the creation of this array the air units must be filterd out. Maybe this way?
Code: Select all
for uDefID, uIDs in pairs(units) do
if commandApplies(0, uDefID, cmdTag and UNIT IS NOT AIR) then
edit
if you add
Code: Select all
and uDefs[uDefID].canFly ==false
edit
wtf am i writing
Re: Custom Formations
The easiest and friendliest way is just to set your widgets layer in :GetInfo to below that of custom formations, then return true on your widgets :MousePress if your specific criteria (i.e. only air selected) is met. This prevents custom formations 2 being informed about the mouse press and as a result it won't do anything at all.
Re: Custom Formations
No, because when both planes and kbots are selected, you probably still want kbots to use custom formation.
Re: Custom Formations
Problem Solved due to some other advice niobium game me,thx all.
Re: Custom Formations
release your widget version please, i think it might be very usefull
Re: Custom Formations
nothing special my CF was outdated and the newest version works fine.
Re: Custom Formations
No,I didn't test enough.
Both widgets til ldont work together.
I get this error :
[ 310] Giving 5 armfig to team 0
[ 468] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
[ 552] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
[ 624] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
Both widgets til ldont work together.
I get this error :
[ 310] Giving 5 armfig to team 0
[ 468] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
[ 552] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
[ 624] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
Re: Custom Formations
3rd message in this page seems 100% related to this problem.Gota wrote:No,I didn't test enough.
Both widgets til ldont work together.
I get this error :
[ 310] Giving 5 armfig to team 0
[ 468] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
[ 552] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
[ 624] <CustomFormations2> Conflict detected with Air Formation widget on MOVE command, expect anomalies
Re: Custom Formations
My air formation widget does not use the mousepress function.
Should i add it just so that it would block the mouse detection in custom formations?
the layer in my widget is lower than in custom formations.
the widget
http://pastebin.com/uftHZHKq
Should i add it just so that it would block the mouse detection in custom formations?
the layer in my widget is lower than in custom formations.
the widget
http://pastebin.com/uftHZHKq
Re: Custom Formations
To stop the lines being drawn you would handle mousepress.
To handle single-click only, you would use CommandNotify (as you have), which would work fine except that custom formations likes to send out fake commandnotifies which screw it up nicely.
I'll be releasing a new custom formations within a few days which fixes quite a few things, mainly related to faked and incorrect CommandNotifys. It'll let your current widget as-is work fine with single-click, but you'll still need the mousepress part to prevent lines being drawn.
To handle single-click only, you would use CommandNotify (as you have), which would work fine except that custom formations likes to send out fake commandnotifies which screw it up nicely.
I'll be releasing a new custom formations within a few days which fixes quite a few things, mainly related to faked and incorrect CommandNotifys. It'll let your current widget as-is work fine with single-click, but you'll still need the mousepress part to prevent lines being drawn.