• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Dummy Units for Computer Players get unwanted orders

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Greetings, Hive!

I have been investigating a bug in my map where a Dummy unit owned by an enemy, computer-controlled player, got interrupted when it started casting it's channeling spell - Rain of Fire.

My investigation led me to discover that as soon as the Dummy spawned for its player (12 Brown), it was immediately given the 'stop' order and then a 'null' order. Important to note is that this did not occur for player-controlled slot, for example (1 Red). I assumed it was a triggering issue. That a trigger somewhere gives those orders to the dummy, but eventually I just decided to delete all triggers and see if the issue persisted and turns out - it did.

This has lead me to conclude that units spawned by Computer-owned players always get those 2 orders when they enter the map. Here is some additional info:

Here is how Players are set in the map:
full


Here are the triggers that spawn 2 Dummy types for various Players. <Dummy (Rain of Fire)> is the dummy that is supposed to channel Rain of Fire. To verify if it was a problem with that dummy type in particular I also did testing with a second dummy unit that is your usual generic dummy - <Dummy (Generic Uses)>. Triggers are listed as follows
-Trigger that displays text message when either of the 2 Dummy types enter the map
-Spawn Dummy (Rain of Fire) for Player 12 (with a screenshot of the text message result)
-Spawn Dummy (Generic Uses) for Player 12 (with a screenshot of the text message result)
-Spawn Dummy (Rain of Fire) for Player 1 (with a screenshot of the text message result)
-Spawn Dummy (Rain of Fire) for Player 2 (with a screenshot of the text message result)
-Spawn Dummy (Rain of Fire) for Player 10 (with a screenshot of the text message result)
-Spawn Dummy (Rain of Fire) for Player 8 (with a screenshot of the text message result)
[trigger=""]
Text Message
Events
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order with no target
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Dummy (Rain of Fire)
(Unit-type of (Triggering unit)) Equal to Dummy (Generic Uses)
Actions
Game - Display to (All players) for 1.00 seconds the text: (String((Issued order)))
[/trigger]

[trigger=""]
RoF 12
Events
Player - Player 1 (Red) types a chat message containing a as An exact match
Conditions
Actions
Set Generic_Point = (Center of Explore Entrance Woods <gen>)
Unit - Create 1 Dummy (Rain of Fire) for Player 12 (Brown) at Generic_Point facing Default building facing degrees
Custom script: call RemoveLocation (udg_Generic_Point)
[/trigger]
full


[trigger=""]
Generic 12
Events
Player - Player 1 (Red) types a chat message containing b as An exact match
Conditions
Actions
Set Generic_Point = (Center of Explore Entrance Woods <gen>)
Unit - Create 1 Dummy (Generic Uses) for Player 12 (Brown) at Generic_Point facing Default building facing degrees
Custom script: call RemoveLocation (udg_Generic_Point)
[/trigger]
full


[trigger=""]
RoF 01
Events
Player - Player 1 (Red) types a chat message containing c as An exact match
Conditions
Actions
Set Generic_Point = (Center of Explore Entrance Woods <gen>)
Unit - Create 1 Dummy (Rain of Fire) for Player 1 (Red) at Generic_Point facing Default building facing degrees
Custom script: call RemoveLocation (udg_Generic_Point)
[/trigger]
full


[trigger=""]
RoF 02
Events
Player - Player 1 (Red) types a chat message containing d as An exact match
Conditions
Actions
Set Generic_Point = (Center of Explore Entrance Woods <gen>)
Unit - Create 1 Dummy (Rain of Fire) for Player 2 (Blue) at Generic_Point facing Default building facing degrees
Custom script: call RemoveLocation (udg_Generic_Point)
[/trigger]
full


[trigger=""]
RoF 10
Events
Player - Player 1 (Red) types a chat message containing e as An exact match
Conditions
Actions
Set Generic_Point = (Center of Explore Entrance Woods <gen>)
Unit - Create 1 Dummy (Rain of Fire) for Player 10 (Light Blue) at Generic_Point facing Default building facing degrees
Custom script: call RemoveLocation (udg_Generic_Point)
[/trigger]
full


[trigger=""]
RoF 8
Events
Player - Player 1 (Red) types a chat message containing f as An exact match
Conditions
Actions
Set Generic_Point = (Center of Explore Entrance Woods <gen>)
Unit - Create 1 Dummy (Rain of Fire) for Player 8 (Pink) at Generic_Point facing Default building facing degrees
Custom script: call RemoveLocation (udg_Generic_Point)
[/trigger]
full



So, what could cause this? Is there a fix? If not, how would you advice me to use dummy units for Player 12 (owned by Computer) if they immediately get interrupted?
Thanks in advance!
 
