wml help please - will be a few 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
illcwaticando
Posts: 64
Joined: November 24th, 2007, 9:46 am

wml help please - will be a few questions.

Post by illcwaticando »

ok first things first is there a way to give a unit a trait or ability so that it makes gold? for example if the unit did not move attack or be attacked that turn it gives you 2 gold. ? if so what is it?

secondly is there a way to give a unit a trait or ability so that it gives units adjacent to it a predefined ranged attack which they then can use while still adjacent to the unit with the ability but only in defence? if so how?

thirdly lol is there a way to give a unit a ability/trait where it will act as a gate for a unit with the teleport ability? if it is possible would a new teleport ability have to be remade aswell? is so how?

thanks guys
User avatar
Thanatos
Posts: 408
Joined: January 17th, 2006, 9:00 pm
Location: The End.
Contact:

Re: wml help please - will be a few questions.

Post by Thanatos »

Try a look at UnitWML and AbilitiesWML.

I am NO WML wizard, but from my experience so far...

1) should be possible,
2) sounds complicated (even to play),
3) don't know.

So, I learned something today: I have to learn more about UnitWMl myself. :)
ThanatoNoth | Necromanteion | Undead Rights Protection Society
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
User avatar
Jequ
Posts: 196
Joined: February 18th, 2008, 1:28 pm

Re: wml help please - will be a few questions.

Post by Jequ »

ok first things first is there a way to give a unit a trait or ability so that it makes gold? for example if the unit did not move attack or be attacked that turn it gives you 2 gold. ? if so what is it?
A template to start with: Works Ability. Try to figure out how to modify that...
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: wml help please - will be a few questions.

Post by beetlenaut »

2) This is possible, but will be awfully complicated to program. You will need some experience with WML. Get the first one done and working, then worry about the second.
3) Not currently possible. I has been requested as a feature, so it sounds like it will happen eventually.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Lord_Aether

Re: wml help please - will be a few questions.

Post by Lord_Aether »

I'm sure with some fancy event-driven abilities that #3 is possible, but I wouldn't want to see the mess that would be :wink:

#1 should be pretty simple, and #2... I think I saw a thread some time ago that somebody was trying to do the same.
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: wml help please - will be a few questions.

Post by beetlenaut »

Lord_Aether wrote:I'm sure with some fancy event-driven abilities that #3 is possible, but I wouldn't want to see the mess that would be.
There are some hacks you could do, yes, but they would be ugly. And I don't mean just the code. If a teleporter moved next to a unit with the gate ability, you could pop up a dialog box asking the player to type x and y coordinates to teleport to. That would certainly work, but it would be clunky, you wouldn't be able to see all your possible moves, and the AI would not be able to use it or plan for it. You could also have the teleporter carry a village around with him when he's near the other unit. All in all, I'd rather wait until it's a feature of the game.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
illcwaticando
Posts: 64
Joined: November 24th, 2007, 9:46 am

Re: wml help please - will be a few questions.

Post by illcwaticando »

i agree ill wait for that one to become a feature, quick question where can i find a working version of darkness (opposite of illuminate)?

also trying to get inspireto work on a unit of mine this is the code i got whats wrong?
#define ABILITY_INSPIRE
[leadership]
id=leadership
value=10
cumulative=no
name= _ "inspire"
description= _ "Inspire:
This unit can inspire friendly units that are next to it, making them fight better.

Adjacent friendly level 1 units will do 10% more damage in battle. Does not work on SHADOWPRINES."
affect_self=no
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[filter]
level=1
[not]
type=EOR_Shadowprince [/not]
[/filter]
[/affect_adjacent]
[/leadership]
[leadership]
id=leadership
value=25
cumulative=no
affect_self=no
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[filter]
level=0
[/filter]
[/affect_adjacent]
[/leadership]
#enddef
illcwaticando
Posts: 64
Joined: November 24th, 2007, 9:46 am

Re: wml help please - will be a few questions.

Post by illcwaticando »

still need help guys thanks
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: wml help please - will be a few questions.

Post by beetlenaut »

illcwaticando wrote:still need help guys thanks
The only obvious thing I see is the [/not] at the end of a line. This is very hard to read though. From now on, please indent it like this:

Code: Select all

[tag]
    key=value
    second_key=value_too
    [another_tag]
        key=value
        another_key=value
    [/another_tag]
[/tag]
People will be much more likely to examine your code, and you can see errors better yourself.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
illcwaticando
Posts: 64
Joined: November 24th, 2007, 9:46 am

Re: wml help please - will be a few questions.

Post by illcwaticando »

im new to this so i dont know how to do that, and what should the above code be? instead
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: wml help please - will be a few questions.

Post by beetlenaut »

The only thing you have to do to make your code work is move the [/not] to its own line.

The rest of my post was me complaining that your code was hard to read. I was giving you an example of how to indent the lines between tags. Any reasonable text editor (in other words, not notepad) will do it automatically if you set it up that way.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply