expand IF usefulness
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
- Darker_Dreams
- Posts: 608
- Joined: February 1st, 2008, 5:26 pm
expand IF usefulness
I don't know if you still can't nest If's in WML (I missed it in the changelogs if you can now), but that would be cool.
the idea/request I'm more interested in is the ability to use if within [objectives] tags, to make individual [objective]s show/disappear as a scenario develops. Every other component of a scenario can be timed and triggered, but right now I have to list every possible combination of objectives at every phase in a scenario for them to be useful. Generally, this isn't a problem, but I've had this become (*very*) unwieldy at least once with a scenario where discovery of what's going on in the area is a significant feature.
-------Edit--------
I'm adding this information in an effort to clarify the "problem" to which I am attempting to create a "solution," and to demonstrate that it's not simply an attempt to get "nifty features."
The source of this post is from the discussion at;
http://www.wesnoth.org/forum/viewtopic.php?f=21&t=20617
The goal of the idea is to allow a list of objectives to be partially changed mid-scenario. This would allow somewhat less linear scenarios in which several "story lines" could be pursued at different paces without requiring every possible combination of objectives be listed.
the idea/request I'm more interested in is the ability to use if within [objectives] tags, to make individual [objective]s show/disappear as a scenario develops. Every other component of a scenario can be timed and triggered, but right now I have to list every possible combination of objectives at every phase in a scenario for them to be useful. Generally, this isn't a problem, but I've had this become (*very*) unwieldy at least once with a scenario where discovery of what's going on in the area is a significant feature.
-------Edit--------
I'm adding this information in an effort to clarify the "problem" to which I am attempting to create a "solution," and to demonstrate that it's not simply an attempt to get "nifty features."
The source of this post is from the discussion at;
http://www.wesnoth.org/forum/viewtopic.php?f=21&t=20617
The goal of the idea is to allow a list of objectives to be partially changed mid-scenario. This would allow somewhat less linear scenarios in which several "story lines" could be pursued at different paces without requiring every possible combination of objectives be listed.
Last edited by Darker_Dreams on September 26th, 2008, 8:26 pm, edited 1 time in total.
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: expand IF usefulness
You can't nest [if]? I do it all the time.
- Darker_Dreams
- Posts: 608
- Joined: February 1st, 2008, 5:26 pm
Re: expand IF usefulness
like I said, I know at one point it was verboten... if that changed I must have missed it.
I only added that because I was already posting because I wanted to suggest/ask about [IF]ing [objective]s.
I only added that because I was already posting because I wanted to suggest/ask about [IF]ing [objective]s.
- Darker_Dreams
- Posts: 608
- Joined: February 1st, 2008, 5:26 pm
Re: expand IF usefulness
unless I'm completely missing something, this is how I end up with roughly x^y [objectives] blocks each of which minor variations on one another.sapient wrote:However, another way to accomplish your goal would be to support [if] inside the [scenario] tag to allow conditional modification before the prestart event.
I'm not sure how if-ing, the following [objectives] is less convoluted than having to list each possible combination of [objectives] seperately with their own, external, [if] triggers. Finally, (and this may be my own ignorance) I'm also not sure how outsourcing the [objectives] to a macro does anything but export the same insanity to a seperate file.
(the above is a, slighly modified and significantly trimmed, general outline of a scenario I've been working on)[objectives]
[if]
[variable]
name=Find_Castle
equals=no
[/variable]
[then]
[objective]
description= _"Check with the local lord."
condition=win
[/objective]
[/then]
[/if]
[if]
[variable]
name=search_villages
equals=no
[/variable]
[then]
[objective]
description= _"Check all villages"
condition=win
[/objective]
[/then]
[/if]
[if]
[variable]
name=find_villian
equals=no
[/variable]
[then]
[objective]
description= _"Find the source of the raiders"
condition=win
[/objective]
[/then]
[/if]
[if]
[variable]
name=find_villian
equals=no
[/variable]
[and]
[variable]
name=find_kill_villian
equals=no
[/variable]
[then]
[objective]
description= _"Kill the bandit leader."
condition=win
[/objective]
[/then]
[/if]
[objective]
description= _"Your hero dies"
condition=lose
[/objective]
[/objectives]
Re: expand IF usefulness
Code: Select all
#define MY_OBJECTIVES CURRENT
[objectives]
[objective]
description={CURRENT}
condition=win
[/objective]
[objective]
description= _ "Your hero dies"
condition=lose
[/objective]
[/objectives]
#enddef
{MY_OBJECTIVES ( _ "Current goal" ) }
Besides, how should your example work, should the game check those variables every turn to see whether they've changed?
- Darker_Dreams
- Posts: 608
- Joined: February 1st, 2008, 5:26 pm
Re: expand IF usefulness
I could be misreading what you've put together, but you essentially have a macro that will allow a single objective to be passed to an external [objectives] tag. I suppose you could expand it to accept more variables, allowing a longer list of objectives to be passed (and just leave some "empty" if you don't need the full number at the moment)... but is that really more elegant? Especially since you still have to have the full lists of possible combinations, each within their own [if] tag.AI wrote:Yes, it will expand to quite a bit of wml, but allowing [if] everywhere is ugly on the implementation end.Code: Select all
...
It would check the same time it checks when you put the [if] outside the [objectives] tag... if that requires an [event] to define, is it really going to be more ugly than a string ofAI wrote:Besides, how should your example work, should the game check those variables every turn to see whether they've changed?
Code: Select all
[if][objectives][objective][objective][objective]...[/objectives][/if][if][objectives][objective][objective][objective]...[/objectives][/if]...
Code: Select all
[if]{MY_OBJECTIVES ( _ "Current goal1" ) (win/loss) ( _ "Current goal2" ) (win/loss) ( _ "Current goal3" ) (win/loss) }[/if][if]{MY_OBJECTIVES ( _ "Current goal1" ) (win/loss) ( _ "Current goal2" ) (win/loss) ( _ "Current goal3" ) (win/loss) }[/if]...
- Darker_Dreams
- Posts: 608
- Joined: February 1st, 2008, 5:26 pm
Re: expand IF usefulness
Added to original post in an effort to clarify my reasons for suggesting this idea.
Re: expand IF usefulness
Well, these days (in 1.5) you can do it using [insert_tag].
Re: expand IF usefulness
You can make the objective a value of a variable and have that variable change depending on conditions, can't you?
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
Re: expand IF usefulness
That's the easier way.
- Darker_Dreams
- Posts: 608
- Joined: February 1st, 2008, 5:26 pm
Re: expand IF usefulness
AI wrote:Well, these days (in 1.5) you can do it using [insert_tag].
Ah, looking at the [insert_tag] I wasn't clear on how that would work.A Guy wrote:You can make the objective a value of a variable and have that variable change depending on conditions, can't you?
I do have to admit would be a clear improvement over having to list every possible combination of variables statically.
It does, however, still require the objective have a definite and static (maximum) number of objectives, and makes each objective slot a fairly clear (linear) track. Primarily for this reason I still think that [if]ing would be better in terms of campaign design.
On the up side, however- as I understand it, if this works as advertised it should allow me to change the objective when whatever other events are happening. I'll have to make sure I understand how this works to be certain of that though.
-
- Posts: 547
- Joined: August 11th, 2008, 3:19 pm
Re: expand IF usefulness
sorry for resurrecting a dead thread, but I wanted to mention that this is a feature that others have sensed was lacking (myself included). I realize that it's not a pressing need, since there are a couple hacks that can be used to alleviate the problem. However, none of them are very elegant or painless, and this seems like the sort of feature that a lot of people want to use.
My contribution to the discussion would be this: steal the [show_if] tag from [message] [option]s, and use it inside of the [objective] tag:
My two cents, anyway. Sorry again for resurrecting this, but I think that Darker_Dreams' idea has merit, and it seems like it's something the people want.
--OSJ
My contribution to the discussion would be this: steal the [show_if] tag from [message] [option]s, and use it inside of the [objective] tag:
Code: Select all
[objectives]
##:: Victory Objectives
[objective]
condition=win
description= _ "Defeat all enemy leaders"
[/objective]
##:: Defeat Objectives
[objective]
condition=lose
description= _ "Death of Hero"
[/objective]
[objective]
condition=lose
description= _ "Death of Optional NPC 1"
[show_if]
[have_unit]
description=optional_npc_1
[/have_unit]
[/show_if]
[/objective]
[objective]
condition=lose
description= _ "Death of Optional NPC 2"
[show_if]
[have_unit]
description=optional_npc_2
[/have_unit]
[/show_if]
[/objective]
...
[objective]
condition=lose
description= _ "Death of Optional NPC N"
[show_if]
[have_unit]
description=optional_npc_n
[/have_unit]
[/show_if]
[/objective]
[/objective]
--OSJ
what if the Bible's claims about Christ depicted accurate, verifiable history? given some research, you might be surprised at the evidence...
Re: expand IF usefulness
I'll just add my support for this proposal; a [show_if] tag is a very good idea.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
-
- Posts: 547
- Joined: August 11th, 2008, 3:19 pm
Re: expand IF usefulness
thanks
what if the Bible's claims about Christ depicted accurate, verifiable history? given some research, you might be surprised at the evidence...