Is there a script to cause units to not drop power zones?

Started by Courtesy, June 16, 2014, 02:57:20 PM

Previous topic - Next topic

Annonymus

Ok, I admit that my solution is more ressource-heavy than the others but havingg another core sitting on every emitter adds another problem: the counter on the nullifier will double (when nullifying 1 emitter it will show 2 targets...) of course J's solution is the best , I was only giving alternatives.
If a topic started by me is in the wrong place feel free to move it at anytime.

kwinse

Yeah that was my first thought while making it, but the targets counter seems to count all nullifiable units on the same coordinates as 1.

4xC

You know, a little while ago, I was playing one of planetfall's maps and when I destroyed an AET in it, it was the only structure that (to the best of my notice/memory) did not leave a PZ behind. The map was called "Ptechnological Pterror".

As far as Nullifier activity, my understanding is they nullify every enemy core within its effective range and the counter ideally includes every enemy core whether the enemy cores are on the same coordinate or not.
C,C,C,C

Courtesy

Ok, so what if I wanted to take Kwinses code and make the core not only destroy the power zone, but put a different item there instead?
I'm working on a map where such a thing could be a great boon.

warren

Kwinse's script has two problems. The first is minor, _ _ _ TRUE GetAllUnitsInRange is the efficient one, not _ _ _ FALSE GetAllUnitsInRange.
The second is it should not take map space.

:awake
Self "main" "NONE" SetImage
Self CONST_CREATEPZ FALSE SetUnitAttribute
Self CONST_COUNTSFORVICTORY FALSE SetUnitAttribute
Self CONST_TAKEMAPSPACE FALSE SetUnitAttribute

:destroyed
CurrentCoords 0 TRUE GetAllUnitsInRange
0 do
->u
<-u GetUnitType "POWERZONE" eq if
<-u 0 Destroy
endif
loop

"RESOURCEPACK" CurrentCoords CreateUnit ->u
<-u 0 "RESOURCETYPE" "AETHER" SetScriptVar
<-u 0 "AMT" 50 SetScriptVar

kwinse

Neat, though I wouldn't call that inefficiency a problem unless your map has a bunch of no-pzed units being destroyed every frame...

Also taking map space only really matters in maps where units can be destroyed by something other than direct nullification (inhibitor maps, for example).

Also I prefer my nick in lowercase, formal English capitialization rules be darned. >_>

warren

It is important to note that 1) emitters are 1x1 structures, as well as spore towers. Even though they do not look like it and the default core is 3x3. and 2) You are also supposed to capitalize the first word in a sentence, other rules be darned.

kwinse