Rotate Area WML not working on 1.14.x

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
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2340
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Rotate Area WML not working on 1.14.x

Post by Lord-Knightmare »

This has been bugging me since I was working on HoI1 back when Wesnoth 1.12 was the latest (stable) release. I was fascinated by the Rotating Area LUA introduced in The Devil's Flute and wanted to include it in my campaign but it doesn't work as intended in Wesnoth 1.14.x
Results of applying the macro:
1. Intended effect is achieved but,
2. Map becomes Invalid, and
3. All save files (autosaves, manual saves, etc) are shown as corrupted after the area rotates.
I have tried to fix this myself several times, but the only results I got was headaches
Hence, my posting the entire codes here, hoping that someone could shed some light as to why this is going wrong.
rotate-area.lua file:
#defines for this to work:
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Rotate Area WML not working on 1.14.x

Post by Ravana »

[scenario][lua] is not documented at least. Normally you would include it in preload.

> move_units=true
Better to write "yes", then Lua receives it as boolean instead of string. I think 1.8 is last wesnoth version where using true/false in WML was supported.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2340
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Rotate Area WML not working on 1.14.x

Post by Lord-Knightmare »

[scenario][lua] is not documented at least. Normally you would include it in preload.
Can you please elaborate on this? Perhaps with an example code segment of sorts? Is there a [preload][/preload] WML tag that I am not aware of?
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Rotate Area WML not working on 1.14.x

Post by Pentarctagon »

99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Rotate Area WML not working on 1.14.x

Post by gfgtdf »

[scenario][lua] is documented at the luawml wiki page and it is actually reccomened _not_ to use preload events to load Lua because some things like defining custom effects, only work properly from [Lua] in scenario and not when loading Lua in preload.

For the actual issue, I think you asked this already, and I told you already there is at least one bug not in your Lua code but the the wml macro that uses it.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Rotate Area WML not working on 1.14.x

Post by Ravana »

I mean that [lua] is not supported in [scenario] https://wiki.wesnoth.org/ScenarioWML
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Rotate Area WML not working on 1.14.x

Post by gfgtdf »

But it is, the second sentence in https://wiki.wesnoth.org/LuaWML says that. if the scenariowml page does not mention it then, it's just missing there.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Rotate Area WML not working on 1.14.x

Post by Ravana »

Added.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2340
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Rotate Area WML not working on 1.14.x

Post by Lord-Knightmare »

> move_units=true
Better to write "yes", then Lua receives it as boolean instead of string. I think 1.8 is last wesnoth version where using true/false in WML was supported.
I did this rectification in the code and this was the result:
Screenshot 2019-01-18 at 03.43.26.png
Am I missing some other correction that I am supposed to make?
Off-Topic:
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Rotate Area WML not working on 1.14.x

Post by gfgtdf »

which wesnoth version are you using for testing ?
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2340
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Rotate Area WML not working on 1.14.x

Post by Lord-Knightmare »

1.14.5

Edit: Not possible to generate save files anymore. Keeps spamming that error message.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Rotate Area WML not working on 1.14.x

Post by gfgtdf »

ok what i said lat time viewtopic.php?f=8&t=43290&start=15#p591503 still holds.

Furthermore it seems like tagnames do no longer allow underscrores as first caracter (__RA_stored_units in your lua code)
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2340
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Rotate Area WML not working on 1.14.x

Post by Lord-Knightmare »

Furthermore it seems like tagnames do no longer allow underscrores as first caracter (__RA_stored_units in your lua code)
So, I edit all of those variable names with underscores into something else?
Screenshot 2019-01-18 at 04.34.12.png
Screenshot 2019-01-18 at 04.33.39.png
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Rotate Area WML not working on 1.14.x

Post by gfgtdf »

yes
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Post Reply