• 🏆 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!

Giving empty slots Computer AI

Status
Not open for further replies.
Level 11
Joined
Jun 2, 2004
Messages
849
When a player slot is set to Computer, then the game will automatically use some AI for it; particularly it will cause the units to use abilities like Stormbolt intelligently. I want to enable this when a player leaves the game. Can it be done?
 

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
178
I think u need to modify this trigger:
 

Attachments

  • 123.png
    123.png
    11.6 KB · Views: 128
Level 19
Joined
Jul 2, 2011
Messages
2,162
When a player slot is set to Computer, then the game will automatically use some AI for it; particularly it will cause the units to use abilities like Stormbolt intelligently. I want to enable this when a player leaves the game. Can it be done?
I'm surprised no one has answered this very simple question yet. I stopped editing maps a few years ago but I believe I still remember enough. this is a process that can be set up in trig

event: player leaves
condition: none
action: AI, set melee script

it will be something to that effect. only you will need to create an AI for every hero type in order to use the spells intelligently. which means you will need an if statement in your action which cycles through all the hero types looking for the right AI match

with the world editor you can make AI scripts to handle 3 heroes every script
 
Level 11
Joined
Jun 2, 2004
Messages
849
I attempted a simple:
  • AI - Start melee AI script for (Player(14)): map.ai
on an empty player slot for testing, but the player's hero did not use potions or abilities like a computer controlled slot would.

I certainly do not wish to code my own AI, since the base game already has one and I know how it works. If possible I'd just like to enable it for empty player slots/left players. If I can't do that, then oh well; I'll just tell players to use Computer slots if they want bots and let leaving player's stuff be braindead.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
I attempted a simple:
  • AI - Start melee AI script for (Player(14)): map.ai
on an empty player slot for testing, but the player's hero did not use potions or abilities like a computer controlled slot would.

I certainly do not wish to code my own AI, since the base game already has one and I know how it works. If possible I'd just like to enable it for empty player slots/left players. If I can't do that, then oh well; I'll just tell players to use Computer slots if they want bots and let leaving player's stuff be braindead.
I'm pulling out my laptop right now

I'm on the case

in the mean time in the object handler, add 1 auto cast ability to every hero...what I mean by this is the first row in the edit area in the object area of your hero
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Added a junk ability to Default Active Abilities (raise dead, which they don't have) and nuttin' either.
Lol you have to add an ability they actually have or else they can't use it

DUH :p

Anyway it isn't hard to make AI. I was going to do it for you but soon as I opened my laptop I lost all inspiration to do it. It is very easy but takes time. Go to the AI section of your world editor, it and icon of zeros and ones, click on it and then select the tab heroes. Then according to the race you are using different heroes will be available to you. Once more warcraft automatically selects the abilities for you. From there you just need to save the ai for every 3 sets of heroes and then import them later
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Only slots that are Computer controlled can run AI. This means that slots that are empty, or human controlled cannot. One cannot enable Melee AI for a player who left.

That said one can apply a trigger built AI to any player and it will work. A trigger built AI is an AI that is implemented entirely out of triggers and interacts with players only by issuing orders.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Only slots that are Computer controlled can run AI. This means that slots that are empty, or human controlled cannot. One cannot enable Melee AI for a player who left.

That said one can apply a trigger built AI to any player and it will work. A trigger built AI is an AI that is implemented entirely out of triggers and interacts with players only by issuing orders.
that is factually incorrect

you can even give computers control of your characters In game
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
you can even give computers control of your characters In game
Yes you can transfer ownership of all units from a human or empty controlled player to a computer player and then get that computer player's AI to use them. However you cannot start an AI script for a non-Computer controlled player. If one could I am sure many more maps would be doing it.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Only slots that are Computer controlled can run AI. This means that slots that are empty, or human controlled cannot. One cannot enable Melee AI for a player who left.
Confirmation of this is precisely what I wanted. Thanks.

Too much of the map is built upon heroes not changing which player owns them to refactor at this point, so I'll probably just not worry about it.
 
Status
Not open for further replies.
Top