Level 8
Joined
Oct 4, 2016
Messages
208
I experienced this in the past, if I remember correctly, the solution is to eliminate guard positions for each new unit created for a computer. Because the default AI takes control of these units and makes orders.
Or you can also convert all dummies to buildings, I'm not sure, but I think it works. the GUI function is this.

AI - Ignore unit guard position
 
Level 12
Joined
Jun 15, 2016
Messages
472
Seeing as player 10 and 12 are computer controlled, you should remove the unit's guard position when you create them with this action:

  • AI - Ignore (Last created unit)'s guard position
This is good practice for computer controlled dummy units anyways, and I think guard positions can have the unit get some unwanted orders.

Also, you can call GetIssuedOrderId() to see what is that null order, this will help relating it to other cases.
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Adding the AI command simply resulted in an additional stop order. :/
And the custom script doesn't seem to do anything for me.

[trigger=""]
Untitled Trigger 001
Events
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order with no target
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Dummy (Rain of Fire)
(Unit-type of (Triggering unit)) Equal to Dummy (Generic Uses)
Actions
Game - Display to (All players) for 1.00 seconds the text: (String((Issued order)))
Custom script: call GetIssuedOrderId()
[/trigger]
 
Level 8
Joined
Oct 4, 2016
Messages
208
  • Unit - Create 1 ...
  • AI - Ignore (Last created unit)'s guard position
  • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire (Center of (Playable map area))
Adds the AI function before the order function.
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
This is before any order is given. As showcased in the triggers above, I just spawn the unit. And just by spawning it, it gets the 'null' and 'stop' orders. I add the AI action after the unit is spawned.
[trigger=""]
RoF 12
Events
Player - Player 1 (Red) types a chat message containing a as An exact match
Conditions
Actions
Set Generic_Point = (Position of Agi_Str_Int[3])
Unit - Create 1 Dummy (Rain of Fire) for Player 12 (Brown) at Generic_Point facing Default building facing degrees
AI - Ignore (Last created unit)'s guard position
Custom script: call RemoveLocation (udg_Generic_Point)
[/trigger]
 
Level 8
Joined
Oct 4, 2016
Messages
208
continues interrupting Rain of Fire?
I test adding the skill after creating the dummy and it works perfectly.
About the orders, i think it's normal behavior for a unit created for a computer player. I don't know why happens.

EDIT: I tried this and I find that if you order the dummy to use a skill that is already added to the unit, it will not work even if you add the AI function. You need to add the dummy ability through triggers, add the ability after the AI function.
 
Last edited:

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
continues interrupting Rain of Fire?
Ah, you are right. Since it was the 'stop' orders that interrupted it, I assumed it won't work until the orders were gone. But it does work now - Rain of Fire does not get interrupted.
I'll consider the issue, solved, +rep to both of you.

Just a final thing: What about the 'null' order? What is it? Using the Custom Script didn't seem to display anything for me? Did I do it wrong?
 
Level 8
Joined
Oct 4, 2016
Messages
208
I do not know why you got null, I tried the same trigger for the orders and it does not show null for me. About your custom script that does nothing. It's because you only call the function and it does not show up in any message function.
It should be like that:
  • Custom Script: call BJDebugMsg(I2S(GetIssuedOrderId()))
 
Level 13
Joined
May 10, 2009
Messages
868
Judging from what you told us, I bet that it is the 851974 immediate order. However, nobody has really reported what it does. Only AI is capable of executing it, and generally, for stopping a unit from channeling an ability. If you try to make a unit execute it, it won't do anything, and the function IssueImmediateOrderById returns false. I tried to do the following: Placed a unit for player 2 (computer), and forced it to cast Blizzard - The very first level of it creates up to 6 waves of shards. I noticed If there's, at least, one enemy in the targeted area, the computer won't execute the 851974 order. Otherwise, it does in the middle of the spell duration.
 
Level 8
Joined
Oct 4, 2016
Messages
208
Judging from what you told us, I bet that it is the 851974 immediate order. However, nobody has really reported what it does. Only AI is capable of executing it, and generally, for stopping a unit from channeling an ability. If you try to make a unit execute it, it won't do anything, and the function IssueImmediateOrderById returns false. I tried to do the following: Placed a unit for player 2 (computer), and forced it to cast Blizzard - The very first level of it creates up to 6 waves of shards. I noticed If there's, at least, one enemy in the targeted area, the computer won't execute the 851974 order. Otherwise, it does in the middle of the spell duration.
I see, the null value that SpasMaster obtained is the order 851974 and in my test this order ID appears before the Rain of Fire order. I didn't know, great info. :)
 
Status
Not open for further replies.
Top