Stealth Units

Started by milkev, May 23, 2016, 04:36:17 PM

Previous topic - Next topic

milkev

Is there a way to make a enemy unit invisible? my map wont end (im pretty sure) without and inhibitor, since its all crpl cores. i dont want the inhibitor to do anything, and i dont want it to be seen.

J

The easiest option is to create a crpl core that imitates an inhibitor, which only doesn't work for the anti-AoO field. If that field is what you need, try to change some unit attributes for the inhibitor (though I'm afraid changing visibility won't work for non-crpl units).

You could also try to cover the inhibitor by a terrain texture on a CRPL core. Might have some side-effects.

Grayzzur

Do you need a stealth unit? Or is your problem that you can't make the map end because of all the crpl cores, even when the target objective is reached?

If that's the cause you might have a core who's destruction isn't required with "Counts for Victory" enabled. You can uncheck this in the properties box in the editor, or in code use SetUnitAttribute to set CONST_COUNTSFORVICTORY to false.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Builder17

Some extra information , plz?  ???

GoodMorning

If you need an Inhibitor, then you can place one when the Core count drops far enough, and immediately blow it up. However, there are easier ways.

For example:

CurrentCoords 9999 GetEnemyUnitsInRange 0 do 0 Destroy loop

...will find all Emitters, Spore Towers, AE Towers, Runner Nests, Inhibitors, and CRPL Cores; then destroy them all without sound or graphics.

CONST_COUNTSFORVICTORY has been mentioned, as have images. These are good for Cores which haven't come into use yet, or are not going to for a while, or that you don't want people to have to destroy.

It really depends on what you are trying to do.
A narrative is a lightly-marked path to another reality.

milkev

Quote from: Builder17 on May 24, 2016, 07:20:24 AM
Some extra information , plz?  ???

actually, i think its your creeper unit spawner (idk the name) that creates units that move around. i put the enviorment in the core, but the core cant be destroyed even if i set it to be.
PS: sry if person is wrong

GoodMorning

It is possible that the attached script modifies the Core CONST_NULLIFIERDAMAGES, CONST_SNIPERTARGET, and/or CONST_BEAMTARGET variables. Therefore, changing the Core settings in the editor may be ineffective.

To fix this, there are two options: 1. Put up the bugged map, and hope someone can be bothered helping. 2. Trace the CONSTs mentioned here. This should allow you to fix the problem yourself, and learn as you do.

CONST_COUNTSFORVICTORY is your friend, but if you can attach the script, it would be useful to we who are trying to help.
A narrative is a lightly-marked path to another reality.

milkev

i set up a crpl so that when i destroy it, it destroys all enemies on the map (it destroys all visible crpl cores that are targetable by nullifiers) but even though this happens it doesnt finish the map. i have those converters, orbital stuff on map. do these need to be collected? its never made a difference before

GoodMorning

I'm not sure what you mean by converters (Conversion AoOs?), but the non-CRPL victory conditions are: No enemies that drop PZs left, no techs/shield keys/message artifacts uncollected. Runners and Spores are OK, as is Digi. AoOs can be left, and won't affect the map.

CRPL Cores:
By default, a CRPL Core is assumed to be like an Emitter that does something other than make Creeper.
It is Nullifiable, PZ-dropping, required for victory, not destroyed by Snipers, Beams, Digi, Thor, or AC. It will not seed Digi, but it will support it.

Any of these attributes can be changed by editor or CRPL.

Usually, mapmakers seem to change it by CRPL, because they do not then have to navigate the editor interface every time they wish to build a Core with a certain script. As a side effect, if someone else later attaches the script, but sets Core attributes at the same time, then the script will overwrite the attributes when it runs for the first time (the next frame).

What code did you use for your CRPL "And Then You Win"?

This is the example from the wiki page for DestroyAllEnemyUnits, for an instant win:

# Destroy any uncollected tech artifacts.
GetAllUnitsInRange(0 0 9999 1) 0 do
->unit
if(GetUnitType(<-unit) "TECHARTIFACT" eq) Destroy(<-unit 0) endif
loop
DestroyAllEnemyUnits(0)

I don't know how this will react to Message Artifacts or Shield Keys, but the wiki implied that it would work on CRPL Cores.
A narrative is a lightly-marked path to another reality.

milkev

#9
Yah, thats the code that i used, ill try collecting the messages (i deleted that part, like the genious i am)

PS: ITS WORKING, THANKS