couple questions...

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
Rakarei55555
Posts: 60
Joined: June 4th, 2009, 1:58 am
Location: Lost in the Supermarket

couple questions...

Post by Rakarei55555 »

how do make a unit move, like in a mini cut scene before a scenario?
and how do i make the screen shake?
Don't let anyone else
Tell you who you are
User avatar
solsword
Code Contributor
Posts: 291
Joined: January 12th, 2009, 10:21 pm
Location: Santa Cruz, CA
Contact:

Re: couple questions...

Post by solsword »

http://www.wesnoth.org/macro-reference.xhtml

Specifically, the MOVE_UNIT and QUAKE macros (there's also EARTHQUAKE...). If you just want screen-shaking, look at how those macros do it.

Note that the MOVE_UNIT macro will break if the destination has a unit on it already. There should be a fixed version of that macro somewhere in the useful macros wiki pages.
The Knights of the Silver Spire campaign.

http://www.cs.hmc.edu/~pmawhorter - my website.

Teamcolors for everyone! PM me for a teamcolored version of your sprite, or you can do it yourself. If you just happen to like magenta, no hard feelings?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: couple questions...

Post by zookeeper »

solsword wrote:Note that the MOVE_UNIT macro will break if the destination has a unit on it already.
Not really, the unit will simply move to a free adjacent hex instead.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: couple questions...

Post by Anonymissimus »

zookeeper wrote:
solsword wrote:Note that the MOVE_UNIT macro will break if the destination has a unit on it already.
Not really, the unit will simply move to a free adjacent hex instead.
Though,
-the unit image will move to the occupied location and then jump to the free hex,
-the free hex will not be analyzed for suitable terrain and
-trying to move a unit that doesn't exist (but could, because it has been killed) will cause an error.
:P
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Post Reply