AssassinT90's questions
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.
-
- Posts: 39
- Joined: December 20th, 2007, 9:47 am
AssassinT90's questions
Could someone post an example on how to use the "[show_if]" subtag of "[set_menu_item]" tag?
I was wondering how I set the menu item to be showed only if the variable "Z" is equal to "1".
Edited:
P1RECRUIT=1
P2RECRUIT=1
How to use those values like this: $P"$side_number"Recruit = $P1RECRUIT in side 1's turn?
$P$side_number|RECRUIT doesn't work.
Edited 2:
With thye help of a friend, I could do it.
I'll keep this post open to post all my next questions. Thank ya.
I was wondering how I set the menu item to be showed only if the variable "Z" is equal to "1".
Edited:
P1RECRUIT=1
P2RECRUIT=1
How to use those values like this: $P"$side_number"Recruit = $P1RECRUIT in side 1's turn?
$P$side_number|RECRUIT doesn't work.
Edited 2:
With thye help of a friend, I could do it.
I'll keep this post open to post all my next questions. Thank ya.
-
- Posts: 39
- Joined: December 20th, 2007, 9:47 am
Re: AssassinT90's questions
I'm in trouble, people. Who could help me???
Ok, ok, there's the code. Now, the problem:
The first message is right, "4=4".
However, the second one is wrong. It appears: "4=0"
Even if I use the following code it is still "4=0".
______________________________________________________________________________
Second problem:
Supposing that I want make the number greater than 0.6, and less than 0.8, to be 10, is this right?
Spoiler:
The first message is right, "4=4".
However, the second one is wrong. It appears: "4=0"
Even if I use the following code it is still "4=0".
Spoiler:
______________________________________________________________________________
Second problem:
Spoiler:
Spoiler:
Re: AssassinT90's questions
First of all, stop using numbers as variable names... that's just confusing.
Second, you forgot to tell what version you are using.
Third, if you read the documentation of [set_variable] ( http://wiki.wesnoth.org/InternalActions ... ariable.5D ), then you will see where it says "If both variables are integers, Integer division is used."
Second, you forgot to tell what version you are using.
Third, if you read the documentation of [set_variable] ( http://wiki.wesnoth.org/InternalActions ... ariable.5D ), then you will see where it says "If both variables are integers, Integer division is used."
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
-
- Posts: 39
- Joined: December 20th, 2007, 9:47 am
Re: AssassinT90's questions
First: Ok, I'll try.Sapient wrote:First of all, stop using numbers as variable names... that's just confusing.
Second, you forgot to tell what version you are using.
Third, if you read the documentation of [set_variable] ( http://wiki.wesnoth.org/InternalActions ... ariable.5D ), then you will see where it says "If both variables are integers, Integer division is used."
Second: 1.6.5
Third: For accuracy I just gave up using divisions, now I'm multiplying instead of dividing, works great when its a fix value, but when I get a variable...
Another question:
Is there any way of rounding non-intenger numbers to intenger numbers?
I generally use {IF_VAR} macro when I can predict the possible results, but that's kinda stressful, gives me giant codes, and I can't predict the possible resulsts always.
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: AssassinT90's questions
AssassinT90 wrote: Another question:
Is there any way of rounding non-intenger numbers to intenger numbers?
Sapient wrote:read the documentation of [set_variable] ( http://wiki.wesnoth.org/InternalActions ... ariable.5D )
-
- Posts: 39
- Joined: December 20th, 2007, 9:47 am
Re: AssassinT90's questions
Yeah, I was about to edit that question =DKen_Oh wrote:AssassinT90 wrote: Another question:
Is there any way of rounding non-intenger numbers to intenger numbers?Sapient wrote:read the documentation of [set_variable] ( http://wiki.wesnoth.org/InternalActions ... ariable.5D )