New Campaign Not Loading

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.
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: New Campaign Not Loading

Post by TheScribe »

One thing to mention. I personally use the following bit of code under the side tag. I find it's easier if you only have 1-4 villages.

Code: Select all

[village]
x,y=1,1 #whatever coordinates you want
[/village]
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
User avatar
junoslord
Posts: 82
Joined: June 11th, 2012, 3:13 pm
Location: Enveloping your left flank.

Re: New Campaign Not Loading

Post by junoslord »

My death event for the first enemy leader is wrong... when I kill the first leader the scenario ends.

Spoiler:
Edit: This is actual side, with {starting village macro}:
Spoiler:
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."

"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: New Campaign Not Loading

Post by 8680 »

Why do you have a [side] in an [event]? That shouldn’t do anything.
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: New Campaign Not Loading

Post by Elvish_Hunter »

8680 wrote:Why do you have a [side] in an [event]? That shouldn’t do anything.
In fact, all sides should be declared at the start, and in this case side 3 should have no_leader=yes. Then, in such event, you create the new leader for side 3, and use [allow_recruit] to allow him recruiting.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
junoslord
Posts: 82
Joined: June 11th, 2012, 3:13 pm
Location: Enveloping your left flank.

Re: New Campaign Not Loading

Post by junoslord »

Elvish_Hunter wrote:
8680 wrote:Why do you have a [side] in an [event]? That shouldn’t do anything.
In fact, all sides should be declared at the start, and in this case side 3 should have no_leader=yes. Then, in such event, you create the new leader for side 3, and use [allow_recruit] to allow him recruiting.
Sorry, but let me clarify this...

1. Move side 3 back to the top.
2. Add no_leader=yes to it.
3. During the death event add a unit with allow_recruit?

Also, should I add the recruit list at the leader intro or the side intro? Wouldn't a side intro would mean they recruit before the leader?
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."

"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
User avatar
junoslord
Posts: 82
Joined: June 11th, 2012, 3:13 pm
Location: Enveloping your left flank.

Re: New Campaign Not Loading

Post by junoslord »

When I kill the first leader everything triggers, except the leader doesn't appear and none of his dialogue is spoken.

Code: Select all

#textdomain wesnoth-Sample_Campaign
[scenario]

  	id=Final Battle
 
  	name= _ "Final Battle"
  	map_data="{~add-ons/Sample_Campaign/maps/map2.map}"
  	turns=50

	victory_when_enemies_defeated=no
 
  	{DAWN}
  	{MORNING}
  	{AFTERNOON}
  	{DUSK}
  	{FIRST_WATCH}
  	{SECOND_WATCH}
 
  	music=traveling_minstrels.ogg

[story]
        [part]
            	story= _ "After sweeping aside the enemies foward units your men are poised to attack..."
        [/part]
        [part]
            	story= _ "They gather quietly into camps as the sun goes down."
        [/part]
        [part]
            	story= _ "They know the next dawn brings what they've dreaded since they marched from the capitol."
        [/part]
[/story]

[side]
	side=1
    	controller=human
	unrenamable=yes
	team_name=1
	user_team_name= _ "Recon Patrol"

    	id=Swen
    	name= _ "Swen"
    	canrecruit=yes

    	recruit=Volunteer Peasant,Regular Bowman,Regular Spearman,Mage

    	{GOLD 100 100 100}
    	{INCOME 2 2 2}
[/side]
  	
[side]
    	side=2
    	controller=ai
    	unrenamable=yes
    	team_name=Blue Team

    	type=Lieutenant
    	id=Enemy Lieutenant
    	name= _ "Enemy Leader"
    	canrecruit=yes

    	recruit=Bowman,Spearman,Horseman,Mage

    	{GOLD 75 100 100}
    	{INCOME 2 2 2}
[/side]

[side]
	side=3
    	controller=ai
   	unrenamable=yes
    	team_name=Blue Two
	no_leader=yes

[/side]

[event]
name=prestart

    	[objectives]
      		side=1

      		[objective]
        		description= _ "Defeat All Enemy Leaders"
        		condition=win
      		[/objective]
      		[objective]
       	 		description= _ "Death of Swen"
        		condition=lose
      		[/objective]
      		[objective]
        		description= _ "Turns run out"
        		condition=lose
      		[/objective]
    	[/objectives]

[/event]

