wml: creating new fun units (negative status effects)

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
needmoreplayers
Posts: 41
Joined: November 17th, 2023, 7:33 pm

wml: creating new fun units (negative status effects)

Post by needmoreplayers »

where to see example(s) of how wml code looks like for custom units

and how that code is put together in a page/essay to form a unit

looked at some of the wml stuff on this site's wiki but they dont have any examples and don't understand any of it yet

its easier to understand with specific examples

lets say custom unit would have 5-10 skills (within some of their attack/ability), and one of those skills is a negative status effect that does damage over time (let's say this skill is a higher damage over a shorter time, and can only be cured by drinking water

(by moving to any water hex)

or another way to cure that status effect is another's unit unique ability that cures only that status effect

let's just call that status effect for now 'acid/burning' or 'decay' or 'covid'

another negative status effect could be call 'covid' and that one could spread to other surrounding units in a 1-hex radius (can affect other allies and enemies) just an example


no idea right now what wml can and cant do when it comes to skills and other things about units
User avatar
Ravana
Forum Moderator
Posts: 2853
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: wml: creating new fun units (negative status effects)

Post by Ravana »

Such effects generally include steps
- save flag that effect is active, after for example getting hit by weapon special. It may include graphic effect visible for user
- trigger effect when needed, possibly once per turn
- remove effect, possibly because of levelup or village

WML can do all of it, but it is not very easy starting point. Most suitable example of such weapon special I rewrote in Lua few years ago. If you want to try implement it then I suggest first having it apply effect immediately, after that is tested add point 1, and finally point 3.
User avatar
Atreides
Posts: 942
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: wml: creating new fun units (negative status effects)

Post by Atreides »

Monster Hunt has a disease that spreads just like that.
needmoreplayers
Posts: 41
Joined: November 17th, 2023, 7:33 pm

lua or wml?

Post by needmoreplayers »

just to use this (thread topic) as an example

is it normally or usually easier for anyone to make units (and/or Mutiplayer campaigns) using lua or wml

ill use the example of status effect, for anyone starting at 0 is lua or wml usually easier or simpler to do this

this isn't the actual, it was an example


im assuming lua since assuming there'll be much more lua resources and good resources is commonly what ppl need to learn things effectively and also quickly (w/e things biology literature symbolic logic pharmacology fabric weaving w/e etc)
User avatar
Ravana
Forum Moderator
Posts: 2853
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: wml: creating new fun units (negative status effects)

Post by Ravana »

You cant create units or scenarios in Lua. You can implement event actions in Lua. The weapon special I referenced uses WML to call Lua functions. https://github.com/ProditorMagnus/Agele ... a#L55-L109 https://github.com/ProditorMagnus/Agele ... al/hex.cfg
Post Reply