Enemies run from Buildings? (was: I fail)

SomaZ

New Member
Reaction score
3
Another "bug" in programming or w/e.

Ok, so in my AoS map I am using Neutral Victim and Neutral Extra as creeps. They don't attack buildings without damaging capabilities and just pass by them.

So with a trigger I cause the building to damage units dealing 0 damage and OMG! They started attacking the building. But now the bug happens -_-

When they are low on hp (red) they start to run away from the building once it damages them. So wtf? I mean I wouldn't mind if Neutral Victim/Extra did NOTHING at all, but Blizzard just HAS to add some stupid features that are obviosly not needed.

I don't want units to retreat when they have red hp and attack buildings -_-

So far setting Can Flee = False and disabling guard possition didn't help.

Forcing units to attack the building? Is there another way?
 

Vestras

Retired
Reaction score
248
Yeah, Blizzard fails. We all know that.
Now, this can be avoided by making the structures or buildings or whatever that damages creeps normal units with structure pathing and no movement.
 

Flare

Stops copies me!
Reaction score
662
Hmmm, could we try and keep the thread on-topic please? Original poster didn't ask for opinions on how sucky/otherwise Blizzard are, or the 'rules' of making an AoS

Now, this can be avoided by making the structures or buildings or whatever that damages creeps normal units with structure pathing and no movement.
On top of that, if you have any knockback spells, ensure that your 'structures' have some sort of immunity (e.g. only knocking back units with Default Movement Speed > 0) - otherwise, you could have some very weird results (I believe one of your maps suffered from that Vestras, was quite an amusing game being unable to target towers :p)
 

Vestras

Retired
Reaction score
248
Yeah, Flare, an old map of mine. This can be avoided by giving all structures the 'Ancient' classification instead of Mechanical or whatever they got and then do one of the following things:

1) Call this script on map init: and just check if the unit is a structure as normal, or

2) Check if the unit is an ancient everytime you cast a spell. I'd prefer #1.
 

Romek

Super Moderator
Reaction score
963
> Call this script on map init:
Is that even possible? UNIT_TYPE_... are all constant.

And wouldn't that have some unwanted side effects? o_O
 

SomaZ

New Member
Reaction score
3
So I only need to do this:
Code:
set UNIT_TYPE_STRUCTURE = UNIT_TYPE_ANCIENT
and it'll work?

