Option limit?

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
Ravana
Forum Moderator
Posts: 2452
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Option limit?

Post by Ravana »

Ageless changelog viewing is implemented mostly in Lua - https://github.com/ProditorMagnus/Agele ... gelogs.lua - options are all changelog versions there. In this case I hardcoded list of options, but you can also dynamically generate it with table.insert.

Using Lua in that way requires at least some understanding of WML stored in Lua - https://wiki.wesnoth.org/LuaWML#Encodin ... Lua_tables

But the options action can be just T.fire_event - which lets you switch back to event implemented in WML.
User avatar
lhybrideur
Posts: 145
Joined: July 9th, 2019, 1:46 pm

Re: Option limit?

Post by lhybrideur »

LordAwsomeness wrote: March 4th, 2020, 1:43 pm
lhybrideur wrote: March 4th, 2020, 12:30 pm BTW, you should take a look at LotI item management system.
I modified it for my add-on (Legens of Idaamub), so maybe you can modify it too for your purpose.
Thank you for the suggestion. I'll definitely download it and see what I think after I get off of work today. Are you suggesting it because you have seen my current inventory system or just because you see that I have an inventory and weapon swapping system?
The latter
hay207
Double Style Tourney #1 Champ
Posts: 93
Joined: November 26th, 2009, 5:46 am
Location: Egypt

Re: Option limit?

Post by hay207 »

lhybrideur wrote: March 4th, 2020, 12:30 pm BTW, you should take a look at LotI item management system.
I modified it for my add-on (Legens of Idaamub), so maybe you can modify it too for your purpose.
Hello, Can you clarify what's Lotl, and where to find it?

Edit: found it, legend of the Invincibles.
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
hay207
Double Style Tourney #1 Champ
Posts: 93
Joined: November 26th, 2009, 5:46 am
Location: Egypt

Re: Option limit?

Post by hay207 »

After seeing equip_macros.txt,

Can u reduce number of macros by using [case] switch for every group of weapons?
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
User avatar
LordAwsomeness
Posts: 198
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Option limit?

Post by LordAwsomeness »

hay207 wrote: March 12th, 2020, 12:33 pm After seeing equip_macros.txt,

Can u reduce number of macros by using [case] switch for every group of weapons?
probably, however ive never tried [case] and switch so I would have to figure that out.

EDIT:
I would like to use [case] and [switch] for equip_macros.cfg however I dont think it's possibly since it doesn't accept Boolean variables. Boolean variables is a huge part of how I have coded the weapon switching to work :/
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
User avatar
Ravana
Forum Moderator
Posts: 2452
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Option limit?

Post by Ravana »

I changed yes/no to ORM_bool_true as workaround for that some years ago.
User avatar
lhybrideur
Posts: 145
Joined: July 9th, 2019, 1:46 pm

Re: Option limit?

Post by lhybrideur »

I personally directly use 0 as false and 1 as true most of the time.
Post Reply