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 Graziani » April 3rd, 2014, 3:52 pm

Sorry to re-up the topic, but i really can't find what is the problem in this event:
In the game, when the player is supposed to make his choice, nothing happens. No dialogs, nothing.


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= _ "bla"
        [/message]


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

        [message]
            speaker=second_unit
            message= _ "bla"
        [/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= _ "bla"
        [/message]

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

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

        [message]
            type=Elvish Shaman

            message= _ "bla"
        [/message]

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

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

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

        [message]
            type=Elvish Shaman

            message= _ "bla"
        [/message]

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

        [message]
            type=Elvish Shaman

            message= _ "bla"
        [/message]

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

{MOVE_UNIT id=$second_unit.id 12 21}

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

        [message]
            type=Elvish Shaman

            message= _ "bla"
        [/message]

        [message]
            id=$second_unit.id
            message= _ "bla"
        [/message]



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

            [option]
                message= _ "bla"

                [command]

                    [message]
                        type=Elvish Shaman

                        message= _ "bla"
                    [/message]

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

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


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


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

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

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



                [/command]

            [/option]

            [option]
                message= _ "bla"

                [command]



        [message]
            type=Elvish Shaman

            message= _ "bla!"
        [/message]


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


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


{MOVE_UNIT id=elve 1 1}

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

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


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


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


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




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





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

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



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


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


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


      [unstore_unit]
         variable=second_unit
      [/unstore_unit]




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



Currently on goblin campaign "A goblin adventure" (available) and troll campaign "From Rocks and Blood"(not available yet)
User avatar
Graziani
 
Posts: 76
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby Elvish_Hunter » April 4th, 2014, 10:27 am

One thing that I see is that you're using a last breath event, but the ghost unit doesn't speak in it; not only this, but you kill it shortly after the event is fired. Just rename the event as die and delete the [kill] tag.
That said, for now I have no idea why the event isn't fired. Are you sure that there is a unit with id=ghost on the field? I'm asking, because typos (like writing Ghost instead of ghost) happen. :)
User avatar
Elvish_Hunter
Developer
 
Posts: 1360
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Graziani WML Questions

Postby zookeeper » April 4th, 2014, 11:22 am

I'm sorry, but people get help really fast once they put any effort at all into making it easy for others to help them, and/or seem like they actually tried to solve it themselves. You just dump hundreds of lines of code here and say "it doesn't do anything".
User avatar
zookeeper
WML Wizard
 
Posts: 9605
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Graziani WML Questions

Postby SkyOne » April 4th, 2014, 1:26 pm

zookeeper wrote:I'm sorry, but people get help really fast once they put any effort at all into making it easy for others to help them, and/or seem like they actually tried to solve it themselves. You just dump hundreds of lines of code here and say "it doesn't do anything".
^_^
Graziani wrote:In the game, when the player is supposed to make his choice, nothing happens. No dialogs, nothing.

I guess what you are missing is ID in the [option] tag. So try something like:
Code: Select all
            [option]
                id=first_choice
                message= _ "bla"

                [command]
Code: Select all
            [option]
                id=second_choice
                message= _ "bla"

                [command]
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
User avatar
SkyOne
 
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Graziani WML Questions

Postby zookeeper » April 4th, 2014, 1:42 pm

An id= in an [option] has no meaning.
User avatar
zookeeper
WML Wizard
 
Posts: 9605
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Graziani WML Questions

Postby SkyOne » April 4th, 2014, 2:13 pm

zookeeper wrote:An id= in an [option] has no meaning.

Aaa... You are right. Missing the ID at a different place. It should be here:
Code: Select all
        [message]
            id=option_choice
            speaker=second_unit
            message= _ "bla"

            [option]
                message= _ "bla"

                [command]
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
User avatar
SkyOne
 
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Graziani WML Questions

Postby James_The_Invisible » April 4th, 2014, 3:10 pm