Btw I use a lot of structure conditions in my triggers, so this would be the best variant for me (and I don't use ancients ^^ yay).
 

Vestras

Retired
Reaction score
248
Try. If it gives bugs, you'll have to either edit the common.j file to make the unittype variable non-constant or do 2).
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
it's a constant... that won't work. Also, why can't you just do IsUnitType(UNIT_TYPE_ANCIENT) ?
 

SkyXyden

New Member
Reaction score
3
That opinion is harsh though.. we should be grateful to blizzard for the making of world editor, else this web wouldn't even exist and I wouldn't be a map maker.
 

Sooda

Diversity enchants
Reaction score
318
To my knowledge you can't specify unit pathing, we got tutorial how to create custom pathing maps, I have succeeded doing it in the Gimp if you need help making custom pathing map I could help or even create the Gimp tutorial.
 

SomaZ

New Member
Reaction score
3
Lol at the topic change xD

Omg Blizzard made WE? Eritic! That's not true!
Making something is great, but making something unneeded is NOT.

And constants are SET at some point (maybe it can work at map init).

Are you sure ancients don't cause neutrals to go back?

Edit: I can't test it out right now. Anyway, don't change the topic please. The problem IS that units with red hp go back, not that I want to make buildings ancients or something.

If someone has some more suggestions I would be happy to hear them out.
 

UndeadDragon

Super Moderator
Reaction score
448
To my knowledge you can't specify unit pathing, we got tutorial how to create custom pathing maps, I have succeeded doing it in the Gimp if you need help making custom pathing map I could help or even create the Gimp tutorial.

The tutorial is here.
 

Flare

Stops copies me!
Reaction score
662
only knocking back units with Default Movement Speed > 0
Assuming you have knockbacks, that condition should work - if I recall, any units (if you go by Vestras' suggestion and make your structures into normal units) with 0 movement speed don't respond well to knockbacks/fly height changes, so anything that knocks units back, or changes their height, should be subject to the condition in the quote above - any units who pass the condition should be safe, otherwise bad sh*t can happen (to the point where the unit and it's model are like separate entities, and clicking the model won't select the unit :p Vestras knows all too well about that ^_^)
 

Curo

Why am I still playing this game...?
Reaction score
109
The problem IS that units with red hp go back, not that I want to make buildings ancients or something.

That was suggested because they think that changing the buildings into units will not force the creeps to run. They are telling you to classify all the buildings as ancients, and reference ancient instead of building in any triggers or abilities that may or shouldn't affect buildings. Flare/Vestras gave the example of a knockback. You only want knockbacks to affect units, but if you make all your buildings units, they can get knocked back too, which is why you would make all building-units ancients, and have the requirement for the knockback be that the target unit is not an ancient.
 

SomaZ

New Member
Reaction score
3
I know that, but in anyway I will prevent it ofc. Making them units is a possibility, but...
 

Curo

Why am I still playing this game...?
Reaction score
109
Well I'll ask the incredibly obvious question: why are you using neutral extra and victim instead of neutral hostile or a player? I am guessing the answer is that they are all used already?
 

Vestras

Retired
Reaction score
248
If it didn't work I wouldn't tell you.
To create 6v6 teams, just use this script (By me)
JASS:
library SVSSSys

globals
    private constant string SYSTEMCOLOR="|cffff0000" // The color of the system message. Flower power!
    private constant integer NORM_PLAYER1=0 // The player who owns the units at map init (GRP1)
    private constant integer NORM_PLAYER2=6 // The player who owns the units at map init (GRP2)
    private constant integer PLAYER1=bj_PLAYER_NEUTRAL_EXTRA // The player who is going to be the owner for GRP1
    private constant integer PLAYER2=bj_PLAYER_NEUTRAL_VICTIM // The player who is going to be the owner for GRP2
    private constant boolean CHANGECOLOR=true // The units will have the PLAYERX's playercolor too if CHANGECOLOR is false
    private constant playercolor PLAYER1COLOR=PLAYER_COLOR_RED // The color the units of the PLAYER1 will have
    private constant playercolor PLAYER2COLOR=PLAYER_COLOR_GREEN // The color the units of the PLAYER2 will have
    // Necessary globals
    private force GRP1=CreateForce()
    private force GRP2=CreateForce()
    private group g=CreateGroup()
endglobals

private function SetAlliance takes player one, player two, boolean flag returns nothing
    call SetPlayerAlliance(one, two, ALLIANCE_PASSIVE,       flag)
    call SetPlayerAlliance(one, two, ALLIANCE_HELP_REQUEST,  flag)
    call SetPlayerAlliance(one, two, ALLIANCE_HELP_RESPONSE, flag)
    call SetPlayerAlliance(one, two, ALLIANCE_SHARED_XP,     flag)
    call SetPlayerAlliance(one, two, ALLIANCE_SHARED_SPELLS, flag)
    call SetPlayerAlliance(one, two, ALLIANCE_SHARED_VISION, flag)
endfunction

function AddToForce takes player p, integer f returns nothing
    if f==1 then
        call ForceAddPlayer(GRP1,p)
        if CountPlayersInForceBJ(GRP1)>6 then
            call BJDebugMsg(SYSTEMCOLOR+"6VS6 System:|r there is more than 6 players in one force!")
        endif
    elseif f==2 then
        call ForceAddPlayer(GRP2,p)
        if CountPlayersInForceBJ(GRP2)>6 then
            call BJDebugMsg(SYSTEMCOLOR+"6VS6 System:|r there is more than 6 players in one force!")
        endif
    endif
endfunction

private function AllyForce1_Callback takes nothing returns nothing
    // From dummy player to GetEnumPlayer()
    call SetAlliance(Player(PLAYER1),GetEnumPlayer(),true)
    // From GetEnumPlayer() to dummy player
    call SetAlliance(GetEnumPlayer(),Player(PLAYER1),true)
endfunction

private function AllyForce2_Callback takes nothing returns nothing
    // From dummy player to GetEnumPlayer()
    call SetAlliance(Player(PLAYER2),GetEnumPlayer(),true)
    // From GetEnumPlayer() to dummy player
    call SetAlliance(GetEnumPlayer(),Player(PLAYER2),true)
endfunction

private function EnemyForce_Callback takes nothing returns nothing
    // From Player() - Player() to GetEnumPlayer()
    call SetAlliance(Player(6), GetEnumPlayer(),       false)
    call SetAlliance(Player(7), GetEnumPlayer(),       false)
    call SetAlliance(Player(8), GetEnumPlayer(),       false)
    call SetAlliance(Player(9), GetEnumPlayer(),       false)
    call SetAlliance(Player(10), GetEnumPlayer(),      false)
    call SetAlliance(Player(11), GetEnumPlayer(),      false)
    // From GetEnumPlayer() to Player() - Player()
    call SetAlliance(GetEnumPlayer(), Player(6),       false)
    call SetAlliance(GetEnumPlayer(), Player(7),       false)
    call SetAlliance(GetEnumPlayer(), Player(8),       false)
    call SetAlliance(GetEnumPlayer(), Player(9),       false)
    call SetAlliance(GetEnumPlayer(), Player(10),      false)
    call SetAlliance(GetEnumPlayer(), Player(11),      false)
endfunction

private function ConvertTo1 takes nothing returns boolean
    if GetOwningPlayer(GetFilterUnit())==Player(NORM_PLAYER1) then
        call SetUnitOwner(GetFilterUnit(),Player(PLAYER1),CHANGECOLOR)
    endif
    return false
endfunction

private function ConvertTo2 takes nothing returns boolean
    if GetOwningPlayer(GetFilterUnit())==Player(NORM_PLAYER2) then
        call SetUnitOwner(GetFilterUnit(),Player(PLAYER2),CHANGECOLOR)
    endif
    return false
endfunction

function Start takes nothing returns nothing
    call ForForce(GRP1,function AllyForce1_Callback)
    call ForForce(GRP2,function AllyForce2_Callback)
    call ForForce(GRP1,function EnemyForce_Callback)
    call SetPlayerColor(Player(PLAYER1),PLAYER1COLOR)
    call SetPlayerColor(Player(PLAYER2),PLAYER2COLOR)
    call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,Filter(function ConvertTo1))
    call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,Filter(function ConvertTo2))
endfunction

endlibrary
 

SomaZ

New Member
Reaction score
3
Setting a constant causes an error ^^

And yes - I use other Neutrals for something else.

As for the script, could you tell me what EXACTLY does it do?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top