How do I put enemies on mp maps

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Dark-X4
Posts: 18
Joined: May 5th, 2012, 9:56 pm

How do I put enemies on mp maps

Post by Dark-X4 »

I think I saw how before but don't know where and cant find it.
anyways I have some maps I want to put enemies on, so how do i code a map even?
(and also this is a little of topic but I want to make a map pack, I already have everything i think but how do i put it together into an add-on or post add ons)
sorry im not very specific I just dont know what all i need to know.
If you want any concept art I can help, and if your good at WML I probably want your help...
I program and do some art and recently started WML, my art is nothing compared to this though
also Im good at editing dialouge(i know what is right and can change) but not good at writing from scratch
User avatar
alexanderthegre
Posts: 193
Joined: December 8th, 2011, 3:23 am
Location: nowhere

Re: How do I put enemies on mp maps

Post by alexanderthegre »

Dark-X4 wrote: so how do i code a map even?
In general, the best way to do this is to take something that already exists and modify it. Any existing MP map with WML effects should work.
Dark-X4 wrote: anyways I have some maps I want to put enemies on.

Code: Select all

[event]
 name=turn #Turn number
 [unit]
  side=#side number
  generate_name=yes#random name
  type=#unit type. ID, not name.
  x,y=#coordinates.
 [/unit]
[/event]
I hope this helps.
User avatar
Dark-X4
Posts: 18
Joined: May 5th, 2012, 9:56 pm

Re: How do I put enemies on mp maps

Post by Dark-X4 »

It makes me feel stupid that i need help with a mark-up language sometimes.
And where do i get to the code for a map??? I can find my maps file but not sure exactly.
and is the code you said exact, and also for name

name=unit type

is that right?
(hopefully i understand how all this works exactly soon)

Post 2:
Oh and if you want me to be more specific
I want to do something like wilderlands.

Post 3:
(by the way how do i find the wilderlands codes and should i open it in notepad then put codes underneath?
and for x,y=#coordinates

x,y=2,4coordinates
(example)
Last edited by Crendgrim on May 22nd, 2012, 6:45 am, edited 1 time in total.
Reason: Merged consecutive posts
If you want any concept art I can help, and if your good at WML I probably want your help...
I program and do some art and recently started WML, my art is nothing compared to this though
also Im good at editing dialouge(i know what is right and can change) but not good at writing from scratch
Kernigh
Posts: 107
Joined: February 13th, 2007, 10:21 pm
Location: United States
Contact:

Re: How do I put enemies on mp maps

Post by Kernigh »

Dark-X4 wrote:anyways I have some maps I want to put enemies on, so how do i code a map even?
(... how do i put it together into an add-on or post add ons)
My guess is that you have a .map file (from the map editor), but you have no add-on and no .cfg file. There is, at the moment, no good tutorial for creating mp add-ons. So, I will recycle some old instructions.

For multiplayer, these are your main references:
Here are rough instructions...

Step 1. Find your user data directory. Read the instructions at Where is my user data directory?, because your editor/maps directory and your data/add-ons directory will be in there. If your map names would be "Some_Map" and "Some_Other_Map", you would have:
  • USERDATA/data/add-ons/
  • USERDATA/editor/maps/Some_Map
  • USERDATA/editor/maps/Some_Other_Map
Step 2. Move your maps into an add-on. Inside "add-ons", make a new directory for your add-on. Inside there, create any directories that you want, and move your maps in there. The basic layout might look like this:
  • USERDATA/data/add-ons/Name_of_Add-on/
  • USERDATA/data/add-ons/Name_of_Add-on/maps/
  • USERDATA/data/add-ons/Name_of_Add-on/maps/Some_Map.map
  • USERDATA/data/add-ons/Name_of_Add-on/maps/Some_Other_Map.map
  • USERDATA/data/add-ons/Name_of_Add-on/scenarios/
Step 3. Create .cfg files. Every add-on needs a _main.cfg file. Every map needs a [scenario] tag inside a .cfg file. So create some .cfg files:
  • USERDATA/data/add-ons/Name_of_Add-on/_main.cfg
  • USERDATA/data/add-ons/Name_of_Add-on/scenarios/Some_Map.cfg
  • USERDATA/data/add-ons/Name_of_Add-on/scenarios/Some_Other_Map.cfg
_main.cfg might look like:

Code: Select all

#ifdef MULTIPLAYER
{./scenarios}
#endif
Some_Map.cfg and Some_Other_Map.cfg use ScenarioWML. Some_Map.cfg might look like:

Code: Select all

[multiplayer]
    id=Name of Add-on/Some Map
    name= _ "Some Map"
    map_data="{~add-ons/Name_of_Add-on/maps/Some_Map.map}"
    description= _ "This is an interesting map, blah blah blah."
    experience_modifier=70%

    {DEFAULT_SCHEDULE}
    {DEFAULT_MUSIC_PLAYLIST}

    [side]
        side=1
    [/side]
    [side]
        side=2
    [/side]
[/multiplayer]
If Some_Map has more than 2 players, then add more [side] tags.

Start or restart Wesnoth. The game should find _main.cfg in your new add-on. Your maps should appear in the map list.

Step 4. Place some units.

Now that you have an add-on with .cfg files, you can finally place some units, using [event] tag like alexanderthegre showed. For example:

Code: Select all

[multiplayer]
    # ...

    # Do something at turn 2.
    [event]
        name=turn 2

        # Put an Elvish Fighter on 5,5.
        [unit]
            side=1
            generate_name=yes
            type=Elvish Fighter
            x,y=5,5
        [/unit]
        # Put a Drake Burner at 6,12.
        [unit]
            side=2
            generate_name=yes
            type=Drake Burner
            x,y=6,12
        [/unit]
    [/event]
[/multiplayer]
You might want to read about [event] tags in EventWML, or [unit] tags in SingleUnitWML.
User avatar
Dark-X4
Posts: 18
Joined: May 5th, 2012, 9:56 pm

Re: How do I put enemies on mp maps

Post by Dark-X4 »

thanks so much!!!!! :lol2:
anyways
when you put

# blah blah blah

is that in the code or notes?
and how do I make a cfg file?

So let me repeat if I have this right

I need a file for map and another for scenario(or codes whatever)
I set sides with that code - (and if i put enemies on side 1 would that make them on my team?)(yes?)
I should find my add on folder and make a spot for mine
and x,y;5,5 that is the spot - but do i need to put exact number of pixels or just something simple like 5,5?



Ok I have a file with maps in it in the right spot but what is the main.cfg?
(what is a cfg in general?)

and what if i dont have cfgs with it still work?
If you want any concept art I can help, and if your good at WML I probably want your help...
I program and do some art and recently started WML, my art is nothing compared to this though
also Im good at editing dialouge(i know what is right and can change) but not good at writing from scratch
Post Reply