@Elvish_Hunter The ghost is speaking in his last breath event:
Code: Select all
[message]
  speaker=unit
  message= _ "bla"
[/message]

It is after [store_unit] tag.
@SkyOne id used in [message] selects the speaker (as a part StandartUnitFiler)
@Graziani I can see nothing wrong with your code but the [store_unit] is useless because exactly this is done automatically by Wesnoth.
My content: For Power series
Ports: Danse Macabre Story of the Wose
Royal Guard/Silver Mage
User avatar
James_The_Invisible
 
Posts: 397
Joined: October 28th, 2012, 1:58 pm
Location: Somewhere in the Northlands, fighting dark forces

Re: Graziani WML Questions

Postby SkyOne » April 4th, 2014, 3:55 pm

James_The_Invisible wrote:@SkyOne id used in [message] selects the speaker (as a part StandartUnitFiler)

Hmmm... You are probably right. Now I am not sure how I solved this one before: - viewtopic.php?p=517628#p517628
At the time, it did not work without the ID under my testing. I probably tested incorrectly.

James_The_Invisible wrote:but the [store_unit] is useless because exactly this is done automatically by Wesnoth.

Just to make sure, we don't need the [store_unit] anymore to do this?
Code: Select all
      [set_variable]
         name=second_unit.hitpoints
         add=30
      [/set_variable]
My basic WML are from 1.4, so some have been outdated.
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
User avatar
SkyOne
 
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Graziani WML Questions

Postby James_The_Invisible » April 4th, 2014, 3:58 pm

Just to make sure, we don't need the [store_unit] anymore to do this?

As far as I know, no but just in this situation. If the unit is not involved in the event (as primary or secondary unit) you need to store it.
My content: For Power series
Ports: Danse Macabre Story of the Wose
Royal Guard/Silver Mage
User avatar
James_The_Invisible
 
Posts: 397
Joined: October 28th, 2012, 1:58 pm
Location: Somewhere in the Northlands, fighting dark forces

Re: Graziani WML Questions

Postby Graziani » April 21st, 2015, 10:35 am

Hi! It's been a long time that i didn't work on my campaigns.

I'm still on two projects, troll campaign and goblin campaign.

I've finaly done my troll campaign (yeaaahhhhh!!), units, 23 scenarios, everything is fine.

There are two difficulties mode in this campaign, NORMAL and HARD.
I just have a problem about my main file i think.
When i launch my camapign in HARD, it's not working, i've got the "UNKNOW SCENARIO ERROR".
But in NORMAL, everything is fine.

Do you think there is a problem in this main_file ?
It's such a problem for me because even if the scenarios are done, i can't test them in HARD. I search in every scenario but i can't figure it out, i don't think the problem is there...

Thank you for your precious help everytime, it's very nice.

Code: Select all

#textdomain wesnoth-frab

[textdomain]
    name="wesnoth-frab"
[/textdomain]

# wmlscope: set export=no

[campaign]
    id=From_rocks_and_blood
    icon="data/add-ons/From_rocks_and_blood/images/units/trolls/godug.png~RC(magenta>red)"
    image="data/add-ons/From_rocks_and_blood/images/campaign_image.png"
    name= _ "From Rocks And Blood"
    abbrev= _ "FRAB"
    rank=15
    first_scenario="01_Un_nouveau_chef"
    difficulties="NORMAL,HARD"
    difficulty_descriptions={MENU_IMG_TXT2 "units/trolls/grunt.png~RC(magenta>red)" _"Warrior" _"(Normal)"} + ";" +
    {MENU_IMG_TXT2 "units/trolls/warrior.png~RC(magenta>red)" _"Leader" _"(Challenging)"}
    define="CAMPAIGN_FROM_ROCKS_AND_BLOOD"
    description=_ "Il est temps d'unifier les trolls et de faire taire les querelles incessantes avec les voisins! Que ce soit pacifiquement ou dans le sang n'a plus d'importance!

" + _"(Advanced level, 23 scenarios.)"

