Graziani WML Questions

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.

Re: Graziani WML Questions

Postby Dugi » January 12th, 2014, 4:45 pm

first_scenario="01_Un_nouveau_chef" should be first_scenario="01_A_New_Chieftain" (or something else if you translated it differently), you simply forgot to change the name of the first scenario in the [campaign] tag.
Author of Legend of the Invincibles.
I am human, stronger than any god. -Joe Tiberi
User avatar
Dugi
 
Posts: 4759
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains

Re: Graziani WML Questions

Postby Graziani » January 15th, 2014, 5:36 pm

The ID Was wrong, my fault, thanks again.

Hmmm.. :hmm:


I have an event that i don't really know how to finish it properly.


In a last breath event, the second_unit can gain more hp imediatly.

But, how identify the second_unit in an event?

In the same problem, if i want that the second_unit move to somewhere, how can i do that?

Thx!
User avatar
Graziani
 
Posts: 71
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby Adamant14 » January 15th, 2014, 6:06 pm

Code: Select all
   ### question 1:

      [store_unit]
         [filter]
            id=$second_unit.id
         [/filter]
         variable=temp_second_unit
         kill=no
      [/store_unit]

      [set_variable]
         name=temp_second_unit.hitpoints
         add=  # add what you want here
      [/set_variable]

      [unstore_unit]
         variable=temp_second_unit
      [/unstore_unit]

      {CLEAR_VARIABLE temp_second_unit}




   ### question 2:
   #   moves second unit to x,y=10,10


      {MOVE_UNIT $second_unit.id 10 10}

Author of Antar, Son of Rheor: SP Campaign


Please add your (or some other) campaign to this sites: Guide to UMC Campaigns | Players' Review(s) | Please leave a comment here: WML filtering , WML variables
User avatar
Adamant14
 
Posts: 763
Joined: April 24th, 2010, 1:14 pm

Re: Graziani WML Questions

Postby JaMiT » January 16th, 2014, 2:54 am

Why temp_second_unit?
Code: Select all
    ### question 1:
    [set_variable]
        name=second_unit.hitpoints
        add=  # add what you want here
    [/set_variable]

    [unstore_unit]
        variable=second_unit
    [/unstore_unit]
JaMiT
Developer
 
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: Graziani WML Questions

Postby Graziani » January 16th, 2014, 9:09 pm

Code: Select all

[event]

name=last breath

[filter]
id=ghost
[/filter]


       [store_unit]
         [filter]
            id=$second_unit.id
         [/filter]
         variable=second_unit
         kill=no
      [/store_unit]

        [message]
            speaker=unit
            message= _ "Ouuuuuuuuuh! Je reviendrais!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "Brrr... Sale fantome va!"
        [/message]

[remove_shroud]
side=1
x=8-16
y=18-23
[/remove_shroud]


[unit]
x,y=11,22
side=4
id=elve
type=Elvish Shaman
[/unit]



        [message]
            type=Elvish Shaman
            message= _ "blabla"
        [/message]

        [message]
            speaker=second_unit
            message= _ "bla?"
        [/message]


{MOVE_UNIT $second_unit.id 12 21}



        [message]
            speaker=second_unit
            message= _ "bla"

            [option]
                message= _ "bl"

                [command]

                    [message]
                        type=Elvish Shaman

                        message= _ "Nooooon!"
                    [/message]

[kill]
id=elve
animate=yes
[/kill]

        [message]
            speaker=second_unit
            message= _ "Bwahahahaha!"
        [/message]


        [sound]
            name=gold.ogg
        [/sound]


        [message]
            speaker=second_unit
            message= _ "150!"
        [/message]

       [message]
            speaker=Kark
            message= _ "bla"
        [/message]

[gold]
side=1
amount=100
[/gold]



                [/command]

            [/option]

            [option]
                message= _ "bla."

                [command]




{PLACE_IMAGE "items/potion-red.png" 11 22}


{MOVE_UNIT id=elve 1 1}

[kill]
id=elve
animate=no
[/kill]

       [message]
            speaker=Kark
            message= _ "blabla"
        [/message]

[remove_item]
x=11
y=22
[/remove_item]



      [set_variable]
         name=second_unit.hitpoints
         add=30
      [/set_variable]


        [sound]
            name=gold.ogg
        [/sound]


[gold]
side=1
amount=40
[/gold]


        [message]
            speaker=second_unit
            message= _ "blabla"
        [/message]


      [unstore_unit]
         variable=second_unit
      [/unstore_unit]



      {CLEAR_VARIABLE second_unit}

                [/command]
            [/option]
        [/message]
    [/event]




