Bitrons WML Questions
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.
Re: [Ability] - Inspiration
Ability code. Your code is almost correct.
There is an error that might be preventing it from working. The game cannot know what unit is to be affected by your object. Add this into its code to let it know:
There is an error that might be preventing it from working. The game cannot know what unit is to be affected by your object. Add this into its code to let it know:
Code: Select all
[filter]
id=$inspired[$i].id
[/filter]
Last edited by Dugi on November 17th, 2015, 4:01 pm, edited 1 time in total.
Re: [Ability] - Inspiration
Well, it still dont work :/
I also tried it within the [effect] block
Code: Select all
[object]
[filter]
id=inspired[$i].id
[/filter]
silent=yes
duration=turn
[effect]
increase_damage=1
increase_accuracy=10
[/effect]
[/object]
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
- James_The_Invisible
- Posts: 534
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: [Ability] - Inspiration
Add apply_to=attack to [effect] tag.
My content: For Power series
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Re: [Ability] - Inspiration
oh thanks! but still...
here's the whole thing again:
here's the whole thing again:
Code: Select all
#define ABILITY_INSPIRATION
[dummy]
id=inspiration
name= _ "Inspiration"
description= _ "Inspires adjacent units and makes them faster and stronger."
[/dummy]
[/abilities]
[event]
name=turn refresh # After the normal restoration of movement
first_time_only=no
id=inspiration_movement_event
[store_unit]
[filter]
[filter_adjacent] # Grab all units standing next to units with inspiration
ability=inspiration
[filter_side] # Don't get inspired by enemies
is_enemy=no
[/filter_side]
[/filter_adjacent]
[/filter]
variable=inspired
[/store_unit]
{FOREACH inspired i} # Repeat this for every inspired unit
{VARIABLE_OP inspired[$i].moves add 1} # Add 1 movement point to the moves restored to maximum
[unstore_unit] # Return it back to the game
variable=inspired[$i]
find_vacant=no
[/unstore_unit]
[object]
[filter]
id=inspired[$i].id
[/filter]
silent=yes
duration=turn
[effect]
apply_to=attack
increase_damage=1
increase_accuracy=10
[/effect]
[/object]
{NEXT i}
{CLEAR_VARIABLE inspired} # Clean up
[/event]
[+abilities]
#enddef
Last edited by Bitron on November 17th, 2015, 3:33 pm, edited 1 time in total.
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: [Ability] - Inspiration
increase_accuracy=
doesn't work. You have to add a [chance_to_hit] weapon special like the one I showed you in an earlier post. Without the [filter_self] tag. In [effect], you can add weapon specials using the [specials] tag with mode=append (as long as apply_to=attack). The increase_damage=
part should work.- James_The_Invisible
- Posts: 534
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: [Ability] - Inspiration
It should according to wiki. Yes, it was added there just a few months ago but it was in Wesnoth for ages.Dugi wrote:increase_accuracy=
doesn't work.
My content: For Power series
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Re: [Ability] - Inspiration
Oh, haven't noticed. Now I am quite clueless why it doesn't work. Maybe Bitron could tell us what does work and what doesn't.
Re: [Ability] - Inspiration
Well.. all units next to Inspirators are getting the extra movementpoint, but not the additional damage and also not the additional accuracy. (using the last-posted ability-code)
I'd guess that the Object simply doesn't reach the the inspired unit, maybe its the filter?
I'd guess that the Object simply doesn't reach the the inspired unit, maybe its the filter?
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: [Ability] - Inspiration
:facepalm:
My bad.
Replace:
with:
My bad.
Replace:
id=inspired[$i].id
with:
id=$inspired[$i].id
Re: [Ability] - Inspiration
Very well!, it works!
The inspired Unit gets +1 movementpoint, +1 Damage for Both ranged and melee, and +10% accuracy for both ranged and melee!
But, if a unit is already inspired and keep staying next to a Inspirator, the buff stacks within the opponents turn and resets to normal buff again in my turn after.
The inspired Unit gets +1 movementpoint, +1 Damage for Both ranged and melee, and +10% accuracy for both ranged and melee!
But, if a unit is already inspired and keep staying next to a Inspirator, the buff stacks within the opponents turn and resets to normal buff again in my turn after.
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: [Ability] - Inspiration
Add
side=$side_number
into the first [filter] tag, as I wrote before.Re: [Ability] - Inspiration
Don't get inspired by enemies with Inspiration, or don't get inspired in the opponents turn?Dugi wrote:My implementation of the increased movement is not stackable. With an [object], you would have to be careful. The error that enemies inspire your units too can be fixed by replacing the partis_enemy=no
byenemy_of=$side_number
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: [Ability] - Inspiration
The quote pertains a different thing. Just add that
side=$side_number
into the first [filter] tag.Re: [Ability] - Inspiration
ahh okay .. so just like this ?:
Code: Select all
[store_unit]
[filter]
side=$side_number
[filter_adjacent] # Grab all units standing next to units with inspiration
ability=inspiration
[filter_side] # Don't get inspired by enemies
is_enemy=no
[/filter_side]
[/filter_adjacent]
[/filter]
variable=inspired
[/store_unit]
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code