[event]
name=start

      	[unit]
        	type=Regular Bowman
        	id=Gaul
        	name= _ "Gaul"
        	side=1
        	unrenamable=yes
		x,y=3,4
      	[/unit]

      	[unit]
        	type=Regular Spearman
        	id=Lee
        	name= _ "Lee"
        	side=1
        	unrenamable=yes
        	x,y=4,2
      	[/unit]


        [message]
            	speaker=Gaul
            	message= _ "There they are, sir."
        [/message]
        [message]
            	speaker=Swen
            	message= _ "And I don't think they see us yet."
        [/message]
	[message]
            	speaker=Lee
            	message= _ "Hold the celebration, sir. There's a foward post just ahead."
        [/message]
        [message]
            	speaker=Gaul
            	message= _ "He's right, sir. And they do see us!"
        [/message]
        [message]
            	speaker=Swen
            	message= _ "Well then, let's get this over with. The rest of the army is counting on us."
        [/message]
        [message]
            	speaker=Gaul
            	message= _ "Real nice of them, isn't it, sir?"
        [/message]
        [message]
            	speaker=Lee
            	message= _ "Hell of a thing if we do this and the main army doesn't attack. Or gets destroyed because they where too weak."
        [/message]
        [message]
            	speaker=Swen
            	message= _ "Not our problem today, corporal. Maybe tommorow it will be, but not today. TO ARMS!"
        [/message]
        [message]
            	speaker=Lee
            	message= _ "For the Red Empire!."
        [/message]

        [unit]
           	type=White Mage
            	id=Father Best
            	name= _ "Father Best"
            	side=1
            	unrenamable=yes
	    	x,y=4,3
        [/unit]

        [message]
            	speaker=Gaul
            	message= _ "Who are you, old man!"
        [/message]
        [message]
            	speaker=Father Best
            	message= _ "I am Father Best, I have come to help you."
        [/message]
	[message]
            	speaker=Swen
            	message= _ "Great peasants and priests! This is a hell of an army."
        [/message]
        [message]
            	speaker=Father Best
            	message= _ "I am also a trained healer."
        [/message]
        [message]
            	speaker=Swen
            	message= _ "Welcome to the Red Team, Father, it's a privilage to work with you."
        [/message]
        [message]
            	speaker=Lee
            	message= _ "SIR! We gonna fight, or what?"
        [/message]
        [message]
            	speaker=Swen
            	message= _ "I suppose, but let me grab a soda and take a piss first?"
        [/message]
        [message]
            	speaker=Lee
            	message= _ "Soda, sir?"
        [/message]
        [message]
            	speaker=Swen
            	message= _ "It's another of those future things-- brb"
        [/message]

[/event]

[event]
name=moveto
        
	[filter]
            	side=1

            	[filter_location]
                	x,y=22,7
                	radius=5
            	[/filter_location]
        [/filter]

        [message]
             	speaker=Enemy Lieutenant
                message= _ "You'll never take this keep!"
        [/message]
	[message]
		speaker=Swen
		message= _ "Soon, very soon."
        [/message]
[/event]

[event]
name=die
	
	[filter]
            	id=Enemy Lieutenant
        [/filter]

	[message]
        	speaker=Swen
                message= _ "Welcome to forever after..."
	[/message]
	[message]
        	speaker=Enemy Lieutenant
                message= _ "Christ, forst you kill me, then you mock me? What a prick."
	[/message]

	[unit]
	    	type=General
    		id=Enemy General
	    	name= _ "Enemy General"
		side=3
    		canrecruit=yes
		x,y=38,9

    		recruit=Bowman,Spearman,Horseman,Mage,Heavy Infantryman

    		{GOLD 150 100 100}
    		{INCOME 2 2 2}
		{STARTING_VILLAGES 3 6}
	[/unit]

      	[unit]
        	type=Bowman
        	id=Senior Bowman
        	name= _ "Senior Bowman"
        	side=3
        	unrenamable=yes
		x,y=37,10
      	[/unit]

      	[unit]
        	type=Spearman
        	id=Senior Spearman
        	name= _ "Senior Spearman"
        	side=3
        	unrenamable=yes
        	x,y=38,8
      	[/unit]

      	[unit]
        	type=Heavy Infantryman
        	id=Command Sergeant
        	name= _ "Command Sergeant"
        	side=3
        	unrenamable=yes
		x,y=37,9
      	[/unit]

      	[unit]
        	type=Horseman
        	id=Scout Leader
        	name= _ "Scout Leader"
        	side=3
        	unrenamable=yes
        	x,y=36,8
      	[/unit]

	[message]
        	speaker=Enemy General
                message= _ "You bastards, they told me you where coming the other way. Send a runner! Get me more troops!"
	[/message]
	[message]
        	speaker=Scout Leader
                message= _ "Let me have a look, sir. There may not--"
	[/message]
	[message]
        	speaker=Enemy General
                message= _ "Did you hear me? Runner! Now!"
	[/message]
	[message]
        	speaker=Scout Leader
                message= _ "Yes, sir."
	[/message]
	[message]
        	speaker=Gaul
                message= _ "Looks like they're takling the bait, sir!"
	[/message]
	[message]
        	speaker=Swen
                message= _ "It does. Let's keep at them! They may pull off half the army to get at us."
	[/message]

