[scenario] instant defeated???

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
absinthia
Posts: 10
Joined: June 3rd, 2021, 7:03 am

[scenario] instant defeated???

Post by absinthia »

i copied the text from my 2nd scenarios map2.cfg and edited it into my 1st scenarios map1.cfg. when i tested the map2.cfg it worked perfect but when i start the campaign, im instantly defeated and i dunno what im doing wrong, plz help :/

Code: Select all

#textdomain wesnoth-LSD
 [scenario]
     id=map1
     next_scenario=map2
     victory_when_enemies_defeated=no
     name=_"Finding a host"
     map_data="{~add-ons/my_first_campaign/maps/map1.map}"
     turns=-1
     [side]
         side=1
         controller=human
         team_name="good"
         user_team_name= _ "My Team"
         id=elvy
         name= _ "I=Me"
         type="elvyG"
         unrenameable=yes
        canrecruit=yes
        recruit="block"
         gold=100
     [/side]
[side]
         side=2
         controller=ai
         team_name="ghostly"
         user_team_name= _ "ghostly"
         id=pleasant
         name= _ "I=You"
         type="pleasant"
         unrenameable=yes
        canrecruit=yes
        recruit="block"
         gold=100
     [/side]
[event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Read the unit descriptions and puzzle it out :D"
                condition=win
            [/objective]
            [objective]
                description= _ "Undeath of I=Me"
                condition=lose
            [/objective]
           
            [gold_carryover]
                bonus=yes
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]
    [/event]
    [event]
        name=moveto
        [filter]
            x=6
            y=3
            id=elvy
        [/filter]
        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]
[event]
        name=last breath
        [filter]
            id=elvy
        [/filter]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]


[/scenario]
i dont even get to see the objectives which are set.....
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: [scenario] instant defeated???

Post by octalot »

Is type="elvyG" a known [unit_type]?

When this code is used as the second scenario, it would have the existing unit with id=elvy so it wouldn't try to create a new elvyG.
absinthia
Posts: 10
Joined: June 3rd, 2021, 7:03 am

Re: [scenario] instant defeated???

Post by absinthia »

found the failure: didnt include the directory where elvyG was stored inside the main.cfg
Post Reply