set difficulty in a scenario?
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.
set difficulty in a scenario?
Hi, i have something to ask, it's been bugging me for a long time, the problem is that how do you set difficulty in a scenario? i know how to do it in a campaign, but i need some insights on a scenario level.
I need the following things in WML codes:
-A unit from side 1 at the start of the game must moves to location 17,17, it triggers an event and pops up a window saying to choose difficulty, then the users choose from three different difficulty (easy, medium, hard)
-on easy side 1,2,3 gets 100 gold
-on medium side 1,2,3,4,5,6 all gets 100 gold
-on hard side 1,2,3 gets 50 gold, 4,5,6 gets 100.
Thanks in advance for answering.
I need the following things in WML codes:
-A unit from side 1 at the start of the game must moves to location 17,17, it triggers an event and pops up a window saying to choose difficulty, then the users choose from three different difficulty (easy, medium, hard)
-on easy side 1,2,3 gets 100 gold
-on medium side 1,2,3,4,5,6 all gets 100 gold
-on hard side 1,2,3 gets 50 gold, 4,5,6 gets 100.
Code: Select all
[multiplayer]
id=multiplayer_Battle1
name= _ "3p - Battle1"
map_data="{maps/multiplayer/6p_Battle1}"
description= _ "Use map settings."
{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}
[side]
[ai]
village_per_scout=12
[/ai]
side=1
canrecruit=1
controller=human
gold=50
village_gold=3
fog=yes
[/side]
[side]
[ai]
village_per_scout=12
[/ai]
side=2
canrecruit=1
controller=human
gold=50
village_gold=3
fog=yes
[/side]
[side]
[ai]
village_per_scout=12
[/ai]
side=3
canrecruit=1
controller=human
gold=50
village_gold=3
fog=yes
[/side]
[side]
[ai]
village_per_scout=12
[/ai]
side=4
canrecruit=1
controller=ai
gold=50
village_gold=3
fog=yes
[/side]
[side]
[ai]
village_per_scout=12
[/ai]
side=5
canrecruit=1
controller=ai
gold=50
village_gold=3
fog=yes
[/side]
[side]
[ai]
village_per_scout=12
[/ai]
side=6
canrecruit=1
controller=ai
gold=50
village_gold=3
fog=yes
[/side]
[/multiplayer]
The following approach should work for both multi- and single player:
Write a moveto-event that triggers when side=1 and x,y=17,17
In that event, use [message] to display a prompt, and inside it, an [option] for each difficulty setting you want. In each option, you use [gold] to give the corresponding side(s) additional gold.
I leave the details for you to work out. The wml reference is your friend.
Write a moveto-event that triggers when side=1 and x,y=17,17
In that event, use [message] to display a prompt, and inside it, an [option] for each difficulty setting you want. In each option, you use [gold] to give the corresponding side(s) additional gold.
I leave the details for you to work out. The wml reference is your friend.
- Bob_The_Mighty
- Posts: 870
- Joined: July 13th, 2006, 1:15 pm
Code: Select all
[event]
name=moveto
[filter]
x=17
y=17
side=1
[/filter]
[message]
speaker=narrator
caption="Difficulty"
message= _ "Choose a difficulty level."
[option]
message= _ "Easy"
[command]
[gold]
side=1
amount=100
[/gold]
[gold]
side=2
amount=100
[/gold]
[gold]
side=3
amount=100
[/gold]
[/command]
[/option]
[option]
message= _ "Medium"
[command]
[gold]
side=1
amount=100
[/gold]
[gold]
side=2
amount=100
[/gold]
[gold]
side=3
amount=100
[/gold]
[gold]
side=4
amount=100
[/gold]
[gold]
side=5
amount=100
[/gold]
[gold]
side=6
amount=100
[/gold]
[/command]
[/option]
[option]
message= _ "Hard"
[command]
[gold]
side=1
amount=50
[/gold]
[gold]
side=2
amount=50
[/gold]
[gold]
side=3
amount=50
[/gold]
[gold]
side=4
amount=100
[/gold]
[gold]
side=5
amount=100
[/gold]
[gold]
side=6
amount=100
[/gold]
[/command]
[/option]
[/message]
[/event]
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
For starters, there could be more examples, just giving out tags and several sentences about how you should use it doesn't sound straightforward to me. There is no clearly organized section about what kind of WML should you use if you want to set difficulty, set the turns to change according to user actions, all this code is hard to find unless you dig through some very complex sections (the variableWML is probably one of the most confusing)meriton wrote:I think it is - if you take the time to read it. If it isn't, please point out how it could be improved.The WML reference isn't really helpful
Maybe people here got an uncanny knack to find and decipher WMLs, but from my looks of it, the reference isn't that helpful.
BTW, thanks for the codes, Bob! You sure saved me the time and fraustration to go through and find everything!
Yes, the WML reference is certainly not useful in learning WML when you don't know where to start. It's only useful in learning what specific tags do when you already know how things generally work and you already do more or less what you want to do.
We have no good "WML for beginners" tutorial, and probably won't be getting one anytime soon either. Which is a shame of course, but I'm afraid not many people who would be capable of writing something like that would be very interested in doing so.
We have no good "WML for beginners" tutorial, and probably won't be getting one anytime soon either. Which is a shame of course, but I'm afraid not many people who would be capable of writing something like that would be very interested in doing so.
The thing is you have to download bunch of add-ons just to view their codes, most of the advanced codes isn't built into the default scenarios of wesnoth. And even sometimes the codes in the add-ons aren't exactly the ones you were looking for. So that's why the WML workshop is here.CIB wrote:When you want to learn how to do something, you do it like this:
-you look at the source of a scenario that does what you want
-you find the section that does it
-you find out, how it is done by looking all the tags up in ReferenceWM
Use [modify_turns]. http://www.wesnoth.org/wiki/DirectActionsWML