HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Removing Unit from AI control

11-20-2004, 09:46 PM#1
sneb
Basicly I made a dummy speel that made say a peasnt harvest lumber in a certain area. My problem is unless theres excess peasents that the AI isnt assinging to do anything once the unit is ordered to harvest lumber, the AI will override the order by telling to to do something else.

What I basicly need is a way to make the AI act like the peasent is dead, and continue running the AI as if it didnt exist.
11-21-2004, 06:17 PM#2
Tommi
Quote:
Originally Posted by sneb
Basicly I made a dummy speel that made say a peasnt harvest lumber in a certain area. My problem is unless theres excess peasents that the AI isnt assinging to do anything once the unit is ordered to harvest lumber, the AI will override the order by telling to to do something else.

What I basicly need is a way to make the AI act like the peasent is dead, and continue running the AI as if it didnt exist.
Me thinks it is impossible, because you can't use Ignore Guard Position on workers. The only workaround that comes to my mind is to use another player for the peasant and some triggering.
11-21-2004, 07:20 PM#3
AIAndy
You could have some trigger that catches the orders the AI gives and overrides them again.
11-21-2004, 08:40 PM#4
sneb
@Tommi: With the way the gameplay is currently set up all of the players are in use, and the only way i could get rid of one of the computer players defets thwe whole perpose of this idea.

@AIAndy: Not quite sure what you mean, i assume you ment somethign like
Code:
Getting order of AI
    Events
        Unit - A unit owned by Player 2 (Blue) Is issued an order targeting a point
        Unit - A unit owned by Player 2 (Blue) Is issued an order with no target
        Unit - A unit owned by Player 2 (Blue) Is issued an order targeting an object
    Conditions
        ((Ordered unit) is in TestGroup) Equal to True
    Actions
        Unit - Order (Ordered unit) to Harvest Nearby Lumber
        Game - Display to (All players) the text: Overrided

When it gives the unit the harvest nearby lumber order WC3 crashes(possible infinate loop of the AI and the trigger going back and forth possibly?) I cant think of any other way to do it and with my extreamly limited current knowlege of JASS i cant think of anyother way to override the order other then to give it the previous order.
11-22-2004, 02:39 AM#5
AIAndy
You are right, that gives an infinite loop. Why? Because the order you give in turn fires that trigger again. Try to deactivate the trigger before giving the order and reactivate it afterwards.
11-22-2004, 04:30 AM#6
sneb
Ok i fixed everything so it works now, thxs a lot for the help.