Stunner health - enforced cap

Started by GoodMorning, May 07, 2017, 07:02:41 PM

Previous topic - Next topic

GoodMorning

It seems that Stunners have an enforced maximum health of 1 after a certain point in their initialisation process.

To test, I tried scripting to create a Stunner with 20 health. The trace reported that it did, indeed, have 20 health - for two frames. Then it was clipped to 1, despite any attempt to reset it higher.

Is this for graphical reasons, would I need to I create a rider Core to give it a progressive health injection, and does stunner health affect stun time?

While I'm here, is there yet some means to target a Stunner by script?
A narrative is a lightly-marked path to another reality.

Eiyatizu

A Stunner is a Unit right? I have pasted part of my code below.

    CurrentCoords <-range_2 0 GetAllUnitsInRange ->Units
    <-Units GetListCount 0 do
        <-Units[I] ->unit
        <-unit GetUnitIsEnemy if
            <-unit @CheckUnit 0 gt if
                <-unit GetUnitCoordX <-unit GetUnitCoordY <-x <-y PixelToCell Distance <-minDist lte if
                    <-unit ->target
                    <-unit GetUnitCoordX <-unit GetUnitCoordY <-x <-y PixelToCell Distance ->minDist
                    3 ->mode
                endif
            endif
        endif
    loop


:CheckUnit
    GetUnitType ->type
        0 ->value
        <-type "Emitter" eq if
            0.001 ->value
        endif
        <-type "Emitter(Clone)" eq if
            0.001 ->value
        endif
        <-type "MireSpawner" eq if
            0.001 ->value
        endif
        <-type "DoppelSpawner" eq if
            0.001 ->value
        endif
        <-type "ShipSpawner" eq if
            0.001 ->value
        endif
        <-type "StunnerSpawner" eq if
            0.001 ->value
        endif
        <-type "PhalanxGun" eq if
            0.001 ->value
        endif
        <-type "PhalanxGun(Clone)" eq if
            0.001 ->value
        endif
        <-type "Stunner" eq if
            0.01  ->value
        endif
        <-type "Stunner(Clone)" eq if
            0.01  ->value
        endif
        <-type "Doppel" eq if
            0.01  ->value
        endif
        <-type "Doppel(Clone)" eq if
            0.01  ->value
        endif
        <-type "Omni" eq if
            0.01  ->value
        endif
        <-type "EnergyMine" eq if
            0.01  ->value
        endif
        <-type "EnergyMine(Clone)" eq if
            0.01  ->value
        endif
        <-type "Fighter" eq if
            0.01  ->value
        endif
        <-type "Fighter(Clone)" eq if
            0.01  ->value
        endif
        <-value

GoodMorning

Thank you for the script cutting, and welcome to the forum.

However, what I seek is not "X targets Stunner" but "Stunner targets X". This allows, say, only ships which venture into a certain range to be targeted. Currently, the best solution I know of would involve creating many Stunners and deleting those which are not correctly targeted - an efficiency nightmare.
A narrative is a lightly-marked path to another reality.

Eiyatizu

#3
But can you not get all the ships within a certain range using the GetAllShipsInRange, and then generate a Stunner just to target that. Or may be force the position of the Stunner by setting its position, means something to remember the Stunner and move it manually every frame.

GoodMorning

The issue I have (and the request I made) involved setting the target unit of the Stunner. Creating Stunners with CreateUnit is all very well, but their target is randomly selected by backend logic and cannot be accessed by PRPL. This means that a ship cannot be Stunned easily

Further, a Stunner can pass over one ship if it has targeted another, making the method of manual positioning ineffective.

The workaround would be to generate Stunners until one targets the correct ship, and then delete all of the others. This is a ludicrously inefficient method, and may still fail. Hence, I have requested the logical solution from V.

Good thoughts, but there is a method to this madness.

(Creating false "Stunners" through PRPL would also be almost possible, but there is no way to have them targeted by Dischargers, and the graphical effects which a Stunned ship undergoes are foolishly complex to recreate in PRPL properly, even leaving aside the packet requesting and jitter in positional resetting)
A narrative is a lightly-marked path to another reality.

Eiyatizu

I see. So I guess there is no way to find out either the particular function or actual field parameters of the Stunner object.

Nicant

When i was making my OverCharger module, i had the same problem when it came to setting the target for a stunner. Even making an enemy stunner friendly, it will still target it's original target. To fix this, i deleted the original stunner that the module targeted and made a new friendly one. I will still look into this though.
CW4 hype!!

tornado

Creating a facsimile of a stunner would work. as for targeting, I think someone mentioned how to get it shot at by dischargers. actually stunning the ship? presuming a stunner takes the closest untaken target in range(Therefore suggesting you only need to create as many stunners as there are friendly ships on the map) then spawning one on the ships bridge module would hvae it instantly hit the ship, No? I might me wrong, you might have tested this, but is it not a possibility? I'm also working with stunners, so ill get back to you if I find anything interesting(Like how Blue stunners have Red glow effects).
Now CEO of Particular Endeavors. http://knucklecracker.com/forums/index.php?topic=23752.new#new
We apologize for all inconveniences that we caused.
Quotefirst, you have to imagine a very big box, fitting inside a very samll box.
then, you have to build one

GoodMorning

To have it shot at would currently require a real Stunner under the fake one, and actual Stunning is still a problem. Targets are randomly selected, and the same ship/mine can be multi-targeted. So any attempt at this solution would be probabilistic from the scripters point of view.

The glow effect is likely V reusing code, as the glow colour makes little to no difference to gameplay, similar to amp gem glow.
A narrative is a lightly-marked path to another reality.