I've got an error... Wesnoth told we that a "$" in uncorrect
User avatar
Graziani
 
Posts: 71
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby trewe » January 17th, 2014, 12:01 am

Graziani wrote:
Code: Select all

{MOVE_UNIT $second_unit.id 12 21}


I've got an error... Wesnoth told we that a "$" in uncorrect


It is id=$second_unit.id
«There does not exist anything like a finished state. The best we can do is to be on pair with the decay» Cologne architect.
----
current maintainer of the european portuguese translation
User avatar
trewe
Translator
 
Posts: 122
Joined: December 24th, 2012, 5:37 pm
Location: Portugal

Re: Graziani WML Questions

Postby JaMiT » January 17th, 2014, 3:28 am

Graziani wrote:
Code: Select all
       [store_unit]
         [filter]
            id=$second_unit.id
         [/filter]
         variable=second_unit
         kill=no
      [/store_unit]


Think about what this snippet is doing. The [filter] part says to find the unit that had been stored in the variable called "second_unit". Then the rest of the [store_unit] causes that unit (that is still stored in "second_unit") to be stored in "second_unit". Which it already is. So this is just busy work for the game and accomplishes nothing. Get rid of it.

Graziani wrote:
Code: Select all
      {CLEAR_VARIABLE second_unit}

No. Do not clear automatically-stored variables. It's a recipe for disaster waiting to happen. Or at least bad style. :) Get rid of this line.
(In my previous post, I included a complete solution for part 1, not something to be merged into what was posted before it. That's why I included the label "### question 1:". I had both changed and removed lines. Omissions were intentional and in fact were kind of the point.)


PS In case you missed trewe's intent: {MOVE_UNIT id=$second_unit.id 12 21}
Or perhaps {MOVE_UNIT (id=$second_unit.id) 12 21}, to make it easier to see the extent of the first parameter.
JaMiT
Developer
 
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: Graziani WML Questions

Postby Adamant14 » January 17th, 2014, 4:16 pm

Sorry for the mess. :oops:
Author of Antar, Son of Rheor: SP Campaign


Please add your (or some other) campaign to this sites: Guide to UMC Campaigns | Players' Review(s) | Please leave a comment here: WML filtering , WML variables
User avatar
Adamant14
 
Posts: 763
Joined: April 24th, 2010, 1:14 pm

Re: Graziani WML Questions

Postby Graziani » January 21st, 2014, 9:57 am

I deleted the macro, but this event isn't working (command and hit points...)

Code: Select all


[event]

name=last breath

[filter]
id=ghost
[/filter]


       [store_unit]
         [filter]
            id=$second_unit.id
         [/filter]
         variable=second_unit
         kill=no
      [/store_unit]

        [message]
            speaker=unit
            message= _ "Ouuuuuuuuuh! Je reviendrais!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "Brrr... Sale fantome va!"
        [/message]

[remove_shroud]
side=1
x=8-16
y=18-23
[/remove_shroud]


[unit]
x,y=11,22
side=4
id=elve
type=Elvish Shaman
[/unit]



        [message]
            type=Elvish Shaman
            message= _ "blabla"
        [/message]

        [message]
            speaker=second_unit
            message= _ "bla?"
        [/message]


{MOVE_UNIT $second_unit.id 12 21}



        [message]
            speaker=second_unit
            message= _ "bla"

            [option]
                message= _ "bl"

                [command]

                    [message]
                        type=Elvish Shaman

                        message= _ "Nooooon!"
                    [/message]

[kill]
id=elve
animate=yes
[/kill]

        [message]
            speaker=second_unit
            message= _ "Bwahahahaha!"
        [/message]


        [sound]
            name=gold.ogg
        [/sound]


        [message]
            speaker=second_unit
            message= _ "150!"
        [/message]

       [message]
            speaker=Kark
            message= _ "bla"
        [/message]

[gold]
side=1
amount=100
[/gold]



                [/command]

            [/option]

            [option]
                message= _ "bla."

                [command]




{PLACE_IMAGE "items/potion-red.png" 11 22}


{MOVE_UNIT id=elve 1 1}

[kill]
id=elve
animate=no
[/kill]

       [message]
            speaker=Kark
            message= _ "blabla"
        [/message]

[remove_item]
x=11
y=22
[/remove_item]



      [set_variable]
         name=second_unit.hitpoints
         add=30
      [/set_variable]


        [sound]
            name=gold.ogg
        [/sound]


[gold]
side=1
amount=40
[/gold]


        [message]
            speaker=second_unit
            message= _ "blabla"
        [/message]


      [unstore_unit]
         variable=second_unit
      [/unstore_unit]


                [/command]
            [/option]
        [/message]
    [/event]


User avatar
Graziani
 
Posts: 71
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby Dugi » January 21st, 2014, 10:58 am

I think that {MOVE_UNIT $second_unit.id 12 21} should be {MOVE_UNIT id=$second_unit.id 12 21}.
Side note:


EDIT: Fixed the typo James_the_Invisible noticed. Thanks man.
Last edited by Dugi on January 21st, 2014, 12:39 pm, edited 1 time in total.
User avatar
Dugi
 
Posts: 4759
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains

Re: Graziani WML Questions

Postby James_The_Invisible » January 21st, 2014, 12:16 pm

I believe that you meant
Code: Select all
{MOVE_UNIT id=$second_unit.id 12 21}
:)
My content: For Power series
Ports: Danse Macabre Story of the Wose
Royal Guard/Silver Mage
User avatar
James_The_Invisible
 