[/event]
	   
[event]
name=die

	[filter]
            	id=Swen
        [/filter]

	[message]
		speaker=Swen
		message= _ "I have failed you men, I am sorry. Forgive me!"
	[/message]
	[message]
		speaker=Lee
		message= _ "What do we do now!"
	[/message]
	[message]
		speaker=Enemy General
		message= _ "Die with your commander!"
	[/message]
[/event]

[event]
name=moveto

	[filter]
        	side=1

            	[filter_location]
                	x,y=38,9
                	radius=5
            	[/filter_location]
        [/filter]

	[message]
		speaker=Enemy General
                message= _ "Where the hell are my troops! I was promised troops!"
        [/message]
	[message]
		speaker=Swen
		message= _ "I would offer to take you captive, but I'm sure you'd refuse."
	[/message]
	[message]
		speaker=Enemy General
		message= _ "My men have fight left in them! You have won nothing yet! Wait until those reinforcements arrive."
	[/message]
[/event]

[event]
name=die

	[filter]
		id=Enemy General
        [/filter]

	[message]
		speaker=Swen
                message= _ "Don't dispare, General, I see your reinforcements arriving now."
        [/message]
	[message]
		speaker=Enemy General
                message= _ "Now you are done for Red."
        [/message]
	[message]
		speaker=Swen
                message= _ "Of course, I do have a secret."
        [/message]
	[message]
		speaker=Enemy General
                message= _ "What's that, Red."
        [/message]
	[message]
		speaker=Swen
                message= _ "We're just the diversion."
        [/message]
	[message]
		speaker=Enemy General
                message= _ "You dirty [censored]..."
        [/message]
[/event]
 
[/scenario]
Can anyone tell me how editing a scenario affect a game that is already started... I have the first leader nearly dead, and pinned in a village. I saved the game so I can just reload there, does this work? Or do I need to completely start over every time I edit?

Also, is there a add on that will let you debug, edit in game?
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."

"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
User avatar
junoslord
Posts: 82
Joined: June 11th, 2012, 3:13 pm
Location: Enveloping your left flank.

Re: New Campaign Not Loading

Post by junoslord »

Okay, I made adjustments, now I get the enemy leader but there are a couple of problems:

1. Enemy General (side=3) doesn't recruit.
2. Villages don't begin under side=3 control.
3. After Enemy General killed scenario doesn't end.

Code: Select all

#textdomain wesnoth-Sample_Campaign
[scenario]

  	id=Final Battle
 
  	name= _ "Final Battle"
  	map_data="{~add-ons/Sample_Campaign/maps/map2.map}"
  	turns=50

	victory_when_enemies_defeated=no
 
  	{DAWN}
  	{MORNING}
  	{AFTERNOON}
  	{DUSK}
  	{FIRST_WATCH}
  	{SECOND_WATCH}
 
  	music=traveling_minstrels.ogg

[story]
        [part]
            	story= _ "After sweeping aside the enemies foward units your men are poised to attack..."
        [/part]
        [part]
            	story= _ "They gather quietly into camps as the sun goes down."
        [/part]
        [part]
            	story= _ "They know the next dawn brings what they've dreaded since they marched from the capitol."
        [/part]
[/story]

[side]
	side=1
    	controller=human
	unrenamable=yes
	team_name=1
	user_team_name= _ "Recon Patrol"

    	id=Swen
    	name= _ "Swen"
    	canrecruit=yes

    	recruit=Volunteer Peasant,Regular Bowman,Regular Spearman,Mage

    	{GOLD 100 100 100}
    	{INCOME 2 2 2}
[/side]
  	
[side]
    	side=2
    	controller=ai
    	unrenamable=yes
    	team_name=Blue Team

    	type=Lieutenant
    	id=Enemy Lieutenant
    	name= _ "Enemy Leader"
    	canrecruit=yes

    	recruit=Bowman,Spearman,Horseman,Mage

    	{GOLD 75 100 100}
    	{INCOME 2 2 2}
