Campaign won't start

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
matsjoyce
Posts: 233
Joined: May 8th, 2011, 2:10 pm
Location: UK

Campaign won't start

Post by matsjoyce »

Hello,

I've been trying to make a campaign which you go jousting and it worked until I added a third side as spectators. After I did the that it wouldn't load. It loaded other campaigns but always crashed with mine. I've tried removing the third side but that didn't help.
Last edited by matsjoyce on July 5th, 2011, 8:28 pm, edited 1 time in total.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Campaign won't start

Post by Crendgrim »

You should post your campaign here (archive the campaign dir as a .zip file and upload it here as an attachment), or we can only guess. And that's quite impossible, because you could have done a lot wrong.


Crend
UMC Story Images — Story images for your campaign!
User avatar
matsjoyce
Posts: 233
Joined: May 8th, 2011, 2:10 pm
Location: UK

Re: Campaign won't start

Post by matsjoyce »

I've tried uploading it as a .zip and as a .tar.gz and nothing happens.
User avatar
boru
Posts: 788
Joined: November 19th, 2009, 11:02 pm

Re: Campaign won't start

Post by boru »

Hard to imagine nothing at all happens. Did you click the button that says "add the file"?
“It is written in my life-blood, such as that is, thick or thin; and I can no other.” - J.R.R. Tolkien

My campaign: Swamplings - Four centuries before the founding of Wesnoth, the first wolf rider emerges from a tribe of lowly swamp goblins.
User avatar
matsjoyce
Posts: 233
Joined: May 8th, 2011, 2:10 pm
Location: UK

Re: Campaign won't start

Post by matsjoyce »

Yes, I did and at the bottom it says "uploading 1%" and it goes up to 100% and then when I post the message it isn't there.
User avatar
boru
Posts: 788
Joined: November 19th, 2009, 11:02 pm

Re: Campaign won't start

Post by boru »

matsjoyce wrote:Yes, I did and at the bottom it says "uploading 1%" and it goes up to 100% and then when I post the message it isn't there.
Okay, if that happens more than once, you need to contact a forum mod or the admin.
“It is written in my life-blood, such as that is, thick or thin; and I can no other.” - J.R.R. Tolkien

My campaign: Swamplings - Four centuries before the founding of Wesnoth, the first wolf rider emerges from a tribe of lowly swamp goblins.
User avatar
matsjoyce
Posts: 233
Joined: May 8th, 2011, 2:10 pm
Location: UK

Re: Campaign won't start

Post by matsjoyce »

O.K. I have established that the max file size is 2MB so I deleted some unneeded things so here it is.
Attachments
jousting.zip
The campaign file
(471.3 KiB) Downloaded 234 times
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Campaign won't start

Post by Ceres »

a) don't put whitespaces in filenames
b) SIR_BORIS isn't defined anywhere
User avatar
Pentarctagon
Project Manager
Posts: 5730
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Campaign won't start

Post by Pentarctagon »

Ceres wrote:b) SIR_BORIS isn't defined anywhere
Which is, ironically, exactly what the error message said.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
matsjoyce
Posts: 233
Joined: May 8th, 2011, 2:10 pm
Location: UK

Re: Campaign won't start

Post by matsjoyce »

I found a space in one of the file names and deleting it seemed to help.
User avatar
matsjoyce
Posts: 233
Joined: May 8th, 2011, 2:10 pm
Location: UK

Jousting var

Post by matsjoyce »

I had an idea of having the lance weapon of the knights attack value go down each time you attack and I came up with the following code:

Code: Select all

  
 #define INITIALIZE_SCENARIO_VARIABLES
	{VARIABLE Mlance -2}
	{VARIABLE Blance -2}
 #enddef
 #define CLEAR_SCENARIO_VARIABLES
	{CLEAR_VARIABLE Mlance}
	{CLEAR_VARIABLE Blance}
 #enddef  [side]
        type="Knight"
        id="Sir_Miles"
        canrecruit=yes
        name=_"Sir Miles"
        unrenamable=yes
        side=1
        controller=human
        {GOLD 0 0 0}
        income=0
        team_name="Sir_Miles"
        user_team_name=_"Sir_Miles"
        fog=no
        shroud=no
        recruit=""
            [modifications]
                [object]
                    [effect]
                        apply_to=attack
                        type=pierce
                        increase_damage=$Mlance
                    [/effect]
                [/object]
            [/modifications]
		
    [/side]
 [event]
       name=attack
        first_time_only=no
        [filter]
            id=Sir_Miles
        [/filter]
        [filter_second]
            hits=yes
        [/filter_second]
        [set_variable]
            name=Mlance
            add=-2
        [/set_variable]
    [/event]
But it doesn't work completely and as I haven't worked with variables I need help. :?
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Campaign won't start

Post by Max »

Code: Select all

[filter_second]
    hits=yes
[/filter_second]
don't invent stuff, look it up in the wiki: http://wiki.wesnoth.org/EventWML
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Jousting var

Post by zookeeper »

matsjoyce wrote:

Code: Select all

increase_damage=$Mlance
That makes it use the value of Mlance, but once once when the scenario starts. When the sides are initialized, it'll increase damage by whatever value Mlance happens to have at that time, that is it won't change if you later change the value of Mlance.
User avatar
matsjoyce
Posts: 233
Joined: May 8th, 2011, 2:10 pm
Location: UK

Re: Campaign won't start

Post by matsjoyce »

Max:
So you would do that like this?

Code: Select all

[event]
       name=attack
        first_time_only=no
        [filter]
            id=Sir_Miles
        [/filter]
       [filter_attack]
       damage=1-99
       [/filter_attack]
        [set_variable]
            name=Mlance
            add=-2
        [/set_variable]
    [/event]
zookeeper:
Umm, how could you do it then? I've never used vars before... :-?
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Campaign won't start

Post by Ceres »

No.
You want an attacker hits event.
matsjoyce wrote:Umm, how could you do it then? I've never used vars before... :-?
You have to modify the unit itself every time it hits, not only the variable.
Post Reply