HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"Freezing" a Unit

05-14-2010, 08:54 PM#1
Hydrolisk
Presently, I am trying to build a Warchasers-inspired map. My problem lies in selecting the Hero

What I have in mind is that a neutrally-aligned Player 9 shares control with the human players, which allows the human players to select Player 9's units. I do this to allow the human players to "preview" the hero units that they are allowed to select (like Rising Dusk's Desert of Exile).

I have shared control (not full) and vision for Player 9 with the human players.
However, I do not know how to prevent the preview hero units from being ordered by the human player.

This is what I have tried so far (both are currently implemented):
Trigger:
Untitled Trigger 001
Collapse Events
Unit - A unit owned by Player 9 (Gray) Is issued an order targeting an object
Unit - A unit owned by Player 9 (Gray) Is issued an order targeting a point
Unit - A unit owned by Player 9 (Gray) Is issued an order with no target
Collapse Conditions
((Ordered unit) is A Hero) Equal to True
(Issued order) Not equal to (Order(stop))
Collapse Actions
Unit - Order (Ordered unit) to Stop
Trigger:
Initialization
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 8, do (Actions)
Collapse Loop - Actions
Player - Make Player 9 (Gray) treat (Player((Integer A))) as an Ally with shared vision and shared units
Set ug_sleep = (Units owned by Player 9 (Gray) matching (((Matching unit) is A Hero) Equal to True))
Collapse Unit Group - Pick every unit in ug_sleep and do (Actions)
Collapse Loop - Actions
Custom script: call IssueImmediateOrder(GetEnumUnit(), "stunned")
Custom script: call DestroyGroup(udg_ug_sleep)

In-game, the hero preview units are not frozen/stunned by the first trigger. Not only that, but I can order around the preview units without difficulty (as a human player).

Is there anything that I can do, with or without triggers to make the Hero selection system work properly?
05-14-2010, 09:26 PM#2
Neco
This should stop them from moving around ect.

Trigger:
Initialization
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 8, do (Actions)
Collapse Loop - Actions
Player - Make Player 9 (Gray) treat (Player((Integer A))) as an Ally with shared vision and shared units
Set ug_sleep = (Units owned by Player 9 (Gray) matching (((Matching unit) is A Hero) Equal to True))
Collapse Unit Group - Pick every unit in ug_sleep and do (Actions)
Collapse Loop - Actions
Custom script: call SetUnitTurnSpeed(GetEnumUnit(), 0.00)
Custom script: call SetUnitMoveSpeed(GetEnumUnit(), 0.00)
Custom script: call DestroyGroup(udg_ug_sleep)

Or the GUI functions look like this:

Trigger:
Animation - Change (Picked unit) turn speed to 0.00
Unit - Set (Picked unit) movement speed to 0.00

Hope thats what you want!

NOTE: You may have to change the minimum movement speed value in the Gameplay Constants menu to 0. I don't know if this takes into account triggers but it'd be nice to do it anyway.
05-14-2010, 09:43 PM#3
Hydrolisk
Although it would work if I changed the gameplay constants, I really don't want to have to do that, since it changes gameplay too much.
05-15-2010, 12:02 AM#4
Won-Qu
You could make dummy unit with dummy storm bolt with stun duration 9999 and just cast the spell once on every hero. You won't be able to give them orders that way, but you will still be able to see their abilities. Then just remove the buff from hero (if you want to use some thing like "move hero and change control") or just let it be if you create another unit instead of using method I mentioned.

If you don't really know what I'm talking about PM me and I'll make a testmap for you.
05-15-2010, 12:20 AM#5
Hydrolisk
Oh, yea, I could do that. I was hoping I wouldn't have to use such a workaround, but I guess it's unavoidable. (I'll be using 0.00 duration.)

If anybody has any other ideas though, I'm open to them.
05-15-2010, 04:39 PM#6
Tot
Quote:
Originally Posted by Hydrolisk
Oh, yea, I could do that. I was hoping I wouldn't have to use such a workaround, but I guess it's unavoidable. (I'll be using 0.00 duration.)

If anybody has any other ideas though, I'm open to them.


way easier:
remove the ability
'Amov' (move-ability, allows unit to move, hold position and partol; !!can't be readded!!)
and add
'Abun' (orc-burrow-ability, disables attack, but still shows attacks in UI)
to your heroes

if you don't want them to use their spells, set their mana to 0 and create a dummy with brilliance-aura and -9999999.999 bonus and enough range to cover all heroes. don't forget to hide the dummy and remove him after he's no longer used