Units Not Spawning In Custom Scenario WML

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
George345
Posts: 5
Joined: June 29th, 2017, 3:57 am

Units Not Spawning In Custom Scenario WML

Post by George345 »

This is my first attempt at a Wesnoth custom scenario I made it and debugged everything but now I'm at a point where it isn't showing any error messages but it is also not working. I am trying to spawn units. I have this at the end of my .cfg file.

Code: Select all

[scenario]
    [unit]
    type=Peasant
    side=4
    name=“King’s Guard”
    x=9
    y=17
    [/unit]

    [unit]
    type=Peasant
    side=4
    name=“King’s Guard”
    x=11
    y=17
    [/unit]

    [unit]
    type=Peasant
    side=4
    name=“King’s Guard”
    x=10
    y=18
    [/unit]
[/scenario]
Could someone please tell me how to fix this?
User avatar
Pentarctagon
Project Manager
Posts: 5561
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Units Not Spawning In Custom Scenario WML

Post by Pentarctagon »

Moved to the WML Workshop.

To create units, all you need is to put the [unit] tag describing the unit inside an [event]. You also may need to use plain quotes(") rather than the curly quotes(”) you have.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
George345
Posts: 5
Joined: June 29th, 2017, 3:57 am

Re: Units Not Spawning In Custom Scenario WML

Post by George345 »

Ok so I did that and I now I have this but it still isn't spawning

Code: Select all

    [event]
        name=start
        [unit]
            type=Peasant
            side=4
            name="King’s Guard"
            x=9
            y=17
        [/unit]

        [unit]
            type=Peasant
            side=4
            name="King’s Guard"
            x=11
            y=17
        [/unit]

        [unit]
            type=Peasant
            side=4
            name="King’s Guard"
            x=10
            y=18
        [/unit]
    [/event]
User avatar
Pentarctagon
Project Manager
Posts: 5561
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Units Not Spawning In Custom Scenario WML

Post by Pentarctagon »

Can you post the code for the entire scenario? Just what you posted above works for me.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
George345
Posts: 5
Joined: June 29th, 2017, 3:57 am

Re: Units Not Spawning In Custom Scenario WML

Post by George345 »

I figured out what was wrong I forgot to add side 4 so the units couldn't exist I think.
Post Reply