Beastss's WML Questions & Answers

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
Beastss
Posts: 15
Joined: December 23rd, 2007, 9:57 am

Beastss's WML Questions & Answers

Post by Beastss »

Hello and Welcome All,

After asking a bunch of questions here, 'Blueblaze' told me that I should just make a single topic that hosts all my questions. Then 'irrevenant' said that wouldn't help anyone cause it would just have a single large topic with answers all over the place. Which wouldn't help anyone with the same questions that I asked, so I decided to take both of their ideas and merge them in to one.
After asking any questions that I might have, when the answer is posted (and I realize it), I will edit this first post with them. It will have a quote of what the person actually said, and I will try to add a little of my own description to it. In my description, I will try to be as clear as I can so that any new people that come along could read this topic and understand instead of just coping what was written. To help me, I would like to ask that if you give an answer, please try to describe a little of what it means and how it works. Not all of us understand WML.
So if you need any help, feel free to ask me, and if I don't get it, I will bug someone else with the question!

Question 1 (Version 1.2.8 {1-4-08}): Is it possible to make an option in the shop appear/disappear or change according to a certain variable (amount of gold in this case)?
Blueblaze wrote: [option] *1
message=_ "#Wooden Longbow (2-3 R, P): 150g"
[show_if] *2
[variable] *3
name=gold
less_than=150
[/variable]
[/show_if]
[/option]

[option]
message=_ "Wooden Longbow (2-3 R, P): 150g"
[show_if]
[variable] *4
name=gold
greater_than=150
[/variable]
[/show_if]
[command] *5
[message]
message=_ "Hi"
[/message]
[/command]
[/option]
*1) The '[option]' tag tells the system to give the user an option/choice that can be chosen. The text displayed to the user is what is described in the 'message="whatever-you-put"' (the number sign/pound sign '#' at the beginning of a string/line of text tells the system that the color will be red. For more information click here.
*2) The '[show_if]' tag tells the system to only show when the conditional statement is met. If the statement is met, then the option is shown and can be available to the user. Click here.
*3) The '[variable]' tag is used for predetermined system variables, in this case it would be 'gold'. correction? Also, it is asking the system if this variable is 'less than' this value. Click here.
*4) Same as above, but checks the variable of gold for 'greater than' the value. Click here.
*5) The '[command]' tag tells the system what happens when this option is selected. Click here.
All information displayed here is used for this certain set of code. I'm not sure how it works with other sets of code, so if you find more uses, let me know.


Question 2 (Version 1.2.8 {1-4-08}): Could you replace an attack instead of just 'buying' new ones from the shop?
Beastss wrote: [option]
message=_ "Bronze Dagger (2-4 M, B): 100g"
[command]
[if] *1
[variable]
name=gold
greater_than_equal_to=100
[/variable]
[then] *2
[gold]
amount=-100
side=$side_number
[/gold]
[object] *3
silent=yes
[effect] *4
apply_to=attack
range=melee
set_name=Bronze Dagger *5
set_type=blade *5
increase_damage=-100 *5
increase_attacks=-100 *5
[/effect]
[effect]
apply_to=attack *6
range=melee *6
increase_damage=1 *6
increase_attacks=3 *6
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]

*1) The '[if] tag tells the system that an if/then statement is beginning, and if the statement(s) before the '[then]' tag are met, continue. Click here.
*2) The '[then]' is the completion of the if/then statement. When all conditions are met, the system will continue past this point, otherwise it will not. Click here.
*3) The '[object]' tag lets the system know that an "item" so to speak, will have an effect to the game. The statement of 'silent=yes' tells the system that this item will not need confirmation from the user. correction? Click here.
*4) The '[effect]' tag describes what this 'object' will do. The statement of 'apply_to' tells what the object will affect. In this case its an attack, however there could be many attacks so there is another level of specification (in this case it refers to the attack with the 'range' of 'melee'). This code doesn't only affect a single attack though, it affects all attacks with the melee range. Click here.
*5) The statements 'set_name, set_type, increase_damage, increase_attacks' are all now telling the system that whatever 'attack'(s) with 'melee' range that fit that description will be changed to what is put in these fields for that character. The reason -100 is put in for damage and attacks is because I wanted to reduce whatever the amount of damage and attacks there are up to 100 of them down to 0. However, 0 cannot be the amount of attacks or the damage capable of being done. So it will always be reduced to 1, up to 100 points being removed. Click here.
*6) Now that I have reduced the number of attacks and the damage to 1, I can increase it to what I want the new weapon to have. It is not that simple though, because I close the last '[effect]' tag, I have to open another one to include this new effect that will happen after the last one has been completed. Also, I had to specify what this new effect will occur to, thus the same fields as before but without having to change the name or type of damage. Just have to increase the amount of damage and number of strikes from 1. Click here.
All information displayed here is used for this certain set of code. I'm not sure how it works with other sets of code, so if you find more uses, let me know.


Question 3 (Version 1.2.8 {1-6-08}): Is there any way to put an image next to a new attack so that it looks like the attacks already there?
Post Reply