Posts: 395
Joined: October 28th, 2012, 1:58 pm
Location: Somewhere in the Northlands, fighting dark forces

Re: Graziani WML Questions

Postby Graziani » January 21st, 2014, 1:57 pm

Strangely the movement is working even with that {MOVE_UNIT $second_unit.id 12 21}!
But anyway, i correct it, thanks!



But the command function doesn't works at all, this event is a mystery to me...




Actually, almost all the scenario isn't working, the ennemies leaders don't recruit etc...

Ps: Thx Dugi ;)
User avatar
Graziani
 
Posts: 71
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby Graziani » January 22nd, 2014, 8:27 am

I tried to fix the problems but i can't see what is wrong...
The ennemies leaders don't recruit (and don't have crown above their heads), ghosts don't stay on place even with ai guardian, and the event with [command] tag don't work, except the famous movement {MOVE_UNIT id=$second_unit.id 12 21}

Here is a version of my scenario with no dialogs, if you have time thanks in advance because i'm totally stuck

Code: Select all
#textdomain wesnoth-aga
[scenario]

id=03_Necromancien
next_scenario=04_Retour
 
name=La necromancienne de la foret
map_data="{~add-ons/A_goblin_adventure/maps/03_Necromancien.map}"
{TURNS 55 50 45}

victory_when_enemies_defeated=no

{INTRO_AND_SCENARIO_MUSIC "northerners.ogg" "revelation.ogg"}
{EXTRA_SCENARIO_MUSIC "northeners.ogg"}
{EXTRA_SCENARIO_MUSIC "legends_of_the_north.ogg"}
{EXTRA_SCENARIO_MUSIC "battle.ogg"}


{DEFAULT_SCHEDULE}

{STORY_NECROMANCIEN}
 



[side]
type=Goblin Rouser
id=Kark
x,y=4,39
name=Kark
facing=se
side=1
team_name=goblins
user_team_name=_"Goblins"
canrecruit=yes
controller=human
recruit=Goblin Impaler,Goblin Spearman,AGA Goblin Bladesman,AGA Goblin Swordsman,AGA Goblin Archer
gold=100
shroud=yes
[/side]

[side]
no_leader=yes
controller=ai
team_name=Humans
canrecruit=yes
user_team_name=_"Undead"
side=2
recruit=Walking Corpse,Ghoul,Blood Bat,Soulless,Ghost,Vampire Bat,AGA Rabid Hound
gold=0
[/side]

[side]
no_leader=yes
controller=ai
team_name=Humans
canrecruit=yes
user_team_name=_"Undead"
side=3
recruit=Walking Corpse,Ghoul,Vampire Bat
gold=0
[/side]

[side]
no_leader=yes
controller=ai
team_name=other
user_team_name=_"Other"
side=4
gold=0
[/side]

[event]

name=prestart

[recall]
id=Forx
x,y=5,39
{IS_HERO}
[/recall]

[recall]
id=Spid6
[/recall]


[unit]
x,y=2,40
side=1
type=Goblin Spearman
[/unit]

[unit]
x,y=1,40
side=1
id=Goblin Spearman2
type=Goblin Impaler
[/unit]

[unit]
x,y=4,40
side=1
type=Goblin Spearman
[/unit]

[unit]
x,y=5,40
side=1
id=Goblin Spearman1
type=Goblin Spearman
[/unit]