[/campaign]

#ifdef CAMPAIGN_FROM_ROCKS_AND_BLOOD
[binary_path]
    path=data/add-ons/From_rocks_and_blood
[/binary_path]
[+units]
   {~add-ons/From_rocks_and_blood/units/}
[/units]
{~add-ons/From_rocks_and_blood/utils}
{~add-ons/From_rocks_and_blood/scenarios}
{~add-ons/From_rocks_and_blood/maps}
#endif

Currently on goblin campaign "A goblin adventure" (available) and troll campaign "From Rocks and Blood"(not available yet)
User avatar
Graziani
 
Posts: 76
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby Dugi » April 21st, 2015, 11:14 am

I think that your problem does not lie in that file. Tell us the full error report. I think that you have a syntax error between an #ifdef HARD and #endif somewhere.

It's pretty cool that you get a new chef at the beginning of the campaign, all units will enjoy their meals and the player will be happy seeing them.
Author of Legend of the Invincibles.
I am human, stronger than any god. -Joe Tiberi
User avatar
Dugi
 
Posts: 4761
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains

Re: Graziani WML Questions

Postby Graziani » April 26th, 2015, 5:39 pm

Okay, thanks for reply. It was strange, but after a long research in my senario files, i realized that i type a wrong code, like this.

[side]

Blablabla

[/side]

[/side]

I really don't know why it was disturbing the Hard difficulty and not the normal, really strange.
Thanks again!
Currently on goblin campaign "A goblin adventure" (available) and troll campaign "From Rocks and Blood"(not available yet)
User avatar
Graziani
 
Posts: 76
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby Graziani » December 11th, 2015, 8:26 pm

Code: Select all
 # while Spectral Ixthala is alive, replace any defeated ghosts

    [event]
        name=new turn
        first_time_only=no

        [if]
            [have_unit]
                id=demon2
            [/have_unit]

            [then]
                [set_variable]
                    name=ghost1
                    value=1
                [/set_variable]

                [set_variable]
                    name=ghost2
                    value=1
                [/set_variable]

                [set_variable]
                    name=ghost3
                    value=1
                [/set_variable]

                [set_variable]
                    name=ghost4
                    value=1
                [/set_variable]

                [set_variable]
                    name=ghost5
                    value=1
                [/set_variable]

                [set_variable]
                    name=ghost6
                    value=1
                [/set_variable]

                [if]
                    [have_unit]
                        id=ghost1
                    [/have_unit]

                    [then]
                        [set_variable]
                            name=ghost1_dead
                            value=0
                        [/set_variable]
                    [/then]
                [/if]

                [if]
                    [have_unit]
                        id=ghost2
                    [/have_unit]

                    [then]
                        [set_variable]
                            name=ghost2_dead
                            value=0
                        [/set_variable]
                    [/then]
                [/if]

                [if]
                    [have_unit]
                        id=ghost3
                    [/have_unit]

                    [then]
                        [set_variable]
                            name=ghost3_dead
                            value=0
                        [/set_variable]
                    [/then]
                [/if]

                [if]
                    [have_unit]
                        id=ghost4
                    [/have_unit]

                    [then]
                        [set_variable]
                            name=ghost4_dead
                            value=0
                        [/set_variable]
                    [/then]
                [/if]

                [if]
                    [have_unit]
                        id=ghost5
                    [/have_unit]

                    [then]
                        [set_variable]
                            name=ghost5_dead
                            value=0
                        [/set_variable]
                    [/then]
                [/if]

                [if]
                    [have_unit]
                        id=ghost6
                    [/have_unit]

                    [then]
                        [set_variable]
                            name=ghost6_dead
                            value=0
                        [/set_variable]
                    [/then]
                [/if]



                [if]
                    [variable]
                        name=ghost1_dead
                        numerical_equals=1
                    [/variable]

                    [or]
                        [variable]
                            name=ghost2_dead
                            numerical_equals=1
                        [/variable]
                    [/or]

                    [or]
                        [variable]
                            name=ghost3_dead
                            numerical_equals=1
                        [/variable]
                    [/or]

                    [variable]
                        name=ghost4_dead
                        numerical_equals=1
                    [/variable]

                    [or]
                        [variable]
                            name=ghost5_dead
                            numerical_equals=1
                        [/variable]
                    [/or]

                    [or]
                        [variable]
                            name=ghost6_dead
                            numerical_equals=1
                        [/variable]
                    [/or]


                    [then]
                        [message]
                            speaker=demon2
                            message= _ "blabla"
                        [/message]
                    [/then]
                [/if]

                [if]
                    [variable]
                        name=ghost1_dead
                        numerical_equals=1
                    [/variable]

                    [then]
    [unit]
        type=Ghost
        side=3
        id=ghost1
        x=10
        y=44
    [/unit]
                    [/then]
                [/if]

                [if]
                    [variable]
                        name=ghost2_dead
                        numerical_equals=1
                    [/variable]

                    [then]

    [unit]
        type=Ghost
        side=3
        id=ghost2
        x=10
        y=45
    [/unit]
                    [/then]
                [/if]

                [if]
                    [variable]
                        name=ghost3_dead
                        numerical_equals=1
                    [/variable]

                    [then]
    [unit]
        type=Ghost
        side=3
        id=ghost3
        x=10
        y=46
    [/unit]

                    [/then]
