| 05-29-2009, 10:48 PM | #1 |
How do you make units that are owned by the player but are controlled by a basic AI to cast spells that you designated and function basically like another players unit? Basically the units in castle fight if you are familiar with that. |
| 05-29-2009, 11:15 PM | #2 |
The only way I know of involves making the units unselectable (but not unkillable like the locust ability does), tell us if that's ok. |
| 05-30-2009, 01:43 AM | #3 |
AFAIK, Overwriting the unit's given command is the best way we can do. Whenever they are given a command from player, assign a new command to it. Castle Fight also uses this method. |
| 05-30-2009, 03:22 AM | #4 |
Unselectable is undesireable I tried to overide the orders by doing Event: Issued order a target point Action: Order unit to stop however that doesnt work so I added a wait 0.01 second before the stop but then mass clicking will cause it to move. Also an infinte loop happens if I do this Unit is issued target unit. =/ |
| 05-30-2009, 03:55 AM | #5 |
I'm pretty sure you don't need the use of wait as I have tried it before and it worked fine. For the infinite loop problem, just disable the trigger and enable it after the issue unit function or try adding filter(condition) to it so that the event won't fire the trigger infinity times. |
| 05-30-2009, 04:09 AM | #6 |
Code:
NO Right Click
Events
Unit - A unit Is issued an order targeting an object
Conditions
(Triggering unit) Equal to Peasant 0002 <gen>
Actions
Trigger - Turn off (This trigger)
Unit - Order (Triggering unit) to Stop
Trigger - Turn on (This trigger)Yea this doesnt work :( |
| 05-30-2009, 05:11 AM | #7 |
you need to pause-stop-unpause the unit i think. JASS:set (boolean) unitIsPaused = IsUnitPaused(myUnit) call PauseUnit(myUnit, true) call IssueImmediateOrder(myUnit, "stop") call PauseUnit(myUnit, unitIsPaused) |
| 05-30-2009, 11:09 AM | #8 |
Tried it, it really didn't work. Well if you can use JASS, using single timer with 0.00 may be the solution for this. I don't think there is a way that GUI can handle this (with MUI, of course) because basically the event fires before a unit actually takes the order so wait is no go. |
| 05-30-2009, 12:54 PM | #9 |
Trigger: Trigger: Give the uncontrolable units the ward classification, so people can only order them "smart" (or make the Stop trigger deactivate the Order trigger while ordering "stop") Jass solution would be better though |
