gold carryover not carrying over...

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
opensourcejunkie
Posts: 547
Joined: August 11th, 2008, 3:19 pm

gold carryover not carrying over...

Post by opensourcejunkie » April 25th, 2009, 11:08 pm

I have something of a strange problem; in my campaign (Sceptre of Life), gold is not carrying over properly from one scenario to the next. At the end of a scenario, the gold-tally dialog box pops up, and figures out how much gold will be carried over to the next scenario. Then, when the next scenario starts, the gold is set to the minimum starting balance only (the carryover simply disappears). This happened under the old (80%) carryover, and under the new (40% + minimum).

A sample of the [endlevel] code is as follows:

Code: Select all

        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
As far as I can tell, the code is correct. I'm beginning to suspect that the problem might not lie with the [endlevel] tags, but rather with the [side] tags. SoL is fairly unique in that it uses a save_id to keep track of the player's gold/units/etc. Normally, when save_id is not specified, the wesnoth engine stores player data using some default save_id. Since most campaigns just use the default save_id, I wonder if the new gold carryover system (and thus the new carryover_add key) was tested using a non-default save_id. I wonder if this might not be a bug.

That being said, I don't want to blame this on an engine bug if my own code is at fault. So please, let me know if you see anything wrong with the above code.

Thanks,
--OSJ
what if the Bible's claims about Christ depicted accurate, verifiable history? given some research, you might be surprised at the evidence...

User avatar
Suukorak
Posts: 66
Joined: April 13th, 2009, 10:01 pm

Re: gold carryover not carrying over...

Post by Suukorak » April 26th, 2009, 5:26 pm

I have made several scenarios myself, and never have I come across that problem, although I used that same exact endlevel code. I suspect it is in save_id or with some other part of your code.

P.S. I am still learning WML, so don't trust me fully.
He who is still learning WML, can still make a campaign. (or at least try)

You are an Arch Mage - You're definitely intelligent, but some people would say you spend too much time inside. The power you have learned, however, is simply unmatched.

opensourcejunkie
Posts: 547
Joined: August 11th, 2008, 3:19 pm

Re: gold carryover not carrying over...

Post by opensourcejunkie » April 29th, 2009, 8:41 am

gotcha, tx.
what if the Bible's claims about Christ depicted accurate, verifiable history? given some research, you might be surprised at the evidence...

anamiac
Posts: 2
Joined: October 13th, 2010, 12:23 am

Re: gold carryover not carrying over...

Post by anamiac » October 25th, 2010, 1:45 am

I had this problem on my campaign - it would say that I had 400 bonus gold, but when I started the next scenario the extra money wouldn't be there. Also, I couldn't recall any units. I discovered that the names of my side and leader were different in each scenario. When I setup both scenarios with the same leader and same side, then the money would carry over, and I was able to recall.

User avatar
Kapoue_II
Posts: 203
Joined: October 11th, 2010, 9:41 am

Re: gold carryover not carrying over...

Post by Kapoue_II » October 25th, 2010, 6:49 am

Can we see the code for the side id stuff please?

Anonymissimus
Inactive Developer
Posts: 2460
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: gold carryover not carrying over...

Post by Anonymissimus » October 25th, 2010, 10:42 am

Afaik starting with 1.8 you put [side]save_id=xyz when that side appears in its first scenario. Is it meant to reappear you put again [side]save_id=xyz. Recall list including all leaders and gold should all be correctly handled. Note that the [side]side=some_number may change between the scenarios.
Afaik LoW has some code experimenting with it.

EDIT
You also need to put persistent=yes key at all places where you put save_id=xyz. Actually not sure whether it needs to be everywhere, just didn't try. At least it works for a single human player then.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign

Post Reply