[/if]

                [if]
                    [variable]
                        name=ghost4_dead
                        numerical_equals=1
                    [/variable]

                    [then]

    [unit]
        type=Ghost
        side=3
        id=ghost4
        x=13
        y=44
    [/unit]
                    [/then]
                [/if]

                [if]
                    [variable]
                        name=ghost5_dead
                        numerical_equals=1
                    [/variable]

                    [then]
    [unit]
        type=Ghost
        side=3
        id=ghost5
        x=13
        y=45
    [/unit]

                    [/then]
                [/if]

                [if]
                    [variable]
                        name=ghost6_dead
                        numerical_equals=1
                    [/variable]

                    [then]

    [unit]
        type=Ghost
        side=3
        id=ghost6
        x=13
        y=46
    [/unit]

                    [/then]
                [/if]
            [/then]
        [/if]

    [/event]



Hi guys!
In this event, any defeated ghost is replace by another one.
i'm trying to fire this event but nothing happens. I tried many issues without success. The dead ghost... stay dead :?
Maybe the quote [have_unit] at the beginning is not good for this kind of event.
Any ideas?
Currently on goblin campaign "A goblin adventure" (available) and troll campaign "From Rocks and Blood"(not available yet)
User avatar
Graziani
 
Posts: 76
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Graziani WML Questions

Postby Dugi » December 11th, 2015, 8:39 pm

You're initially setting the variable ghost1 to 1, if ghost1 is dead you set ghost1_dead to 0 and then you check for ghost1_dead. That means that ghost1_dead is never equal to 1, because you have mistaken the variable name.

The whole thing could be done in a much shorter way:
Code: Select all
[event]
 name=new turn
 first_time_only=no
 [if]
  [have_unit]
   id=demon2
  [/have_unit]
 [then]
#define GHOST_CHECK NUM X Y
  [if]
    [have_unit]
      id=ghost{NUM}
    [/have_unit]
    [else]
       [message]
         speaker=demon2
         message= _ "Rise, fallen soul, return from thy undeserved rest. Thy eternal rest hast not cometh yet. Return and haunt thy comrades again."
       [/message]
       [unit]
         type=Ghost
         side=3
         id=ghost{NUM}
         x={X}
         y={Y}
       [/unit]
     [/else]
  [/if]
#enddef
{GHOST_CHECK 1 10 44}
{GHOST_CHECK 2 10 45}
{GHOST_CHECK 3 10 46}
{GHOST_CHECK 4 13 44}
{GHOST_CHECK 5 13 45}
{GHOST_CHECK 6 13 46}
#undef GHOST_CHECK
 [/then]
