[modification] [options] conditions [solved]
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.
[modification] [options] conditions [solved]
Basically i have a modification with some options. But want a player only to be able to choose 1 condition.
For example:
What can i do to make it so that only 1 checkboxe can be selected?
For example:
Code: Select all
[options]
[checkbox]
id=drg_rps
name=_"The Rock Paper Scissors Alliance"
description=_"."
default=yes
[/checkbox]
[checkbox]
id=drg_dec
name=_"The Declaration Alliance"
description=_"."
default=no
[/checkbox]
[checkbox]
id=drg_none
name=_"Default Alliance"
description=_"."
default=no
[/checkbox]
[/options]
Last edited by The_Gnat on July 14th, 2017, 4:28 am, edited 3 times in total.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: [modification] [options] [checkbox] conditions [solved]
I solved this problem in record time The answer is: Use a combo box!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
[campaign] [options] problem
Unfortunately i am having another problem which seems to be appearing for no reason.
In 1.12 i have created a slider in a
Have i done something wrong here?
Thank you!
In 1.12 i have created a slider in a
[campaign]
and in a [options]
tag. Unfortunately it shows no options in the "Configure Game" menu.Spoiler:
Code: Select all
# ...
[options]
[slider]
id=drg_alliances_slider
name=_"Dragon Lair ..."
description=_"Choose a ..."
default=0
min=0
max=2
step=1
[/slider]
[/options]
[/campaign]
Thank you!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
-
- Developer
- Posts: 546
- Joined: January 12th, 2011, 2:18 am
- Location: Pennsylvania, USA
Re: [campaign] [options] problem
In 1.12, options for a campaign need to be in the first [scenario].
Your example should work as is for 1.13, as in 1.13, as there options need to be directly in [campaign].
Your example should work as is for 1.13, as in 1.13, as there options need to be directly in [campaign].
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
Re: [modification] [options] conditions
Oh that is why it worked in 1.13 and no matter what i did it wouldn't in 1.12...
Thank you very much! I would have probably never figured it out (perhaps someone could put a note in this wiki page )
Thank you very much! I would have probably never figured it out (perhaps someone could put a note in this wiki page )
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
-
- Developer
- Posts: 546
- Joined: January 12th, 2011, 2:18 am
- Location: Pennsylvania, USA
Re: [modification] [options] conditions
Updated, thanks.The_Gnat wrote:...(perhaps someone could put a note in this wiki page )
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
Re: [modification] [options] conditions
Unfortunately even when i put the [options] inside the [scenario] it did not work. The options load now and a combo box appears... But it does not do anything.
Here is my code:
Like i said it shows the combo box but does not create a variable from it...
Thank you for your help!
Here is my code:
Code: Select all
[scenario]
#ifver WESNOTH_VERSION < 1.13.0
[options]
[combo]
id=drg_alliances_op
name=_"Dragon Lair alliance system"
description=_"Choose what alliance system to use."
default=none
[item]
name="The Rock Paper Scissors Alliance"
value=rockpaperscissors
[/item]
[item]
name="The Declaration Alliance"
value=declare
[/item]
[item]
name="The Default Wesnoth Alliance"
value=none
[/item]
[/combo]
[/options]
#endif
# ... the rest of the scenario
Thank you for your help!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
-
- Developer
- Posts: 546
- Joined: January 12th, 2011, 2:18 am
- Location: Pennsylvania, USA
Re: [modification] [options] conditions
The_Gnat wrote:Unfortunately even when i put the [options] inside the [scenario] it did not work. The options load now and a combo box appears... But it does not do anything.
Here is my code:
Like i said it shows the combo box but does not create a variable from it...Code: Select all
[scenario] #ifver WESNOTH_VERSION < 1.13.0 [options] [combo] id=drg_alliances_op name=_"Dragon Lair alliance system" description=_"Choose what alliance system to use." default=none [item] name="The Rock Paper Scissors Alliance" value=rockpaperscissors [/item] [item] name="The Declaration Alliance" value=declare [/item] [item] name="The Default Wesnoth Alliance" value=none [/item] [/combo] [/options] #endif # ... the rest of the scenario
Thank you for your help!
Not sure what's going with your situation. I tested the #ifver / [option] code by plugging it into Random Campaign for 1.12, and it created the drg_alliances_op variable just fine.
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
Re: [modification] [options] conditions
1.12 has another options bug, if you have options saved in your preferences file, they wont work correctly after you change them in scenario.
Re: [modification] [options] conditions
@SigurdFireDragon - That is odd... i have attached the add-on so you can look at it, perhaps i made some mistake in the scenario which is causing issues (however, it is odd because before when i had my [options] in a [modification] tag it worked fine)
@Ravana - So is there something i can do about this?
Thank you again!
@Ravana - So is there something i can do about this?
Thank you again!
- Attachments
-
- Dragon_Lair.zip
- (454.22 KiB) Downloaded 163 times
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
-
- Developer
- Posts: 546
- Joined: January 12th, 2011, 2:18 am
- Location: Pennsylvania, USA
Re: [modification] [options] conditions
Tested it with 1.12.6, the variable was created fine.The_Gnat wrote:@SigurdFireDragon - That is odd... i have attached the add-on so you can look at it, perhaps i made some mistake in the scenario which is causing issues (however, it is odd because before when i had my [options] in a [modification] tag it worked fine)
There's a good chance the error could be this.Ravana wrote:1.12 has another options bug, if you have options saved in your preferences file, they wont work correctly after you change them in scenario.
It's a bug with option handling that I believe has been fixed for 1.13
To fix it in 1.12, open your userdata/preferences file and look for the [options] section
Below is what it showed for me in the preferences file when I got it to work. You want to make sure that none of the id values below are repeated elsewhere in the [options] section, & that the ones in the file match with your add-on for all id's. Once the conflicts are removed, it should work.
Code: Select all
[multiplayer]
id="01_dragon_lair"
[option]
id="drg_alliances_op"
value="none"
[/option]
[/multiplayer]
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
Re: [modification] [options] conditions [solved]
Ah yes!! That worked prefectly thank you Ravana and SigurdFireDragon!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.