HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Stopping a Unit from picking up an Item.

05-12-2008, 04:34 AM#1
Burning Rose
So I want to implement a Trinket system in my map, where you can only have one trinket at a time. They have a shared cooldown, whatever, that's all good.
Problem is, when I order the unit to stop with the trigger, they don't stop. It seems to work when I add a wait function, but then the hero can still pick up the item if he's close enough.
Trigger:
Trinkets
Collapse Events
Unit - A unit Is issued an order targeting an object
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Item-type of (Target item of issued order)) Equal to Banish Trinket
(Item-type of (Target item of issued order)) Equal to Boots of Escape
(Item-type of (Target item of issued order)) Equal to Cyclone Trinket
(Item-type of (Target item of issued order)) Equal to Horn of Battle
(Item-type of (Target item of issued order)) Equal to Invisibility Trinket
(Item-type of (Target item of issued order)) Equal to Net Trinket
(Item-type of (Target item of issued order)) Equal to Silence Trinket
(Item-type of (Target item of issued order)) Equal to Sleep Trinket
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Triggering unit) has an item of type Banish Trinket) Equal to True
((Triggering unit) has an item of type Boots of Escape) Equal to True
((Triggering unit) has an item of type Cyclone Trinket) Equal to True
((Triggering unit) has an item of type Horn of Battle) Equal to True
((Triggering unit) has an item of type Invisibility Trinket) Equal to True
((Triggering unit) has an item of type Net Trinket) Equal to True
((Triggering unit) has an item of type Silence Trinket) Equal to True
((Triggering unit) has an item of type Sleep Trinket) Equal to True
Collapse Actions
Custom script: call SimError(GetOwningPlayer(GetTriggerUnit()), "You can only carry one trinket at a time.")
Unit - Order (Triggering unit) to Stop

Any Ideas?
05-12-2008, 04:36 AM#2
DioD
you have to pause unit
stop it
unpause
05-12-2008, 11:55 AM#3
Fledermaus
Trigger:
Collapse Trinkets
Collapse Events
Unit - A unit Acquires an item
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Item-type of (Target item of issued order)) Equal to Banish Trinket
(Item-type of (Target item of issued order)) Equal to Boots of Escape
(Item-type of (Target item of issued order)) Equal to Cyclone Trinket
(Item-type of (Target item of issued order)) Equal to Horn of Battle
(Item-type of (Target item of issued order)) Equal to Invisibility Trinket
(Item-type of (Target item of issued order)) Equal to Net Trinket
(Item-type of (Target item of issued order)) Equal to Silence Trinket
(Item-type of (Target item of issued order)) Equal to Sleep Trinket
Collapse Actions
Collapse For each (Integer A) from 1 to 6, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Banish Trinket
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Boots of Escape
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Cyclone Trinket
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Horn of Battle
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Invisibility Trinket
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Net Trinket
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Silence Trinket
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Sleep Trinket
Collapse Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Custom script: call SimError(GetOwningPlayer(GetTriggerUnit()), "You can only carry one trinket at a time.")
Else - Actions
05-12-2008, 10:16 PM#4
Burning Rose
No, I tried that the Acquiring first. It registers as the unit having the item that he picks up, so it doesn't let him pick anything up.

I'll try that pausing thing next.
05-13-2008, 01:05 AM#5
Fledermaus
Updated the trigger
05-13-2008, 08:44 PM#6
Themerion
You said that when you added a wait, it worked with your first trigger.

I have experienced similar behaviour, and I think you should try to stop the unit in a separate trigger. Sounds odd, yes, but it might work they way you want it to.

The separate trigger
Event
- [aTimerVariable] expires
Action
- Instantly order [aUnitVariable] to stop

The original trigger
set [aUnitVariable]=(The unit you want to pause)
Countdown Timer - Start [aTimerVariable] as a One-Shot Timer which expires in 0 seconds
05-13-2008, 11:37 PM#7
Burning Rose
Actually, the Pause - Stop - Unpause worked perfectly. Repped.
05-13-2008, 11:54 PM#8
Vexorian
I think it is better to order the unit to stop after a 0 seconds timer.
PauseUnit got a couple of side effects if the unit got effects attached...