[/if]
[/event]
Author of Legend of the Invincibles.
I am human, stronger than any god. -Joe Tiberi
User avatar
Dugi
 
Posts: 4761
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains

Re: Graziani WML Questions

Postby Graziani » December 11th, 2015, 8:57 pm

Code: Select all

[event]
 name=new turn
 first_time_only=no
 [if]
  [have_unit]
   id=demon2
  [/have_unit]
 [then]
#define GHOST_CHECK NUM X Y
  [if]
    [have_unit]
      id=ghost1
    [/have_unit]
    [else]
       [message]
         speaker=demon2
         message= _ "Rise, fallen soul, return from thy undeserved rest. Thy eternal rest hast not cometh yet. Return and haunt thy comrades again."
       [/message]
       [unit]
         type=Ghost
         side=3
         id=ghost1
         x={X}
         y={Y}
       [/unit]
     [/else]
  [/if]
  [if]
    [have_unit]
      id=ghost2
    [/have_unit]
    [else]
       [message]
         speaker=demon2
         message= _ "Rise, fallen soul, return from thy undeserved rest. Thy eternal rest hast not cometh yet. Return and haunt thy comrades again."
       [/message]
       [unit]
         type=Ghost
         side=3
         id=ghost2
         x={X}
         y={Y}
       [/unit]
     [/else]
  [/if]
  [if]
    [have_unit]
      id=ghost3
    [/have_unit]
    [else]
       [message]
         speaker=demon2
         message= _ "Rise, fallen soul, return from thy undeserved rest. Thy eternal rest hast not cometh yet. Return and haunt thy comrades again."
       [/message]
       [unit]
         type=Ghost
         side=3
         id=ghost3
         x={X}
         y={Y}
       [/unit]
     [/else]
  [/if]
  [if]
    [have_unit]
      id=ghost4
    [/have_unit]
    [else]
       [message]
         speaker=demon2
         message= _ "Rise, fallen soul, return from thy undeserved rest. Thy eternal rest hast not cometh yet. Return and haunt thy comrades again."
       [/message]
       [unit]
         type=Ghost
         side=3
         id=ghost4
         x={X}
         y={Y}
       [/unit]
     [/else]
  [/if]
  [if]
    [have_unit]
      id=ghost5
    [/have_unit]
    [else]
       [message]
         speaker=demon2
         message= _ "Rise, fallen soul, return from thy undeserved rest. Thy eternal rest hast not cometh yet. Return and haunt thy comrades again."
       [/message]
       [unit]
         type=Ghost
         side=3
         id=ghost5
         x={X}
         y={Y}
       [/unit]
     [/else]
  [/if]
  [if]
    [have_unit]
      id=ghost6
    [/have_unit]
    [else]
       [message]
         speaker=demon2
         message= _ "Rise, fallen soul, return from thy undeserved rest. Thy eternal rest hast not cometh yet. Return and haunt thy comrades again."
       [/message]
       [unit]
         type=Ghost
         side=3
         id=ghost6
         x={X}
         y={Y}
       [/unit]
     [/else]

  [/if]
#enddef
{GHOST_CHECK 1 10 44}
{GHOST_CHECK 2 10 45}
{GHOST_CHECK 3 10 46}
{GHOST_CHECK 4 13 44}
{GHOST_CHECK 5 13 45}
{GHOST_CHECK 6 13 46}
#undef GHOST_CHECK
 [/then]
[/if]
[/event]




Something like this ?
Currently on goblin campaign "A goblin adventure" (available) and troll campaign "From Rocks and Blood"(not available yet)
User avatar
Graziani
 
Posts: 76
Joined: December 20th, 2010, 1:04 am
Location: France

PreviousNext

Return to WML Workshop

Who is online

Users browsing this forum: Google [Bot] and 4 guests