Earthquakes events and kill units in a precise area

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
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Earthquakes events and kill units in a precise area

Post by Graziani »

Hi wesnoth community!

I have a question about earthquakes in Wesnoth (like in burning suns in final confrontation for example).

In the burning suns xml, i found this

Code: Select all


  [scroll]
            x=25
        [/scroll]
        [scroll]
            x=-25
        [/scroll]
        [scroll]
            x=25
        [/scroll]
        [scroll]
            x=-25
        [/scroll]
        [scroll]
            x=25
        [/scroll]
        [scroll]
            x=-25
        [/scroll]

        [redraw]
        [/redraw]

        [delay]
            time=400
        [/delay]

        [color_adjust]
            red,green,blue=40,0,100
        [/color_adjust]

        [redraw]
        [/redraw]

        [delay]
            time=250
        [/delay]

        [color_adjust]
            red,green,blue=0,0,0
        [/color_adjust]

        [redraw]
        [/redraw]


I presume that scroll is for the view, it's shake all the screen up and down.

But delay, color and redraw, what is it? I mean how use it to create some colors in the earthquake?


A last question, i would like to make an event that kills every units that are in a precise area (because of earthquake) with a change of terrain. I know how to modify terrain, but to kill the units i don't know at all how to do



Thanks in advance for your responses!
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Earthquakes events and kill units in a precise area

Post by Ceres »

Graziani wrote:But delay, color and redraw, what is it?
[scroll] is used to shake the screen by scrolling back and fourth by 25 pixels, [color_adjust] changes the color to a specified RGB value, [redraw] redraws the screen, [delay] creates a pause, the value is the duration given in milliseconds. To create an earthquake-y effect, you could use the same code and modify the values/add more/different colors.
A last question, i would like to make an event that kills every units that are in a precise area (because of earthquake) with a change of terrain. I know how to modify terrain, but to kill the units i don't know at all how to do
To kill units, use the [kill] tag. You can specify the area where you want to eradicate everything as a Standard Location Filter inside the Standard Unit Filter, like this

Code: Select all

[filter]
  [filter_location]
    x=1-20
    y=1-15
  [/filter_location]
[/filter]
User avatar
Paulomat4
Moderator Emeritus
Posts: 730
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: Earthquakes events and kill units in a precise area

Post by Paulomat4 »

to create an earthquake effect, you better use the EARTHQUAKE macro

Code: Select all

{EARTHQUAKE (put your kill tag or any other action wml in here)}
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Earthquakes events and kill units in a precise area

Post by Graziani »

Thanks a lot both of you i'm going to try the two codes!
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Earthquakes events and kill units in a precise area

Post by Graziani »

Code: Select all

[kill]
[filter]
  [filter_location]
    x=1-20
    y=1-15
  [/filter_location]
[/filter]
[/kill]
Strangely, every unit on the entire map is killed by this event... I tried some issues but everytime all the units are getting killed.
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Earthquakes events and kill units in a precise area

Post by Ravana »

Empty filter matches all units. You should reread the reference http://wiki.wesnoth.org/DirectActionsWML#.5Bkill.5D.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Earthquakes events and kill units in a precise area

Post by zookeeper »

Ceres wrote:
A last question, i would like to make an event that kills every units that are in a precise area (because of earthquake) with a change of terrain. I know how to modify terrain, but to kill the units i don't know at all how to do
To kill units, use the [kill] tag. You can specify the area where you want to eradicate everything as a Standard Location Filter inside the Standard Unit Filter, like this

Code: Select all

[filter]
  [filter_location]
    x=1-20
    y=1-15
  [/filter_location]
[/filter]
Except as the link says, don't use a [filter] tag. Also, you don't need to wrap x= and y= in a [filter_location], because those are part of StandardUnitFilter too.
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Earthquakes events and kill units in a precise area

Post by Graziani »

Code: Select all

[kill]
  [filter_location]
    x=1-20
    y=1-15
  [/filter_location]
[/kill]
It works perfectly like this. Thank you !
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Earthquakes events and kill units in a precise area

Post by Graziani »

Hello guys, I'm opening again this topic after five years to ask you again about earthquakes.

I really want to shake the screen and all my attempts are failing, I don"t like the result.

I tried this :

{EARTHQUAKE (
[sound]
name=rumble.ogg
[/sound]
)}
For this one, There is some lightning sound and the screen is shaking for less than one second, and it's a very small movement.

and I tried this :

Code: Select all

 {REPEAT 5 (
     {QUAKE "rumble.ogg"}
 )}
Even if it's close to what I want, the repeated sound is not clean and disturbing. The shake effect is good if you repeat x15/20 but the sound become horrible when you do so.

and I tried this (UTBS last level)

Code: Select all


  [scroll]
            x=25
        [/scroll]
        [scroll]
            x=-25
        [/scroll]
        [scroll]
            x=25
        [/scroll]
        [scroll]
            x=-25
        [/scroll]
        [scroll]
            x=25
        [/scroll]
        [scroll]
            x=-25
        [/scroll]

        [redraw]
        [/redraw]

        [delay]
            time=400
        [/delay]

        [color_adjust]
            red,green,blue=40,0,100
        [/color_adjust]

        [redraw]
        [/redraw]
       

        [delay]
            time=250
        [/delay]

        [color_adjust]
            red,green,blue=0,0,0
        [/color_adjust]

        [redraw]
        [/redraw]
But it doesn't work.

I'm kinda lost, I cannot find something useful in the forums, if you guys can help me. In the scenario, a cave is going to rumble on itself, and I really want a big screen shake.

Thanks in advance !
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Earthquakes events and kill units in a precise area

Post by WhiteWolf »

If you liked the results of

Code: Select all

{REPEAT 5 (
     {QUAKE "rumble.ogg"}
 )}
and it's just the sound that troubles you, then you could just play sound with the first one.

If you include an empty track called "silence.ogg" with your add-on, then it's just:

Code: Select all

{QUAKE "rumble.ogg"}
{REPEAT 4 (
	{QUAKE "silence.ogg"}
)}
Otherwise you just manually expand what the macro means, and omit the sound:

Code: Select all

{QUAKE "rumble.ogg"}
{REPEAT 4 (
    [scroll]
        x=5
        y=0
    [/scroll]
    [scroll]
        x=-10
        y=0
    [/scroll]
    [scroll]
        x=5
        y=5
    [/scroll]
    [scroll]
        x=0
        y=-10
    [/scroll]
    [scroll]
        x=0
        y=5
    [/scroll]
)}
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Earthquakes events and kill units in a precise area

Post by Graziani »

OMG I never thinked about using the silence.ogg !!!

Thank you so much WhiteWolf ! It's very useful, even the second one you gave me, that allow to manually adjust !
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
Post Reply