|
|
|
|
pftq
Administrator
Offline
Posts: 4202
|
|
« Reply #19 on: June 16, 2008, 05:49:46 PM » |
|
Then you are using the wrong approach. What you need is 20 different flares (or however many units there are of that type). You can't use just one flare command for that and it also requires kbunitquery. Something along the lines of this: <Effect name="Flare Unit Type in Area (Center Unit)"> <Param name="Object" dispName="Center Unit" varType="unit">default</Param> <Param name="Dst" dispName="Radius" varType="string">10.0</Param> <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param> <Param name="FromPlayer" dispName="From Player or 99 for ALL" varType="string">99</Param> <Param name="ForPlayer" dispName="Flare Player or 99 for ALL" varType="string">99</Param> <Param name="Dur" dispName="Duration" varType="float">1.0</Param> <Param name="Booler" dispName="Include Center Unit" varType="bool">false</Param> <Command>trQuestVarSet("convarea", 0);</Command> <Command>trQuestVarSet("ffweho",0);</Command> <Command>if(%FromPlayer%!=99) trQuestVarSet("vroom", %FromPlayer%);</Command> <Command>trQuestVarSet("warthog", 0);</Command> <Command>trQuestVarSet("zeep", 0);</Command> <Command>if(%UnitId%>=0) {</Command> <Command>trQuestVarSet("zeep", %UnitId%);</Command> <Command>}</Command> <Command>if(0>%UnitId%) {</Command> <Command>while(kbGetUnitTypeName(trQuestVarGet("zeep"))!="All") {</Command> <Command>trQuestVarSet("zeep", trQuestVarGet("zeep")+1);</Command> <Command>}}</Command> <Command>trQuestVarSet("lastpl", xsGetContextPlayer());</Command> <Command>xsSetContextPlayer(0);</Command> <Command>kbLookAtAllUnitsOnMap();</Command> <Command>if(%FromPlayer%!=99) trQuestVarSet("blarg",%FromPlayer%);</Command> <Command>if(%FromPlayer%==99) {</Command> <Command>trQuestVarSet("blarg",0);</Command> <Command>trQuestVarSet("vroom",12);</Command> <Command>}</Command> <Command>trQuestVarSet("i",trQuestVarGet("blarg"));</Command> <Command>while(trQuestVarGet("vroom")>=trQuestVarGet("i")) {</Command> <Command>trQuestVarSet("convarea", kbUnitQueryCreate("convarea"));</Command> <Command>kbUnitQuerySetPlayerID(trQuestVarGet("convarea"), trQuestVarGet("i"));</Command> <Command>kbUnitQuerySetUnitType(trQuestVarGet("convarea"), trQuestVarGet("zeep"));</Command> <Command>kbUnitQuerySetPosition(trQuestVarGet("convarea"), kbGetBlockPosition(""+1*%Object%));</Command> <Command>kbUnitQuerySetMaximumDistance(trQuestVarGet("convarea"), %Dst%);</Command> <Command>kbUnitQuerySetAscendingSort(trQuestVarGet("convarea"), true);</Command> <Command>kbUnitQueryResetResults(trQuestVarGet("convarea"));</Command> <Command>trQuestVarSet("warthog", kbUnitQueryExecute(trQuestVarGet("convarea")));</Command> <Command>while(trQuestVarGet("warthog")>0) {</Command> <Command>trQuestVarSet("warthog", trQuestVarGet("warthog")-1);</Command> <Command>trQuestVarSet("ffweho", kbUnitQueryGetResult(trQuestVarGet("convarea"), trQuestVarGet("warthog")));</Command> <Command>trQuestVarSet("ffweho2", trQuestVarGet("ffweho"));</Command> <Command>if(%Booler%==true) {</Command> <Command>if(trQuestVarGet("ffweho2")==kbGetBlockID(""+1*%Object%)) {trQuestVarSet("ffweho2", trQuestVarGet("ffweho")+1);}}</Command> <Command>if(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command> <Command>trMinimapFlare(%ForPlayer%, %Dur%, kbGetBlockPosition(""+1*trQuestVarGet("ffweho")), false);</Command> <Command>}}</Command> <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command> <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command> </Effect>
Let me know what exactly happens with this - it's the right approach but I may have forgotten something (it's been a while).
|
|
« Last Edit: June 16, 2008, 05:51:45 PM by pftq »
|
Logged
|
|
|
|
|
|
|
|
pftq
Administrator
Offline
Posts: 4202
|
|
« Reply #24 on: June 16, 2008, 09:13:58 PM » |
|
I see.. and the Damage Units in Area doesn't work right? Forgot about that. The code should be similar to the Flare. Except of course we start killing them instead of flaring their locations... <Effect name="Kill Units in Area (Center Unit)"> <Param name="Object" dispName="Center Unit" varType="unit">default</Param> <Param name="Dst" dispName="Radius" varType="string">10.0</Param> <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param> <Param name="FromPlayer" dispName="From Player or 99 for ALL" varType="string">99</Param> <Param name="Booler" dispName="Include Center Unit" varType="bool">false</Param> <Command>trQuestVarSet("convarea", 0);</Command> <Command>trQuestVarSet("ffweho",0);</Command> <Command>if(%FromPlayer%!=99) trQuestVarSet("vroom", %FromPlayer%);</Command> <Command>trQuestVarSet("warthog", 0);</Command> <Command>trQuestVarSet("zeep", 0);</Command> <Command>if(%UnitId%>=0) {</Command> <Command>trQuestVarSet("zeep", %UnitId%);</Command> <Command>}</Command> <Command>if(0>%UnitId%) {</Command> <Command>while(kbGetUnitTypeName(trQuestVarGet("zeep"))!="All") {</Command> <Command>trQuestVarSet("zeep", trQuestVarGet("zeep")+1);</Command> <Command>}}</Command> <Command>trQuestVarSet("lastpl", xsGetContextPlayer());</Command> <Command>xsSetContextPlayer(0);</Command> <Command>kbLookAtAllUnitsOnMap();</Command> <Command>if(%FromPlayer%!=99) trQuestVarSet("blarg",%FromPlayer%);</Command> <Command>if(%FromPlayer%==99) {</Command> <Command>trQuestVarSet("blarg",0);</Command> <Command>trQuestVarSet("vroom",12);</Command> <Command>}</Command> <Command>trQuestVarSet("i",trQuestVarGet("blarg"));</Command> <Command>while(trQuestVarGet("vroom")>=trQuestVarGet("i")) {</Command> <Command>trQuestVarSet("convarea", kbUnitQueryCreate("convarea"));</Command> <Command>kbUnitQuerySetPlayerID(trQuestVarGet("convarea"), trQuestVarGet("i"));</Command> <Command>kbUnitQuerySetUnitType(trQuestVarGet("convarea"), trQuestVarGet("zeep"));</Command> <Command>kbUnitQuerySetPosition(trQuestVarGet("convarea"), kbGetBlockPosition(""+1*%Object%));</Command> <Command>kbUnitQuerySetMaximumDistance(trQuestVarGet("convarea"), %Dst%);</Command> <Command>kbUnitQuerySetAscendingSort(trQuestVarGet("convarea"), true);</Command> <Command>kbUnitQueryResetResults(trQuestVarGet("convarea"));</Command> <Command>trQuestVarSet("warthog", kbUnitQueryExecute(trQuestVarGet("convarea")));</Command> <Command>while(trQuestVarGet("warthog")>0) {</Command> <Command>trQuestVarSet("warthog", trQuestVarGet("warthog")-1);</Command> <Command>trQuestVarSet("ffweho", kbUnitQueryGetResult(trQuestVarGet("convarea"), trQuestVarGet("warthog")));</Command> <Command>trQuestVarSet("ffweho2", trQuestVarGet("ffweho"));</Command> <Command>if(%Booler%==true) {</Command> <Command>if(trQuestVarGet("ffweho2")==kbGetBlockID(""+1*%Object%)) {trQuestVarSet("ffweho2", trQuestVarGet("ffweho")+1);}}</Command> <Command>if(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command> <Command>trUnitSelectClear();</Command> <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command> <Command>trUnitDelete(false);</Command> <Command>}}</Command> <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command> <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command> </Effect>
|
|
|
Logged
|
|
|
|
|
Random22
Member
Offline
Posts: 33
|
|
« Reply #26 on: June 16, 2008, 10:04:33 PM » |
|
Dear pftq, Ok, I modded your triggers and this is what I got. <Effect name="Make Units in Area Invulnerable (Center Unit)"> <Param name="Object" dispName="Center Unit" varType="unit">default</Param> <Param name="Dst" dispName="Radius" varType="string">10.0</Param> <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param> <Param name="FromPlayer" dispName="From Player or 99 for ALL" varType="string">99</Param> <Param name="Booler" dispName="Include Center Unit" varType="bool">false</Param> <Param name="Enable" dispName="Enable?" varType="bool">true</Param> <Command>trQuestVarSet("convarea", 0);</Command> <Command>trQuestVarSet("ffweho",0);</Command> <Command>if(%FromPlayer%!=99) trQuestVarSet("vroom", %FromPlayer%);</Command> <Command>trQuestVarSet("warthog", 0);</Command> <Command>trQuestVarSet("zeep", 0);</Command> <Command>if(%UnitId%>=0) {</Command> <Command>trQuestVarSet("zeep", %UnitId%);</Command> <Command>}</Command> <Command>if(0>%UnitId%) {</Command> <Command>while(kbGetUnitTypeName(trQuestVarGet("zeep"))!="All") {</Command> <Command>trQuestVarSet("zeep", trQuestVarGet("zeep")+1);</Command> <Command>}}</Command> <Command>trQuestVarSet("lastpl", xsGetContextPlayer());</Command> <Command>xsSetContextPlayer(0);</Command> <Command>kbLookAtAllUnitsOnMap();</Command> <Command>if(%FromPlayer%!=99) trQuestVarSet("blarg",%FromPlayer%);</Command> <Command>if(%FromPlayer%==99) {</Command> <Command>trQuestVarSet("blarg",0);</Command> <Command>trQuestVarSet("vroom",12);</Command> <Command>}</Command> <Command>trQuestVarSet("i",trQuestVarGet("blarg"));</Command> <Command>while(trQuestVarGet("vroom")>=trQuestVarGet("i")) {</Command> <Command>trQuestVarSet("convarea", kbUnitQueryCreate("convarea"));</Command> <Command>kbUnitQuerySetPlayerID(trQuestVarGet("convarea"), trQuestVarGet("i"));</Command> <Command>kbUnitQuerySetUnitType(trQuestVarGet("convarea"), trQuestVarGet("zeep"));</Command> <Command>kbUnitQuerySetPosition(trQuestVarGet("convarea"), kbGetBlockPosition(""+1*%Object%));</Command> <Command>kbUnitQuerySetMaximumDistance(trQuestVarGet("convarea"), %Dst%);</Command> <Command>kbUnitQuerySetAscendingSort(trQuestVarGet("convarea"), true);</Command> <Command>kbUnitQueryResetResults(trQuestVarGet("convarea"));</Command> <Command>trQuestVarSet("warthog", kbUnitQueryExecute(trQuestVarGet("convarea")));</Command> <Command>while(trQuestVarGet("warthog")>0) {</Command> <Command>trQuestVarSet("warthog", trQuestVarGet("warthog")-1);</Command> <Command>trQuestVarSet("ffweho", kbUnitQueryGetResult(trQuestVarGet("convarea"), trQuestVarGet("warthog")));</Command> <Command>trQuestVarSet("ffweho2", trQuestVarGet("ffweho"));</Command> <Command>if(%Booler%==true) {</Command> <Command>if(trQuestVarGet("ffweho2")==kbGetBlockID(""+1*%Object%)) {trQuestVarSet("ffweho2", trQuestVarGet("ffweho")+1);}}</Command> <Command>if(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command> <Command>trUnitSelectClear();</Command> <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command> <Command>trUnitMakeInvulnerable(%Enable%);</Command> <Command>}}</Command> <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command> <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command> </Effect>
|
|
|
Logged
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thats Right More Random22 Signature
|
|
|
|
|
|