HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Making units uncontrolled by player.

03-13-2006, 06:29 PM#1
muffinmasher
I was wondering if it is possible for a unit to be on a units team or under his "Control" but actually under control of a script, because whenever I set the trigger attack-move to (Location) they can still be targeted and ordered otherwise. I cannot create creep teams, so they need to be on the owner's team and need to be controlled by a script. Thanks in Advance!
-MuffinMasher
03-13-2006, 06:46 PM#2
Captain Griffen
Not really possible, but if you give us some more info on the map, we might be able to give you some help on a work around.
03-13-2006, 06:51 PM#3
muffinmasher
It's an 8 person FFA AoS/Arena where the bases are in a circle, and each team's creeps attack one other person on either side of their base, after one team is defeated the creeps will move onto the next base.
03-13-2006, 07:05 PM#4
Captain Griffen
How many units will you control? Just one? If so, then:

Trigger:
Disable Selection
Collapse Events
Map initialization
Conditions
Collapse Actions
Game - Disable selection and deselection functionality (Enable selection circles)
Selection - Select Footman 0000 <gen> for Player 1 (Red)

If you have a shop area, then you'll have to have selection triggers for that too (so when you enter the area, you select the shop, and then when they do something like press escape (skip cinematic), give them back selection of their hero).
03-13-2006, 07:07 PM#5
muffinmasher
It will be for groups of 3 units attacking either side of every base, is there a way to just make it so where a controlling player cannot give orders to a unit, and so that it will only follow the script?
Edit: Sometimes the player will be in control of multiple units, I only don't want the creeps (like in dota) to be able to be given orders.
Thanks again!
-MuffinMasher
03-13-2006, 07:15 PM#6
Captain Griffen
You could just have:

Trigger:
Disable Selection
Collapse Events
Player - Player 1 (Red) Selects a unit
Collapse Conditions
((Triggering unit) is in (Units in (Playable map area))) Equal to True
Collapse Actions
Selection - Remove (Triggering unit) from selection

And:

Trigger:
Reissue Order
Collapse Events
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order with no target
Collapse Conditions
((Triggering unit) is in (Units in (Playable map area))) Equal to True
Collapse Actions
Selection - Remove (Triggering unit) from selection
Unit - Order (Triggering unit) to Attack-Move To (Center of (Playable map area))
03-13-2006, 10:16 PM#7
Guest
Thank you, this should work well =)
03-16-2006, 02:16 AM#8
moyack
I will prove those triggers, they could be powerful to save player slots in a AoS style game.
03-16-2006, 06:33 AM#9
Moss
Ya, I have set up a system closer to that "reissue order" trigger on a map I am making because I demand to be able to do 6v6! When a unit is issued an order it is deselected and re-ordered to go to it's destination, which can change many times so the destination variable is attached to the unit. Mind you, the way Griffen has set it up it will crash Wacraft because it is causing an infinite loop. I have all the "NPC" units in a special unit group and the trigger has a condition to make sure the unit being considered is in that unit group. Then before the trigger re-orders the unit it is temporarily removed from the group. It is working quite nicely for me, the units don't even flinch when you tell them to do something else.

There will very likely be complications with other features on your map which will have to be dealt with if you use that method though. For example, I discovered that when units are War Stomped they are issued an order with no name but with the ID "851973", so I had to make the trigger ignore that order. Other spells also would tamper with the system, like Taunt.
03-16-2006, 11:51 AM#10
Captain Griffen
You're right on the infinite loop. You'd have to turn off the second trigger before you issue the order, then turn it back on again.

For a 6v6, this sytem isn't needed. A lot simpler just to give them to two of the neutral players (I don't think neutral hostile is a good one for it, though), and set them up. Works fine (for example, this is used in ToB).
03-16-2006, 02:34 PM#11
paidan_fain
Couldn't you just give the unit's ward classification? That would make their command card disappear to the user.
03-16-2006, 09:10 PM#12
Moss
I will have to test this ward thing. Isn't there any side effects? At the least it would effect spells that effect wards.

Captain Griffen, what are you saying about neutral players? Do you mean like Neutral Victim and Neutral Extra? I wonder what those guys are for.

EDIT: Ward removes the buttons from the command cart but you can still order the unit around, so that is no use.
04-11-2006, 12:20 AM#13
RodOfNOD
How we all reinvent the wheel time and again......

Ward is great in that it prevents a user from having any commands on the card and in this it is QUITE handy, however SMART will still work as an order.

ie you can select the warded unit and still click and have it move attack, to solve this you could do what has been suggested OR.....

intercept the issued orders and then using game cache assign a boolean to that unit to true.. then issue the order.... then turn off the game cache variable ie set it false...

THEN have the above trigger test that variable and if its TRUE ignore the order.

So far in my tests works perfect and doesnt require you to deselect the unit cuz after all WHY not let them select it.

It might look like this:

Collapse JASS:
function H2I takes handle h returns integer
  return h
  return 0
endfunction

function SetVarBool takes string s, unit u, boolean b returns nothing
  call StoreBoolean( udg_GC, s, I2S( H2I( u)), b)
endfunction

function GetVarBool takes string s, unit u returns boolean
  return GetStoredBoolean( udg_GC, s, I2S( H2I( u)))
endfunction

then a call might look like this:

Collapse JASS:
call SetVarBool( "ignoreflag", u, true)

where u = unit that was ordered, and udg_GC = your cache var


GL HF

Edited by Blade.dk. Reason: Better use jass tags.
04-11-2006, 12:37 AM#14
Immoralis
Quote:
Originally Posted by Captain Griffen
You could just have:

Trigger:
Disable Selection
Collapse Events
Player - Player 1 (Red) Selects a unit
Collapse Conditions
((Triggering unit) is in (Units in (Playable map area))) Equal to True
Collapse Actions
Selection - Remove (Triggering unit) from selection

And:

Trigger:
Reissue Order
Collapse Events
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order with no target
Collapse Conditions
((Triggering unit) is in (Units in (Playable map area))) Equal to True
Collapse Actions
Selection - Remove (Triggering unit) from selection
Unit - Order (Triggering unit) to Attack-Move To (Center of (Playable map area))

this doesnt work, theres delay when that accually triggers, so you can hotkey the unit quick and then use hotkeys to make it do stuff
04-11-2006, 05:09 AM#15
RodOfNOD
Quote:
Originally Posted by Immoralis
this doesnt work, theres delay when that accually triggers, so you can hotkey the unit quick and then use hotkeys to make it do stuff

Did you read what i posted? Use ward then they cant hotkey not that it would matter. If you NEED me to I will post a demo map...