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
I have another question for another weapon_special.
Is this valid code ? :
it should say
what it should do:
Example: Attack: 10-2
Opponent with 50% hitpoints: Damage 10-2 (50*2 = 100%)
Opponent with 80% hitpoints: Damage 4-2 (20*2 = 40%)
Opponent with 20% hitpoints: Damage 16-2 (80*2 = 160%)
Is this valid code ? :
multiply=$((($second_unit.max_hitpoints - $second_unit.hitpoints)/$second_unit.max_hitpoints)*2)
it should say
2*((MaxHP-HP)/MaxHP)
what it should do:
Example: Attack: 10-2
Opponent with 50% hitpoints: Damage 10-2 (50*2 = 100%)
Opponent with 80% hitpoints: Damage 4-2 (20*2 = 40%)
Opponent with 20% hitpoints: Damage 16-2 (80*2 = 160%)
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
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: [Ability] - Inspiration
You need to put everything to the right of the equals sign in quotes for this type of expression. Usually, that's optional, but not in this case. Also,
multiply
isn't correct. That's to multiply the previously-named variable by this amount, which is not what you are doing. You probably want value
or damage
depending on exactly where this is.Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: [Ability] - Inspiration
here's the whole thing:
why are the quotes neccessary in this case ?
Code: Select all
#define WEAPON_SPECIAL_EXECUTE
[damage]
id=execute
name= _ "Execute"
name_inactive=_ "Execute"
description= _ "the lower the acutal HP of the enemy is, the higher is the damage of this attack (only offensive)"
multiply="$((($second_unit.max_hitpoints - $second_unit.hitpoints)/$second_unit.max_hitpoints)*2)"
apply_to=defender
active_on=offense
[/damage]
#enddef
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
I don't think that any formulas are accepted inside weapon specials.
Re: [Ability] - Inspiration
formulas ? ..
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
oh okay. then I'll try rewrite it as an event.
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
Good Morning guys.
I hava another little problem. I'm working on the first campaign, and i wrote an event, in wich the attacked unit flees and hides in a forest, using
here es is the event:
Yes, messages are in german .. ill change it as soon as i have the english translations.
I hava another little problem. I'm working on the first campaign, and i wrote an event, in wich the attacked unit flees and hides in a forest, using
[hide_unit]
. The problem is, if this event triggers, instead of the one unit i want to hide, all other units get hide and the unit i want to hide is still visible. I tried several filter-variations .. nothing worked like i want it to.here es is the event:
Code: Select all
[event]
name=attack end
[filter]
side=1
[/filter]
[filter_second]
id=Karga
[/filter_second]
[message]
speaker=Karga
message= _ "Arrgh, ihr Maden! (flüsternd) Ich versteck mich vielleicht doch lieber."
[/message]
# moving Karga
{MOVE_UNIT id=Karga 17 3}
[hide_unit]
[filter]
id=Karga
[/filter]
[/hide_unit]
[modify_unit]
[filter]
id=Karga
[/filter]
max_moves=0
[/modify_unit]
[/event]
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
Try without [filter].
Re: [Ability] - Inspiration
like this ?Ravana wrote:Try without [filter].
Code: Select all
[...]
# moving Karga
{MOVE_UNIT id=Karga 17 3}
[hide_unit]
[/hide_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
- James_The_Invisible
- Posts: 536
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: [Ability] - Inspiration
No, this way:
Code: Select all
[hide_unit]
id=Karga
[/hide_unit]
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 right, that worked, thanks a lot !
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
And once again I'm here with a Problem.
I'm trying to programm a
My guess is the
here's the code:
Hope, someone can help me (:
All the best,
- Bitron
I'm trying to programm a
moveto
event with position specific messages using [have_location]
. But somehow it always uses the last possible [if]
Variation, in this case "des Eremiten"My guess is the
[have_location]
condition, but i have no clue where the mistake is.here's the code:
Code: Select all
[event]
name=moveto
first_time_only=yes
[filter]
id=Ysedda
[filter_location]
terrain=*^V*
# Houses within the Town
[not]
x=22
y=15
[/not]
[not]
x=18
y=15
[/not]
[/filter_location]
[/filter]
# wich neighbour should it be
[if]
[have_location]
x,y=15,25
[/have_location]
[then]
{VARIABLE neighbour_is (_ "des Bäckers")}
[/then]
[/if]
[if]
[have_location]
x,y=7,28
[/have_location]
[then]
{VARIABLE neighbour_is (_ "der alten Hexe")}
[/then]
[/if]
[if]
[have_location]
x,y=4,36
[/have_location]
[then]
{VARIABLE neighbour_is (_ "des Eremiten")}
[/then]
[/if]
[unit]
{CHARACTER_VEN}
side=1
x,y=$x1,$y1
[/unit]
[message]
speaker=Ysedda
message= _ "Was machst du denn hier? Das ist das Haus $neighbour_is!"
[/message]
[message]
speaker=Ven
message= _ "Der wohnt ein Haus weiter. Das hier gehört ei-.. mir."
[/message]
[message]
speaker=Ysedda
message= _ "Du plünderst schon wieder, statt zu kämpfen?"
[/message]
[message]
speaker=Ven
message= _ "Und wenn? Am Ende wird eh kein Kerker mehr übrig sein, in dem ich geworfen werden könnte!"
[/message]
[message]
speaker=Ysedda
message= _ "Stimmt. Um genau zu sein, können wir nicht nur keinen Kerker mitnehmen, sondern auch keine Diebe, die nur Ballast sind!"
[/message]
[message]
speaker=Ven
message= _ "Ich sehe schon, wo das hinführt. Nun gut, weil Ihr so nett darum bittet: Ich verteidige erneut mit Euch die Bewohner"
[/message]
{CLEAR_VARIABLE neighbour_is}
[/event]
#
# Brealla appears: Denvan version
#
[event]
name=moveto
[filter]
id=Denvan
x,y=7,16
[/filter]
[unit]
{CHARACTER_BREALLA}
x,y=8,16
[/unit]
[message]
speaker=Brealla
message= _ "(gespielt bestürzt) Denvan! Du kannst doch nicht einfach so in das Haus einer allein lebenden Dame stürmen! Was sollen die Leute von dir denken?"
[/message]
[message]
speaker=Denvan
message= _ "Die denken, dass ich Verstärkung hole. Wir evakuieren das Dorf, du wirst gebraucht!"
[/message]
[message]
speaker=Brealla
message= _ "((etwas) ernster) Warum sagst du das nicht gleich? Ich bin unterwegs!"
[/message]
[/event]
All the best,
- Bitron
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
[have_location] only checks if such location exists on map. Effectively you check if map is large enough. You do not compare it with current event location.
Re: [Ability] - Inspiration
okay.
uhm...
would this work ?
oh, or
EDIT: the second worked for me!
Thanks anyway (:
uhm...
Code: Select all
[have_unit]
id=Ysedda
[filter_location]
y,x=X,Y
[filter_location]
[/have_unit]
oh, or
Code: Select all
[have_location]
x,y=X,Y
[filter]
id=Ysedda
[/filter]
[/have_location]
Thanks anyway (:
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