How Can I Add an AI Enemy to MP Scenario

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

Post Reply
User avatar
Cedric-W4ARW
Posts: 4
Joined: February 11th, 2018, 9:22 pm

How Can I Add an AI Enemy to MP Scenario

Post by Cedric-W4ARW »

I am just starting out in creating content and using the map editor have created some MP maps to play. I am trying to add AI in as a deterrent in one of my maps, however, I cannot seem to make it work. It (the AI) either does not move or does not let me save scenario. whenever I make it work (by adding sides) it counts as one of the 2 human player's spots! Just wondering how I can make AI attack me AND opponent while letting both of us play at each other as well. Any help would be VERY MUCH appreciated.

FYI: I am running Linux
-He who never wanders is lost-
Shiki
Developer
Posts: 348
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: How Can I Add an AI Enemy to MP Scenario

Post by Shiki »

There are two ways:
1) Take a normal MP map and set the controller to computer in the Create Game Dialogue. Give all three sides different teams. Eventually you have to disable the use of map settings (that's the stuff defined in the [side] tags) to unlock more teams.

2) Have a look how mainline multiplayer scenarios with AI sides do it. As an example, 6p_Team_Survival or 2p_Dark_Forcast.
Basically you need this:

Code: Select all

    [side]
        side=3
        controller=ai
        allow_player=no
        disallow_observers=yes
       ....
    [/side]
Try out the dark board theme.
User avatar
Cedric-W4ARW
Posts: 4
Joined: February 11th, 2018, 9:22 pm

Re: How Can I Add an AI Enemy to MP Scenario

Post by Cedric-W4ARW »

thx. I just need to find where i input wml. I cannot figure out how to open tex editor :cry: ! would python work?
-He who never wanders is lost-
Shiki
Developer
Posts: 348
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: How Can I Add an AI Enemy to MP Scenario

Post by Shiki »

I'm not exactly sure if I understood your issue. There are some maintenance tools written in python, but besides that there is no python involved.
WML is wesnoth's own markup language, it is saved in plain text files ending with .cfg, you can edit them with any text editor.

You can find here (https://wiki.wesnoth.org/Editingwesnoth) the locations where they are stored, and can open them with your editor from within the file manager, eventually you must teach the file manager to open .cfg files with your favourite editor first.

There exist text highlighting plugins which you can install by hand for some editors, you find them here:
https://r.wesnoth.org/t13799
In case of gedit, the highlighter in the 1st post is broken but the ones in the 2nd and 4th work.
In case of kate, kate has already built-in highlighting for WML.

Maybe download a MP scenario from the add-on server and adjust it.
Try out the dark board theme.
User avatar
Cedric-W4ARW
Posts: 4
Joined: February 11th, 2018, 9:22 pm

Re: How Can I Add an AI Enemy to MP Scenario

Post by Cedric-W4ARW »

thank you i installed editor
-He who never wanders is lost-
Post Reply