Fosprey WML problems
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.
Fosprey WML problems
Update, well since i'm working a lot with the wml, and i encounter problems, and i don't want to bog down the forum with my threads, i will use this thread to post my last WML Problem, thanks to everyone that helps me
------------------------------------------
ok i have a macro
now i don't get why it isn't removed if i change
I wouldn't post it, but i've spent my last 2 hours trying to understand what i'm doing wrong, any help is appreciated.
------------------------------------------
ok i have a macro
And this is the relevant part of the event#define CE_REMOVE_UNIT X Y
[kill]
x,y=(X),(Y)
fire_event=no
animate=no
[/kill]
#enddef
The unit is created as expected but in an adjacent hex, that's because the unit isn't removed in first place.{CE_REMOVE_UNIT $x1 $y1}
{CE_GENERIC_UNIT SIDE CE_Swordsman $x1 $y1}
now i don't get why it isn't removed if i change
for{CE_REMOVE_UNIT $x1 $y1}
AND{CE_REMOVE_UNIT}
for#define CE_REMOVE_UNIT X Y
[kill]
x,y=(X),(Y)
fire_event=no
animate=no
[/kill]
#enddef
The unit on 12,4 IS REMOVED and since it's the hex i'm testing the event on, the CE_Swordsman is placed there as expected.#define CE_REMOVE_UNIT
[kill]
x,y=12,4
fire_event=no
animate=no
[/kill]
#enddef
I wouldn't post it, but i've spent my last 2 hours trying to understand what i'm doing wrong, any help is appreciated.
Last edited by Fosprey on May 7th, 2008, 11:01 am, edited 1 time in total.
Re: What's wrong with this wml?
change
and it'll work.
Your problem is using ordinary braces where you should use curly ones.
toFosprey wrote:#define CE_REMOVE_UNIT X Y
[kill]
x,y=(X),(Y)
fire_event=no
animate=no
[/kill]
#enddef
Code: Select all
#define CE_REMOVE_UNIT X Y
[kill]
x,y={X},{Y}
fire_event=no
animate=no
[/kill]
#enddef
Your problem is using ordinary braces where you should use curly ones.
Re: What's wrong with this wml?
Thanks a lot
i knew it was some stupid stuff
i knew it was some stupid stuff
Re: What's wrong with this wml?
I have another problem with the wml, i'm sure is something stupid too, but i can't get around it, i used the same thread so i don't bogg down the forum
I use Macro
what's wrong?
it took me more than two hours again, but finaly realized that i had to put some $ here and there.
I use Macro
and the macro{VARIABLE cemxp 32}
in an IF tag#define CE_CONDITION VAR TEST VALUE
[variable]
name={VAR}
{TEST}={VALUE}
[/variable]
#enddef
now, when i replace the cemxp variable, with the number i want, 32, everthing works perfect, but when i try to use it like this, nothing works.{CE_CONDITION unit.experience greater_than_equal_to cemxp}
what's wrong?
it took me more than two hours again, but finaly realized that i had to put some $ here and there.
Re: Fosprey WML problems
I readed somewhere that i can i filter locations that are recruitable and a ladder is present.
To explain it in other way, i want certain action to only happen in a castle that's connected to a keep with a leader, i readed it's possible, but i can't finde the wml tag that would help me there.
Have the resting variable on units any function? i mean no matter what i do with units, they always seem to have resting on yes on the save file. even if i set them to no, they have it yes at the next turn.
I want to filter units and only choose units that would recive the resting healing (you know the +2 heal), and i thought this to be the perfect filter, but, every unit thave the resting on yes, and NO MATTER what i do withunit, even if it waits days on the same place, move, full move, whatever, it always keep on yes. What's the function of this then?
PD:I also appreciate any help someone can provide to solve wml works on my era that can be access from my signature
To explain it in other way, i want certain action to only happen in a castle that's connected to a keep with a leader, i readed it's possible, but i can't finde the wml tag that would help me there.
Have the resting variable on units any function? i mean no matter what i do with units, they always seem to have resting on yes on the save file. even if i set them to no, they have it yes at the next turn.
I want to filter units and only choose units that would recive the resting healing (you know the +2 heal), and i thought this to be the perfect filter, but, every unit thave the resting on yes, and NO MATTER what i do withunit, even if it waits days on the same place, move, full move, whatever, it always keep on yes. What's the function of this then?
PD:I also appreciate any help someone can provide to solve wml works on my era that can be access from my signature
Re: Fosprey WML problems
Well i still need help with the obove post but i have other questions.
1) Is there anyway to edit the wml_theme so it displays an information of a variable?
2) Is there a way in the wml_theme to change colors of HP, XP and things like that?
3) Is there a way i can change the colors of the numberes that display the terrain defense of unit, when i hove the mouse over them?
1) Is there anyway to edit the wml_theme so it displays an information of a variable?
2) Is there a way in the wml_theme to change colors of HP, XP and things like that?
3) Is there a way i can change the colors of the numberes that display the terrain defense of unit, when i hove the mouse over them?
Re: Fosprey WML problems
No, btw there is already a feature request for this.Fosprey wrote:Well i still need help with the obove post but i have other questions.
1) Is there anyway to edit the wml_theme so it displays an information of a variable?
You can change the text in the unit status, but not the barsFosprey wrote:2) Is there a way in the wml_theme to change colors of HP, XP and things like that?
I don't think so...Fosprey wrote:3) Is there a way i can change the colors of the numberes that display the terrain defense of unit, when i hove the mouse over them?
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" -- xtifr
Re: Fosprey WML problems
It seems that after the replie, nobody seems to know why or how the resting unit paramater works, it is bugged maybe?
Re: Fosprey WML problems
Looks as if default resting is yes.
If you move a unit (not healthy dwarfs) or attack or the unit is attacked in an enemies turn it probably is changed to no and back to yes at the beginning of your next turn (after rest heal for all your units still having resting=yes).
Looking at "http://www.wesnoth.org/wiki/EventWML" i would try a "side turn" event.
"side turn: this event triggers when a side is about to start its turn. Before events of this type trigger, the value of the WML variable side_number is set to the number of the side of the player about to take their turn. This is before any healing takes place for that side, before calculating income, and before restoring unit movement and status."
If you move a unit (not healthy dwarfs) or attack or the unit is attacked in an enemies turn it probably is changed to no and back to yes at the beginning of your next turn (after rest heal for all your units still having resting=yes).
Looking at "http://www.wesnoth.org/wiki/EventWML" i would try a "side turn" event.
"side turn: this event triggers when a side is about to start its turn. Before events of this type trigger, the value of the WML variable side_number is set to the number of the side of the player about to take their turn. This is before any healing takes place for that side, before calculating income, and before restoring unit movement and status."
Re: Fosprey WML problems
no, if you move a unit , it's resting status doesn't change, i tried it in a lot of different ways, with events that fire in a resting=no event and looking and the save game file.
Re: Fosprey WML problems
Made some testsaves.
If a unit moves or attacks, resting is not changed immediatly, but between the next side turn.
If a unit is attacked resting is changed immediatly.
If a unit moves or attacks, resting is not changed immediatly, but between the next side turn.
If a unit is attacked resting is changed immediatly.