[/side]

[side]
	side=3
    	controller=ai
   	unrenamable=yes
    	team_name=Blue Two
	no_leader=yes

	type=General
    	id=Enemy General
	name= _ "Enemy General"
	side=3
    	canrecruit=yes
	x,y=38,9

    	recruit=Bowman,Spearman,Horseman,Mage,Heavy Infantryman
    		
	{GOLD 150 100 100}
    	{INCOME 2 2 2}
[/side]

[event]
name=prestart

    	[objectives]
      		side=1

      		[objective]
        		description= _ "Defeat All Enemy Leaders"
        		condition=win
      		[/objective]
      		[objective]
       	 		description= _ "Death of Swen"
        		condition=lose
      		[/objective]
      		[objective]
        		description= _ "Turns run out"
        		condition=lose
      		[/objective]
    	[/objectives]

[/event]

[event]
name=start

	[village]
		side=3
   	 	x,y=39,7
    	[/village]
	[village]
		side=3
   	 	x,y=40,5
    	[/village]
	[village]
		side=3
   	 	x,y=38,11
    	[/village]
	[village]
		side=3
   	 	x,y=39,12
    	[/village]
	[village]
		side=3
   	 	x,y=34,12
    	[/village]

      	[unit]
        	type=Regular Bowman
        	id=Gaul
        	name= _ "Gaul"
        	side=1
        	unrenamable=yes
		x,y=3,4
      	[/unit]

      	[unit]
        	type=Regular Spearman
        	id=Lee
        	name= _ "Lee"
        	side=1
        	unrenamable=yes
        	x,y=4,2
      	[/unit]


        [message]
            	speaker=Gaul
            	message= _ "There they are, sir."
        [/message]
        [message]
            	speaker=Swen
            	message= _ "And I don't think they see us yet."
        [/message]
	[message]
            	speaker=Lee
            	message= _ "Hold the celebration, sir. There's a foward post just ahead."
        [/message]
        [message]
            	speaker=Gaul
            	message= _ "He's right, sir. And they do see us!"
        [/message]
        [message]
            	speaker=Swen
            	message= _ "Well then, let's get this over with. The rest of the army is counting on us."
        [/message]
        [message]
            	speaker=Gaul
            	message= _ "Real nice of them, isn't it, sir?"
        [/message]
        [message]
            	speaker=Lee
            	message= _ "Hell of a thing if we do this and the main army doesn't attack. Or gets destroyed because they where too weak."
        [/message]
        [message]
            	speaker=Swen
            	message= _ "Not our problem today, corporal. Maybe tommorow it will be, but not today. TO ARMS!"
        [/message]
        [message]
            	speaker=Lee
            	message= _ "For the Red Empire!."
        [/message]

        [unit]
           	type=White Mage
            	id=Father Best
            	name= _ "Father Best"
            	side=1
            	unrenamable=yes
	    	x,y=4,3
        [/unit]

        [message]
            	speaker=Gaul
            	message= _ "Who are you, old man!"
        [/message]
        [message]
            	speaker=Father Best
            	message= _ "I am Father Best, I have come to help you."
        [/message]
	[message]
            	speaker=Swen
            	message= _ "Great peasants and priests! This is a hell of an army."
        [/message]
        [message]
            	speaker=Father Best
            	message= _ "I am also a trained healer."
        [/message]
        [message]
            	speaker=Swen
            	message= _ "Welcome to the Red Team, Father, it's a privilage to work with you."
        [/message]
        [message]
            	speaker=Lee
            	message= _ "SIR! We gonna fight, or what?"
        [/message]
        [message]
            	speaker=Swen
            	message= _ "I suppose, but let me grab a soda and take a piss first?"
        [/message]
        [message]
            	speaker=Lee
            	message= _ "Soda, sir?"
        [/message]
        [message]
            	speaker=Swen
            	message= _ "It's another of those future things-- brb"
        [/message]

[/event]

[event]
name=moveto
        
	[filter]
            	side=1

            	[filter_location]
                	x,y=22,7
                	radius=5
            	[/filter_location]
        [/filter]

        [message]
             	speaker=Enemy Lieutenant
                message= _ "You'll never take this keep!"
        [/message]
	[message]
		speaker=Swen
		message= _ "Soon, very soon."
        [/message]
[/event]

