a weapon special
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.
a weapon special
I want to make a weapon special that turns the attacked unit into a different unit when it's night, and changes the side to the side of the attacker. How can I do this?
Re: a weapon special
A good start would be actually trying...?
You use a plague special that filters for a unit in a location with a chaotic unit bonus, and modify the unit's side at the end of the attack.
You use a plague special that filters for a unit in a location with a chaotic unit bonus, and modify the unit's side at the end of the attack.
Last edited by A Guy on June 23rd, 2009, 4:21 pm, edited 1 time in total.
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
Re: a weapon special
You can make an attacker_hits,defender_hits event which triggers when such an attack lands at night, and then change the opponent's type and side however you want. Use search to find how to change the type properly.
Re: a weapon special
Okay, attacker_hits, defender_hits, that's good, but how do I check is the unit attacker or defender?
Also, I want to turn the unit into a different unit regardless of the time when combat occurred, but what time it's currently.
It seems hard... What I'm actually up to is to make a unit I made, a werewolf, turn units he damaged into another werewolf.
What I currently have is {WEAPON_SPECIAL_PLAGUE_TYPE (Werewolf)}.
Also, I want to turn the unit into a different unit regardless of the time when combat occurred, but what time it's currently.
It seems hard... What I'm actually up to is to make a unit I made, a werewolf, turn units he damaged into another werewolf.
What I currently have is {WEAPON_SPECIAL_PLAGUE_TYPE (Werewolf)}.
Re: a weapon special
I think plague only turns units you've killed. Like the undead weapon special.
The attacker_hits/defender_hits is a completely different effect. Read the EventWML page in detail. It answers the questions you've asked.
The attacker_hits/defender_hits is a completely different effect. Read the EventWML page in detail. It answers the questions you've asked.
Re: a weapon special
Help me. I've found many thing that can help, but I have a problem the top-level tag for the special. If I make a new one, it won't do anything. [plague] is closest, but works only when the unit dies, not when it's hit. However, I will try.
Re: a weapon special
Here's a custom weapon special I made:
This code alone does absolutely nothing except display the name/description. The snazzy effect comes from the following two events: one to check if the attack with this special hits, and one that triggers every turn and hurts all the units that were hit with this attack. You would only need the first event, since the effect you're going for is immediate.
((EDIT: Note that these events should go inside the unit_type tag of the unit with the weapon special))
Code: Select all
[custom_poison]
name=_"weak poison"
description=_ "Weak Poison:
This attack poisons living targets. Poisoned units lose 2 HP every turn until they are cured or are reduced to 1 HP. Poison can not, of itself, kill a unit."
id=custom_poison
value=2
[/custom_poison]
((EDIT: Note that these events should go inside the unit_type tag of the unit with the weapon special))
The Event:
The Effect:
Re: a weapon special
You can just have attacker_hits,defender_hits in the event name instead of creating two separate events.
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
Re: a weapon special
I hadn't noticed that events can take multiple names before - thanks! I may be able to use that some time...A Guy wrote:You can just have attacker_hits,defender_hits in the event name instead of creating two separate events.
But does that work in this case? I would think you'd have to have two separate events because the filters would be different.
Re: a weapon special
Why would the filters be different? You're filtering for the same thing.
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
-
- Posts: 462
- Joined: June 8th, 2006, 3:25 am
Re: a weapon special
Because in one, he's filtering for the attacker having the ability, and in the other he's filtering for the defender having the ability. Also, in one he wants the defender to be poisoned, and in the other he wants the attacker to be poisoned. So, although the structure of the events is basically the same, the roles of unit (the attacker) and second_unit (the defender) have to be reversed - requiring two events.