• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Ordering a computer controlled unit to use custom Carrion Beetles

Status
Not open for further replies.
Level 5
Joined
Jul 31, 2020
Messages
103
Hi.

Basically title. I know it doesn't work, the computer unit will refuse to use the ability. I also saw this exact bug referenced in a thread from 2009, so I guess it survived all the way till 2020. I tried standard GUI, also IssueImmediateOrder(unit, "carrionscarabsinstant") which is the order string used by a player unit to use the ability. I tested it myself, so it is the correct string. Also tried IssueImmediateOrderById(unit, 852554) with no success.

I'm wondering if there's a known way to make it work someone found out about in the last 11 years I couldn't find. I don't have high hopes, but the question is out there.
 
Level 5
Joined
Jul 31, 2020
Messages
103
Dumb question but, what about using raise dead instead?

Not gonna lie, I had anticipated this reply before I posted my question at about 2 in the morning. The short answer is that it would do nothing at all. The longer answer is that that wasn't my question, and Raise Dead isn't identical to Carrion Beetles, and not only because one has a duration, and the other one does not. The longest answer includes proof, a showcase of what I'm talking about in an extremely barebones test map using the following setup:
  • Custom Carrion Beetles ability with no mana cost and lowered cooldown.
  • Custom Raise Dead ability with the same.
  • I added both to a hero unit I'm controlling as well, just to show there's nothing going wrong with the abilities first, but I added them to a custom unit I placed 4 of for a computer.
  • Three triggers:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • Unit - Create a Footman corpse for Player 3 (Teal) at (Center of (Playable map area))
      • Unit - Create a Footman corpse for Player 3 (Teal) at (Center of (Playable map area))
      • Unit - Create a Footman corpse for Player 3 (Teal) at (Center of (Playable map area))
  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) types a chat message containing 2 as An exact match
    • Conditions
    • Actions
      • Unit - Order Ghoul 0004 <gen> to Undead Crypt Lord - Carrion Scarabs.
      • Unit - Order Ghoul 0003 <gen> to Undead Crypt Lord - Carrion Scarabs.
      • Unit - Order Ghoul 0001 <gen> to Undead Crypt Lord - Carrion Scarabs.
      • Unit - Order Ghoul 0002 <gen> to Undead Crypt Lord - Carrion Scarabs.
  • Untitled Trigger 003
    • Events
      • Player - Player 1 (Red) types a chat message containing 3 as An exact match
    • Conditions
    • Actions
      • Unit - Order Ghoul 0004 <gen> to Undead Necromancer - Raise Dead.
      • Unit - Order Ghoul 0003 <gen> to Undead Necromancer - Raise Dead.
      • Unit - Order Ghoul 0001 <gen> to Undead Necromancer - Raise Dead.
      • Unit - Order Ghoul 0002 <gen> to Undead Necromancer - Raise Dead.
And here it is: carrion

As can be seen, when their AI orders them to use these abilities, they don't have a problem doing so. And as stated before, turning to JASS, and using the exact order strings, or IDs will not solve this.

Edit: If the only reaction would be to point out I'm leaking 3 locations in the first trigger, please just don't.
 
Level 25
Joined
Feb 9, 2009
Messages
1,800
Hmmmm, what version are you using?
Testing just now resulted it working just fine, on 1.31 version that is...

Also being a nickpicking scoundrel that am, I couldn't help but notice~
>Raise Dead isn't identical to Carrion Beetles, and not only because one has a duration, and the other one does not.
This is data that can be reversed in either case easily in the object editor, the difference is that carrion has a maximum cap variable and caster death effect, while raise dead has only the limit checker for undue spamming.

Finally if all else fails why not trigger the event all together, get the closest unit, remove it and categorize a summon with undead & summoned tag.
 

Attachments

  • Carrion & raise dead.w3x
    12.2 KB · Views: 35
Level 5
Joined
Jul 31, 2020
Messages
103
Hmmmm, what version are you using?
Testing just now resulted it working just fine, on 1.31 version that is...

Also being a nickpicking scoundrel that am, I couldn't help but notice~
>Raise Dead isn't identical to Carrion Beetles, and not only because one has a duration, and the other one does not.
This is data that can be reversed in either case easily in the object editor, the difference is that carrion has a maximum cap variable and caster death effect, while raise dead has only the limit checker for undue spamming.

Finally if all else fails why not trigger the event all together, get the closest unit, remove it and categorize a summon with undead & summoned tag.

WC3 version 1.32.7
Editor version 1.32h
As in the current newest version.

And anyway, the reason it works for you (and also me if I download, and check your test map) is because the ghouls you placed are neutral passive. In my test, they are computer owned units. So, just like another regular player slot that belongs to a computer, and is allied with me, the player. If you change them to such in your map, they'll fail to cast either ability, just like in my own tests.

And also, from what I remember, Raise Dead has a hardcoded cap built into it, which is 25 skeletons. Not a global cap, but per unit using the ability.
 
Level 5
Joined
Jul 31, 2020
Messages
103
Well, I did find a solution.

At first, I was thinking of tinkering with changing ownership since I was aware these orders worked on neutrals. Tried it, wasn't working properly, it was inconsistent. This was when I got bored of trying to mess around with it too much, so I simply got rid of the Carrion Beetles derived ability, and substituted it with Channel. Then I just built the custom ability purely through triggers.

Making sure it doesn't go on cooldown, and use mana if there are no usable corpses in range is a matter of making a "begins casting" trigger in which you search for dead units which have a "true" "Raisable" flag (Get unit boolean field has this as I found out, this allowed me to even make this).

Implementing a summoned unit cap can be done in several different ways. I chose a hashtable/unit group solution; one value saved for each summoned unit which is a second counter. If you summon another unit above the cap, get the one which has the highest value (has been alive for the longest period), kill it.

As for actually "fixing" computer owned units not abiding by the Carrion Beetles/Raise Dead orders? I don't think there is a way.
 
Level 21
Joined
Apr 12, 2018
Messages
494
And also, from what I remember, Raise Dead has a hardcoded cap built into it, which is 25 skeletons. Not a global cap, but per unit using the ability.
It's actually tied to a Global variable and only affects that particular Skeleton unit (it doesn't affect any other Skeleton Warrior).

From Blizzard.j:

call SetPlayerTechMaxAllowed(Player(index), 'uske', bj_MAX_SKELETONS)

where bj_MAX_SKELETONS = 25 and you can change this to whatever you like at runtime (the above is called at Map Initialization).
 
Level 16
Joined
May 2, 2011
Messages
1,351
This thread was marked as resolved 4 months ago, you guys.
I was not content with the solution. (too complicated and un necessary).
IIRC regular AI cast that ability normally, so there should be a way to trigger the AI usage.

if paladin with divine shield triggers it, creating invul dummy unit that attacks crypt lord to trigger the summon also should work. no need to trigger a whole new spell for that.

Plus: is this bug 1.32 thingy or does it also happen on good old versions too?
 
Last edited:
Status
Not open for further replies.
Top