[event]
name=die
	
	[filter]
            	id=Enemy Lieutenant
        [/filter]

	[message]
        	speaker=Swen
                message= _ "Welcome to forever after..."
	[/message]
	[message]
        	speaker=Enemy Lieutenant
                message= _ "Christ, forst you kill me, then you mock me? What a prick."
	[/message]

	[recall]
	    	type=General
    		id=Enemy General
	    	name= _ "Enemy General"
		side=3
    		canrecruit=yes
		x,y=38,9
	[/recall]

      	[unit]
        	type=Bowman
        	id=Senior Bowman
        	name= _ "Senior Bowman"
        	side=3
        	unrenamable=yes
		x,y=37,10
      	[/unit]

      	[unit]
        	type=Spearman
        	id=Senior Spearman
        	name= _ "Senior Spearman"
        	side=3
        	unrenamable=yes
        	x,y=38,8
      	[/unit]

      	[unit]
        	type=Heavy Infantryman
        	id=Command Sergeant
        	name= _ "Command Sergeant"
        	side=3
        	unrenamable=yes
		x,y=37,9
      	[/unit]

      	[unit]
        	type=Horseman
        	id=Scout Leader
        	name= _ "Scout Leader"
        	side=3
        	unrenamable=yes
        	x,y=36,8
      	[/unit]

	[message]
        	speaker=Enemy General
                message= _ "You bastards, they told me you where coming the other way. Send a runner! Get me more troops!"
	[/message]
	[message]
        	speaker=Scout Leader
                message= _ "Let me have a look, sir. There may not--"
	[/message]
	[message]
        	speaker=Enemy General
                message= _ "Did you hear me? Runner! Now!"
	[/message]
	[message]
        	speaker=Scout Leader
                message= _ "Yes, sir."
	[/message]
	[message]
        	speaker=Gaul
                message= _ "Looks like they're takling the bait, sir!"
	[/message]
	[message]
        	speaker=Swen
                message= _ "It does. Let's keep at them! They may pull off half the army to get at us."
	[/message]

[/event]
	   
[event]
name=die

	[filter]
            	id=Swen
        [/filter]

	[message]
		speaker=Swen
		message= _ "I have failed you men, I am sorry. Forgive me!"
	[/message]
	[message]
		speaker=Lee
		message= _ "What do we do now!"
	[/message]
	[message]
		speaker=Enemy General
		message= _ "Die with your commander!"
	[/message]
[/event]

[event]
name=moveto

	[filter]
        	side=1

            	[filter_location]
                	x,y=38,9
                	radius=5
            	[/filter_location]
        [/filter]

	[message]
		speaker=Enemy General
                message= _ "Where the hell are my troops! I was promised troops!"
        [/message]
	[message]
		speaker=Swen
		message= _ "I would offer to take you captive, but I'm sure you'd refuse."
	[/message]
	[message]
		speaker=Enemy General
		message= _ "My men have fight left in them! You have won nothing yet! Wait until those reinforcements arrive."
	[/message]
[/event]

[event]
name=die

	[filter]
		id=Enemy General
        [/filter]

	[message]
		speaker=Swen
                message= _ "Don't dispare, General, I see your reinforcements arriving now."
        [/message]
	[message]
		speaker=Enemy General
                message= _ "Now you are done for Red."
        [/message]
	[message]
		speaker=Swen
                message= _ "Of course. But... I do have a secret."
        [/message]
	[message]
		speaker=Enemy General
                message= _ "What's that, Red."
        [/message]
	[message]
		speaker=Swen
                message= _ "We're just the diversion."
        [/message]
	[message]
		speaker=Enemy General
                message= _ "You dirty [censored]..."
        [/message]
[/event]
 
[/scenario]
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."

"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: New Campaign Not Loading

Post by Elvish_Hunter »

junoslord wrote:1. Enemy General (side=3) doesn't recruit.
I said to use the [allow_recruit] tag, not to give him a recruit= key. If you want to use the recruit= key, this needs to be placed into the [side] tag.
junoslord wrote:2. Villages don't begin under side=3 control.
A side without leader cannot control villages. You can assign these villages to side 2, and when the leader of side 3 appears, assign the villages to side 3 with [capture_village].
junoslord wrote:3. After Enemy General killed scenario doesn't end.
Because you're using victory_when_enemies_defeated=no, but you didn't add the [endlevel] result=victory tag in the general killed event.
junoslord wrote:I saved the game so I can just reload there, does this work? Or do I need to completely start over every time I edit?
Autosaves and manualy saved games have the scenario code embedded. You must always use a start-of-scenario save to load all your changes.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Post Reply