WML request: Charm weapon special

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
Melon
Posts: 193
Joined: February 8th, 2008, 2:30 am
Location: Calgary

WML request: Charm weapon special

Post by Melon »

In the latest patch for my Yokai faction one of the abilities I attempted (but failed) to implement was a "charm" weapon special for the Feyborn Witch. The idea was to make her throw love potions at her enemies, which would deal some insignificant damage and convert any level 1 or level 0 hit by it over to your side. However on a miss the Witch hits herself instead and gets converted over to the same side as her target.

So to sum it up:
-This weapon special converts any level 0 or level 1 over to the attackers side. On a miss the attacking unit gets turned over to the defenders side.
-It cannot be used in retaliation (weapon value of 0)
-It does not effect non-living

It would be awesome if somebody could find the time to make this work.
Last edited by Melon on October 14th, 2008, 10:17 pm, edited 1 time in total.

User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: WML request: Charm weapon special

Post by zookeeper »

Version?

AI
Developer
Posts: 2394
Joined: January 31st, 2008, 8:38 pm

Re: WML request: Charm weapon special

Post by AI »


User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: WML request: Charm weapon special

Post by zookeeper »

AI wrote:http://www.wesnoth.org/wiki/WML_Abilities#Charm

That already does half of it.
It's absolutely horribly outdated and bloated code though. ;)

AI
Developer
Posts: 2394
Joined: January 31st, 2008, 8:38 pm

Re: WML request: Charm weapon special

Post by AI »

True, using MODIFY_UNIT 4 times in a row (on the same unit) is a terrible idea, but it should point you in the right direction.

User avatar
Melon
Posts: 193
Joined: February 8th, 2008, 2:30 am
Location: Calgary

Re: WML request: Charm weapon special

Post by Melon »

zookeeper wrote:Version?
You mean the Wesnoth version I'm using? 1.4.5, I think.
AI wrote:http://www.wesnoth.org/wiki/WML_Abilities#Charm
That already does half of it.
I'll admit that I don't know a lot about WML, but that code looks really ugly and I still have no idea how to do the other half.

User avatar
krotop
2009 Map Contest Winner
Posts: 433
Joined: June 8th, 2006, 3:05 pm
Location: Bordeaux, France

Re: WML request: Charm weapon special

Post by krotop »

If someone is working on this (especially you Melon), or intends to do so, let me know. I'm on this code too, with a working version of what I understood of this weapon_special.

Edit : If someone else wants to use the code, here it is.
Description : "Charm : Turns a living level 1 or level 0 unit to your side. Beware if all of your attacks miss, the charm user turns to the defender side, even if it is your leader. You can not charm an ennemy leader."
Edit 14th Dec, 2008 : cleaner version of charm.
Attachments
charm.zip
(1.08 KiB) Downloaded 180 times
Don't trust me, I'm just average player.
***
Game feedback for the Nightmares of Meloen
Art feedback by mystic x the unknown

Post Reply