Fosprey WML problems

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
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Fosprey WML problems

Post by Fosprey »

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
#define CE_REMOVE_UNIT X Y
[kill]
x,y=(X),(Y)
fire_event=no
animate=no
[/kill]
#enddef
And this is the relevant part of the event
{CE_REMOVE_UNIT $x1 $y1}
{CE_GENERIC_UNIT SIDE CE_Swordsman $x1 $y1}
The unit is created as expected but in an adjacent hex, that's because the unit isn't removed in first place.
now i don't get why it isn't removed if i change
{CE_REMOVE_UNIT $x1 $y1}
for
{CE_REMOVE_UNIT}
AND
#define CE_REMOVE_UNIT X Y
[kill]
x,y=(X),(Y)
fire_event=no
animate=no
[/kill]
#enddef
for
#define CE_REMOVE_UNIT
[kill]
x,y=12,4
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.
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.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: What's wrong with this wml?

Post by AI »

change
Fosprey wrote:
#define CE_REMOVE_UNIT X Y
[kill]
x,y=(X),(Y)
fire_event=no
animate=no
[/kill]
#enddef
to

Code: Select all

 #define CE_REMOVE_UNIT X Y
   [kill]
        x,y={X},{Y}
        fire_event=no
        animate=no
    [/kill]
#enddef
and it'll work.

Your problem is using ordinary braces where you should use curly ones.
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: What's wrong with this wml?

Post by Fosprey »

Thanks a lot :)
i knew it was some stupid stuff :(
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: What's wrong with this wml?

Post by Fosprey »

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
{VARIABLE cemxp 32}
and the macro
#define CE_CONDITION VAR TEST VALUE
[variable]
name={VAR}
{TEST}={VALUE}
[/variable]
#enddef
in an IF tag
{CE_CONDITION unit.experience greater_than_equal_to cemxp}
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.
what's wrong?

it took me more than two hours again, but finaly realized that i had to put some $ here and there.
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: Fosprey WML problems

Post by Fosprey »

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
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: Fosprey WML problems

Post by Fosprey »

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?
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Re: Fosprey WML problems

Post by Noyga »

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?
No, btw there is already a feature request for this.
Fosprey wrote:2) Is there a way in the wml_theme to change colors of HP, XP and things like that?
You can change the text in the unit status, but not the bars
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?
I don't think so...
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: Fosprey WML problems

Post by Fosprey »

It seems that after the replie, nobody seems to know why or how the resting unit paramater works, it is bugged maybe?
claus
Posts: 186
Joined: April 4th, 2005, 5:51 am

Re: Fosprey WML problems

Post by claus »

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."
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: Fosprey WML problems

Post by Fosprey »

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.
claus
Posts: 186
Joined: April 4th, 2005, 5:51 am

Re: Fosprey WML problems

Post by claus »

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.
Post Reply