How do I make an item confer an ability?

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
ozymandias
Posts: 169
Joined: June 9th, 2005, 12:03 am
Location: Kiel, Germany

How do I make an item confer an ability?

Post by ozymandias »

I'd like to have a glowing pearl that gives "illuminates" to the unit that picks it up.

According to the Wiki, though, apply_to can only take the values new_attack, attack, hitpoints, movement, max_experience, loyal and status. No mention of "ability". Is the Wiki accurate, or am I missing something?
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

In general, the WML side of the wiki is pretty reliable. However, abilities are getting a makeover, so maybe it will become possible soon. I would also like items to be able to change defense and resistances (magic boots, extra armor)

You could open a feature request at http://www.gna.org/projects/wesnoth
Hope springs eternal.
Wesnoth acronym guide.
User avatar
appleide
Posts: 1003
Joined: November 8th, 2003, 10:03 pm
Location: Sydney,OZ

Post by appleide »

Hmm, i remember seeing a multiplayer scenario where there was this item that gave "quick" and "strong"... But i couldn't find the page that tells you how to do that. There is no trait section in the "effects" page either.
Why did the fish laugh? Because the sea weed.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

appleide wrote:Hmm, i remember seeing a multiplayer scenario where there was this item that gave "quick" and "strong"... But i couldn't find the page that tells you how to do that. There is no trait section in the "effects" page either.
You can definitely add traits, but now that I think of it, there doesn't seem to really be anything useful in the wiki about that. Since I'm better at WML than with wikis, I'll try to remember to write a simple macro for giving traits (custom ones, too) to units and just add it to somewhere in UsefulWMLFragments.

EDIT: After some hours of trying to do this, I'm starting to think that adding traits to an existing unit is practically impossible. Theoretically doable, I think, but I doubt anyone would want to try implementing it that way.
maliciouskorean
Posts: 57
Joined: January 1st, 2006, 4:53 pm

Post by maliciouskorean »

you could do it without the name 'stong' actually showing up, but still giving the unit +1 dmg and +2hp
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

maliciouskorean wrote:you could do it without the name 'stong' actually showing up, but still giving the unit +1 dmg and +2hp
Yes, in fact there is already a macro that does this very thing: OBJ_POTION_STRONG in items.cfg

You are also supposed to be able to modify a unit's traits_description, but in my experience it doesn't work as advertised. :\
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Flametrooper
Posts: 984
Joined: February 21st, 2006, 11:02 pm
Location: 0x466C616D65

Post by Flametrooper »

On the subject of what apply_to can do, is it possible to apply something to speed: Give a unit an extra attack chance? (example: make a unit with a 6-3 attack now have a 6-4 attack)?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Flametrooper wrote:On the subject of what apply_to can do, is it possible to apply something to speed: Give a unit an extra attack chance? (example: make a unit with a 6-3 attack now have a 6-4 attack)?
Yes, it's all explained in http://www.wesnoth.org/wiki/EffectWML.
Post Reply