Area attacks?

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
daonlynussa
Posts: 12
Joined: March 16th, 2010, 12:00 am

Area attacks?

Post by daonlynussa »

Is there a way to have one unit inflict damage upon several other adjacent units? I want to have a unit have an area attack and inflict damage on all surrounding units. Can someone help me?
User avatar
Pentarctagon
Project Manager
Posts: 5732
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Area attacks?

Post by Pentarctagon »

you could probably use [store_locations] to store all units within the given area and then use FOREACH to inflict the damage on each unit that was stored.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Area attacks?

Post by zookeeper »

There should be plenty of older threads about that, probably some with working example code too. Not that I could easily find any with a couple of searches, but still.
Post Reply