• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

looking for help : uncontrollable but still can be selectable

Status
Not open for further replies.
Level 2
Joined
Oct 18, 2013
Messages
13
hi there .. can someone help me ?? :goblin_cry:

can i make my unit become uncontrollable but still can be selectable ??

for example :
i have a unit that spawn in a region (a)
i this unit will attack move to region (b) automatically (with trigger)

i just wanna make that i can't control this unit for stop, cast a spell or anything else.
just do the previous order (attack move)

like castle fight map
our spawned unit can't be controlled by us. but give us bounty when kill enemy..

i need that trigger please :wsad:
 
Level 2
Joined
Oct 18, 2013
Messages
13
Best Suggestion is Using the another player force change the spawn unit as same color of player that spawn unit
that player force player only can select but can take any control action

thank you for helping before

but its not our unit exactly , that is neutral unit who colored like us ..
even it can't give us bounty:sadpanda:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
This is where SC2 is great since there you literally can make the unit uncommandable.

or add 'Ward' status to unit, this will disable UI
but player can still spam with mouse right click, so you have to catch that order and reorder your unit to move-attack somewhere, this how it is made in original castlefight you refer to.
If you use a re-order approach you have to use a 0 timeout system so that the orders are immediately overwritten as the event fires before the order is appended to the unit's command queue.
 
wow thank for this great idea

Just remember that the "unit is issued an order" event is fired BEFORE the order is issued to the unit, so you need to consider this when reordering it. One way is to use a 0 second timer which triggers a function where the unit is reordered. The brute-force method is to have a trigger that runs every 0.04 second and reorders all the units (not recommended).

Other things that might work are to pause the unit, issue the order, then unpause it. Alternatively, you can try to save the unit in a global variable and run another trigger which orders the unit inside the variable to move (i think running a trigger will start a new thread hence trigger after the unit is ordered, not sure though).
 
Status
Not open for further replies.
Top