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

[General] AI taking over after player leaves

Status
Not open for further replies.
Level 3
Joined
Mar 26, 2012
Messages
14
Greetings, I am in need of a bit of help.

When importing AI and using "Start Melee AI script for player X" for computer-controlled player, everything works fine. However, I am interested in knowing if there is a way to make the same trigger work for player whose Scenario Properties -> Players -> Controller is set to User.

The goal is to use given trigger after a player disconnects, to make custom AI run in his stead. Likewise, it could be used when the game starts, if the player slot is unoccupied. The thing is, nothing happens when such trigger is run, and so far I haven't been able to find a trigger that turns User controller slot into Computer controller.

Regards

(I was not sure whether putting this in Trigger section or here should suffice, since solution could be completely unrelated to Triggers, and AI mechanics are the main issue)
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
As I quickly think for now , when a Player leaves or is unused. Change his units' and buildings' owner to the AI player. That's the best I can think for any map excluding AoS ones.
You just use the event of when a player has left or unused or detect it by conditions
Then pick every unit owned by him and change their colors and owner to AI Player and its color.
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
It looks like you might need to try modifying the AI code [Ref] or give them to a surviving AI player and then try running the script [REF], but I don't know what happens with multiple scripts running (if different races). The AI script has a condition that checks for slot status, so disabling that might work.

Other than that, apparently it's not possible to do what you want. The AI Editor scripts will not function if run for non-computer players at game start or for the 4 neutral players. The slot status is a constant that's set by the game.

//\\oo//\\
 
Level 3
Joined
Mar 26, 2012
Messages
14
=Change his units' and buildings' owner to the AI player.

Sadly that will not work, since every AI player should have different AI script running at the same time, meaning if units of one computer player (lets say Orcs) are given to other one (Human for example), human would not know what to do with those orc units without using a lot of custom triggers.

It looks like you might need to try modifying the AI code [Ref] or give them to a surviving AI player and then try running the script [REF], but I don't know what happens with multiple scripts running (if different races). The AI script has a condition that checks for slot status, so disabling that might work.

Other than that, apparently it's not possible to do what you want. The AI Editor scripts will not function if run for non-computer players at game start or for the 4 neutral players. The slot status is a constant that's set by the game.

//\\oo//\\

Oh, I see. Well, that's a shame :(.

Thanks for the help guys.
 
Status
Not open for further replies.
Top