is it possible to unally yourself?

Red_drake

New Member
Reaction score
4
or is there a way for your own units to treat eachother as enemies, or be able to auto attack eachother?

(background)
a swam of units needs a 'controler' type unit around them (control is represented by mana atm), and when control(mana) reaches 0, they go 'feral' and attack everything (including their allies).
it would be easy to put them on some neutral hostile team, but then 'feral' units wouldnt attack eachother.

is there a way to do this so that a single unit is allied to no player/computer?
 

DioD

New Member
Reaction score
57
all units or none, such options is player based.

call SetPlayerAlliance(Player(0), Player(0), ALLIANCE_X, false)
 

Bogrim

y hello thar
Reaction score
154
The only way to make units attack friendly units is to order them to do so. The AI behavior will never do it. Use a periodic trigger to pick all units of the type that lacks the debuff and order them to attack a nearby random unit. Use a second trigger which detects when the player tries to issue an order to the unit and override that order in the trigger (be sure to turn off the trigger every time you issue an order through triggers to avoid creating an infinite loop).
 

Red_drake

New Member
Reaction score
4
well, thats lame and seems overly complicated : (

will DioD's solution even work?

if not, i guess ill have to trigger it all
 

Ashlebede

New Member
Reaction score
43
You'd have to trigger it all, for you can only ally/unally players, indeed. You can unally yourself, though. It will take away the control from your own units, that's pretty much all it'll do.
 

DioD

New Member
Reaction score
57
control and ally mode if different attributes.

you can unally self, soo your units will attack each other BUT keep vision and control over them.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
you can unally self, soo your units will attack each other BUT keep vision and control over them.
I've tried, but can't get my own units to attack each other automatically. Can you please post a demo map where it works?
 

DioD

New Member
Reaction score
57
call SetPlayerAlliance(Player(0), Player(0), ALLIANCE_PASSIVE, false)

this is demo map, have fun and read post 2.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
I don't see a map, but I was able to get it to work. :) Neat!

As it turns out, my problem was trying to do it in GUI, not realizing that
Trigger:
  • Player - For Player 1 (Red), turn Alliance (non-aggression) Off toward Player 1 (Red)
would not work because that GUI action calls [ljass]SetPlayerAllianceBJ[/ljass], which prevents alliance changes toward the same player. Using your line as a custom script worked.
 

Red_drake

New Member
Reaction score
4
so i can just do what DioD said and ully myself in jass and itll work?

awesome! thanks :D

now, the fun part.

if im using neutral passive and neutral hostile players, what computer team should i give these 'feral' units to?
also, playesr 0-11 are used as well, 13 is my neutral passive player, and neutral hostile units are placed using the 'neutral hostile' player when placing units directly in the editor.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Well, any of the unused Neutral players would work OK. Just set them to be enemies with every other player first.

Also, you'll need a way to remember which player used to own the units in order to restore control.
 

Red_drake

New Member
Reaction score
4
that shouldnt be a problem.

also: players 0-11 are taken, player 13 is taken, is player 12 the "neutral hostile" player? or is that another player entirely?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Player(12) is Neutral Hostile, you're using 13 (Neutral Victim), but there's also 14 (Neutral Extra) and 15 (Neutral Passive).
 

DioD

New Member
Reaction score
57
dont use neutral hostile for any applications, it have hardcoded AI and hardcoded minimap display.

also do not ally youself with any neutrals, it will glich vision (you will see projectiles over fog of war and other problems)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top