[unit]
x,y=3,38
side=1
type=Goblin Impaler
[/unit]

[unit]
x,y=7,40
side=1
type=Goblin Spearman
[/unit]



[/event]

[event]

name=start

#dialogue starts



[objectives]
side=1
[objective]
description= _ "Retrouver les loups"
condition=win
[/objective]

[objective]
description= _ "Mort de Kark ou Forx"
condition=lose
[/objective]

[objective]
description= _ "Fin du decompte des tours"
condition=lose
[/objective]
note={EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
[/objectives]


[/event]





[event]

name=moveto

first_time_only=yes

[filter]
side=1
x=20,21
y=36,36
[/filter]




{PLACE_IMAGE "items/wolf.png" 44 28}
{PLACE_IMAGE "items/wolf.png" 45 28}
{PLACE_IMAGE "items/wolf.png" 46 28}
{PLACE_IMAGE "items/wolf.png" 44 27}


[remove_shroud]
side=1
x=38-49
y=25-31
[/remove_shroud]





[objectives]
side=1
[objective]
description= _ "Tuer le serviteur de la necromante pour liberer les loups"
condition=win
[/objective]

[objective]
description= _ "Mort de Kark ou Forx"
condition=lose
[/objective]

[objective]
description= _ "Fin du decompte des tours"
condition=lose
[/objective]
note={EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
[/objectives]



[/event]




[event]

name=moveto

first_time_only=yes

[filter]
side=1
x=10-18
y=34-38
[/filter]



[unit]
x,y=18,37
side=2
type=Ghost
id=ghost2
ai_special=guardian
[/unit]


[unit]
x,y=12,34
side=2
id=ghost
type=Ghost
ai_special=guardian
[/unit]


[unit]
x,y=31,33
side=2
type=Ghost
ai_special=guardian
[/unit]


[remove_shroud]
side=1
x=9-20
y=34-40
[/remove_shroud]



{MOVE_UNIT id=ghost2 42 36}



{MOVE_UNIT id=ghost 14 22}




[unit]
x,y=42,27
side=3
id=zombie
type=Necrophage
can_recruit=yes
[/unit]



[modify_side]
side=2
{GOLD 60 85 110}
{INCOME 5 7 9}
[/modify_side]



[/event]













[event]

name=last breath

[filter]
id=zombie
[/filter]




[if]

[have_unit]
side=2
id=necromante
[/have_unit]

[then]






{MOVE_UNIT id=Forx 42 29}
{MOVE_UNIT id=Kark 42 28}







[unit]
x,y=44,28
side=1
type=Wolf Rider
[/unit]

[unit]
x,y=45,28
side=1
type=Wolf Rider
[/unit]

[unit]
x,y=46,28
side=1
type=Wolf Rider
[/unit]

[unit]
x,y=47,28
side=1
type=Wolf Rider
[/unit]



[modify_unit]
                           
[filter]
                               
id=Kark                           
[/filter]
                           
type=Goblin Knight                     
[/modify_unit]


[modify_unit]
                           
[filter]
                               
id=Forx                         
[/filter]
                           
type=Goblin Pillager                     
[/modify_unit]



[remove_item]
x=44,45,45,44
y=28,28,28,27
[/remove_item]

[allow_recruit]
type=Goblin Impaler,Goblin Spearman,AGA Goblin Bladesman,AGA Goblin Swordsman,AGA Goblin Archer,Wolf Rider
side=1
[/allow_recruit]







[/then]




[else]









{MOVE_UNIT id=Forx 42 29}
{MOVE_UNIT id=Kark 42 28}







[unit]
x,y=44,28
side=1
type=Wolf Rider
[/unit]

[unit]
x,y=45,28
side=1
type=Wolf Rider
[/unit]

[unit]
x,y=46,28
side=1
type=Wolf Rider
[/unit]

[unit]
x,y=47,28
side=1
type=Wolf Rider
[/unit]



[modify_unit]
                           
[filter]
                               
id=Kark                           
[/filter]
                           
type=Goblin Knight                     
[/modify_unit]


[modify_unit]
                           
[filter]
                               
id=Forx                         
[/filter]
                           
type=Goblin Pillager                     
[/modify_unit]







[remove_item]
x=44,45,45,44
y=28,28,28,27
[/remove_item]





[remove_shroud]
side=1
x=45-49
y=2-3
[/remove_shroud]



[unit]
x,y=46,3
side=2
id=necromante
type=Necromancer
gender=female
can_recruit=yes
[/unit]




[place_shroud]
side=1
x=45-49
y=2-3
[/place_shroud]






[allow_recruit]
type=Goblin Impaler,Goblin Spearman,AGA Goblin Bladesman,AGA Goblin Swordsman,AGA Goblin Archer,Wolf Rider
side=1
[/allow_recruit]

[objectives]
side=1
[objective]
description= _ "Tuer la Necromante"
condition=win
[/objective]

[objective]
description= _ "Mort de Kark ou Forx"
condition=lose
[/objective]

[objective]
description= _ "Fin du decompte des tours"
condition=lose
[/objective]
note={EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
[/objectives]





[/else]

[/if]


[/event]







[event]

name=last breath

[filter]
id=ghost
[/filter]


       [store_unit]
         [filter]
            id=$second_unit.id
         [/filter]
         variable=second_unit
         kill=no
      [/store_unit]




[kill]
id=ghost
animate=yes
[/kill]



[remove_shroud]
side=1
x=8-16
y=18-23
[/remove_shroud]


[unit]
x,y=11,22
side=4
id=elve
type=Elvish Shaman

[/unit]




{MOVE_UNIT id=$second_unit.id 12 21}




        [message]
            speaker=second_unit
            message= _ "Je la massacre cette naze!"

            [option]
                message= _ "C'est fini pour toi!"

                [command]

                    [message]
                        type=Elvish Shaman

                        message= _ "Nooooon!"
                    [/message]

[kill]
id=elve
animate=yes
[/kill]

        [sound]
            name=gold.ogg
        [/sound]



[gold]
side=1
amount=100
[/gold]



                [/command]

            [/option]

            [option]
                message= _ "Ok ok... Je te laisse la vie sauve petite elfe..."

                [command]





{PLACE_IMAGE "items/potion-red.png" 11 22}


{MOVE_UNIT id=elve 1 1}

[kill]
id=elve
animate=no
[/kill]


[remove_item]
x=11
y=22
[/remove_item]




      [set_variable]
         name=second_unit.hitpoints
         add=30
      [/set_variable]









        [sound]
            name=gold.ogg
        [/sound]


[gold]
side=1
amount=40
[/gold]



      [unstore_unit]
         variable=second_unit
      [/unstore_unit]




                [/command]
            [/option]
        [/message]
    [/event]












[event]

name=moveto

first_time_only=yes

[filter]
side=1
x=12-60
y=1-26
[/filter]




[if]

[have_unit]
side=2
id=necromante
[/have_unit]

[then]



[/then]


[else]




[remove_shroud]
side=1
x=45-49
y=2-3
[/remove_shroud]



[unit]
x,y=46,3
side=2
id=necromante
type=Necromancer
gender=female
can_recruit=yes
[/unit]




[place_shroud]
side=1
x=45-49
y=2-3
[/place_shroud]



[objectives]
side=1
[objective]
description= _ "Tuer la Necromante"
condition=win
[/objective]

[objective]
description= _ "Mort de Kark ou Forx"
condition=lose
[/objective]

[objective]
description= _ "Fin du decompte des tours"
condition=lose
[/objective]
note={EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
[/objectives]




[/else]


[/if]




[/event]












[event]

name=last breath

[filter]
id=ghost2
[/filter]




[/event]



[event]

name=victory



[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]

[/event]


[event]

name=time over


[/event]







[event]

name=last breath

[filter]
id=necromante
[/filter]



[kill]
id=necromante
animate=yes
[/kill]

[kill]
side=2
animate=yes
[/kill]

[kill]
side=3
animate=yes
[/kill]






[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]

[/event]






[event]

name=last breath

[filter]
id=Kark
[/filter]



[endlevel]
result=defeat
[/endlevel]

[/event]



[event]

name=last breath

[filter]
id=Forx
[/filter]



[endlevel]
result=defeat
[/endlevel]

[/event]



[/scenario]
User avatar
Graziani
 
Posts: 71
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby zookeeper » January 22nd, 2014, 8:31 am

It's "canrecruit", not "can_recruit".
User avatar
zookeeper
WML Wizard
 
Posts: 9603
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Graziani WML Questions

Postby Graziani » January 23rd, 2014, 8:14 am

I correct it thanks,

for the [command] tag in the event, do i miss something? It's not working
User avatar
Graziani
 
Posts: 71
Joined: December 20th, 2010, 1:04 am
Location: France

PreviousNext

Return to WML Workshop

Who is online

Users browsing this forum: No registered users and 4 guests