Stupid Questions (see last post)
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: Stupid Questions (see last post)
Here is the AMLA code:
Code: Select all
#define EFFECT_INCREASE_REQ_EXPERIENCE _AMOUNT
[effect]
apply_to=max_experience
increase={_AMOUNT}
[/effect]
#enddef
#define AMLA_ENDURANCE
[advancement]
id=CON
max_times=4
description= _ "Constitution: hitpoints +6 (Max XP +10%)"
image="attacks/endurance.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 10%}
[effect]
apply_to=hitpoints
increase=6
increase_total=6
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_STRENGTH
[advancement]
id=STR
max_times=3
description= _ "Strength: melee damage +1 (Max XP +10%)"
image="attacks/strength.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 10%}
[effect]
apply_to=attack
range=melee
increase_damage=1
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_PRECISION
[advancement]
id=PREC
max_times=3
description= _ "Precision: range damage +1 (Max XP +10%)"
image="attacks/precision.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 10%}
[effect]
apply_to=attack
range=ranged
increase_damage=1
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_SPEED
[advancement]
id=SPEED
max_times=3
description= _ "Speed: moves +1 (Max XP +10%)"
image="attacks/speed.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 10%}
[effect]
apply_to=movement
increase=1
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_RESISTANCE
[advancement]
id=RES
max_times=3
description= _ "Arcane, Fire and Cold Ressistance +10 (Max XP +10%)"
image="attacks/resistance.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 10%}
[effect]
apply_to=resistance
replace=false
[resistance]
fire=-10
cold=-10
arcane=-10
[/resistance]
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_SPELLPOWER
[advancement]
id=SPLP
max_times=3
description= _ "Spellpower: spell damage +10% (Max XP +20%)"
image="attacks/spellpower.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 20%}
[effect]
apply_to=attack
special=magical
increase_damage=10%
[/effect]
[effect]
apply_to=attack
special=lightningstrike
increase_damage=10%
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#************************
#ADVANCED
#************************
#define AMLA_QUICKSTRIKE
[advancement]
id=QS
require_amla="STR,PREC"
max_times=1
description= _ "Quickstrike: melee strikes +1 (Max XP +20%)"
image="attacks/quickstrike.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 20%}
[effect]
apply_to=attack
range=melee
increase_attacks=1
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_DEFENSE
[advancement]
id=DEF
require_amla="STR,SPEED"
max_times=2
description= _ "Defense: increased defense on all terrain by +5% (Max XP +10%)"
image="attacks/heater-shield.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 10%}
[effect]
apply_to=defense
replace=false
[defense]
frozen=-5
castle=-5
sand=-5
village=-5
flat=-5
hills=-5
mountains=-5
cave=-5
shallow_water=-5
coastal_reef=-5
swamp_water=-5
forest=-5
fungus=-5
deep_water=-5
unwalkable=-5
[/defense]
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_FORTRESS
[advancement]
id=FORT
require_amla="STR,CON"
max_times=1
description= _ "Fortress: armor rating +10%, -1 movement point (Max XP +10%)"
image="icons/steel_armor.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 10%}
[effect]
apply_to=resistance
replace=false
[resistance]
blade=-10
impact=-10
pierce=-10
[/resistance]
[/effect]
[effect]
apply_to=movement
increase=-1
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_SURESTRIKE
[advancement]
id=SSTRIKE
require_amla="PREC,SPEED"
max_times=1
description= _ "Sure Strike: +10% chance to hit (Max XP +20%)"
image="attacks/fist-human.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 20%}
[effect]
apply_to=attack
increase_accuracy=10%
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
#define AMLA_TOUGH
[advancement]
id=TOUGH
require_amla="CON,SPEED"
max_times=1
description= _ "Tough: Strong metabolism increases healing and poison resistance. (Max XP +20%)"
image="attacks/word3.png"
{EFFECT_INCREASE_REQ_EXPERIENCE 20%}
[effect]
apply_to=new_ability
[abilities]
{ABILITY_TOUGH}
[/abilities]
[/effect]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/advancement]
#enddef
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Stupid Questions (see last post)
You have [advancement] tags both in the macro definitions and in around the uses of the macros (the
{AMLA_FOO}
things). That means the WML after preprocessing contains [advancement][advancement]...[/advancement][/advancement] which is not valid.Re: Stupid Questions (see last post)
Ok, got most things working.
One annyoing bug is that the holy water overlay doesn't go away. I don't remembe doing it before.
One annyoing bug is that the holy water overlay doesn't go away. I don't remembe doing it before.
Code: Select all
#define HOLY_WATER X Y
{PICK_UP (items/holy-water.png) ({X}) ({Y})
( _ "Holy water! What luck, it's just what we need against undead!")
(
[object]
id=holywater_{X}_{Y}
image=items/holy-water.png
duration=level
name= _ "Holy Water"
description= _ "By poring the contents of this flask over a weapon, one can temporarily bless it."
cannot_use_message= _ "This unit cannot use this item."
[filter]
x={X}
y={Y}
[not]
[filter_wml]
[status]
not_living=yes
[/status]
[/filter_wml]
[/not]
[not]
race=bats
[/not]
[/filter]
[then]
[remove_item]
x,y={X},{Y}
[/remove_item]
[/then]
[effect]
apply_to=attack
range=melee
set_type=arcane
[/effect]
[effect]
apply_to=overlay
add="overlays/arcane-icon.png"
[/effect]
[/object]
)}
#enddef
#define PICK_UP _IMG _X _Y _VERBOSE_MSG _OBJECT_CODE_AND_ACTIONS
[event]
name=victory
[clear_variable]
name=pickups.generic_flag_{_X}_{_Y}
[/clear_variable]
[/event]
[item]
image={_IMG}
x={_X}
y={_Y}
[/item]
[event]
name=moveto
first_time_only=no
[filter]
side=1
x={_X}
y={_Y}
[/filter]
{REDRAW}
[if]
[variable]
boolean_equals=no
name=pickups.generic_flag_{_X}_{_Y}
[/variable]
[then]
[message]
speaker=unit
message={_VERBOSE_MSG}
[/message]
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Do you want this unit to pick up this item?"
[option]
message= _ "Yes"
[command]
{_OBJECT_CODE_AND_ACTIONS}
[+object]
[+then]
# Mark object as picked-up; won't happen if the object's filter
# doesn't match primary_unit
[set_variable]
name=pickups.generic_flag_{_X}_{_Y}
value="yes"
[/set_variable]
[/then]
[/object]
[/command]
[/option]
[option]
message= _ "No"
[command]
[allow_undo]
[/allow_undo]
[/command]
[/option]
[/message]
[/then]
[/if]
[/event]
#enddef
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Stupid Questions (see last post)
It actually is. [object] is used both to describe object, and action that adds object.
Re: Stupid Questions (see last post)
???
It actually is.. what?
My HP mod works now. The Scaling mod doesn't solve the issue. Doubling HP is kinda pointless if damage is also doubled, since TTK remains the same.It's "Scaling Mod".
But I can see some use, because % based traits/attributes are REALYL wonky with small numbers.
+10% damage on an attack that normally does 5 does nothing
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Stupid Questions (see last post)
Response to post that has been deleted.
Re: Stupid Questions (see last post)
Ah, OK.
Looks like the only issue is the Holy Water overlay that won't go away.
Looks like the only issue is the Holy Water overlay that won't go away.
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Stupid Questions (see last post)
I can't get my WORD OF POWER weapon special to work
Can't figure out why it won't work. Only 1 enemy gets damaged
Can't figure out why it won't work. Only 1 enemy gets damaged
Code: Select all
#define WORD
[event]
name=attacker_hits
first_time_only=no
[filter_attack]
special=word
[/filter_attack]
[harm_unit]
[filter]
[filter_adjacent]
x,y=$x1,$y1
[/filter_adjacent]
# The defender was already damaged.
[not]
x,y=$x2,$y2
[/not]
[/filter]
[filter_second]
x,y=$x1,$y1
[/filter_second]
amount=$($damage/1.5)
damage_type=$weapon.type
fire_event=yes
experience=yes
[/harm_unit]
[harm_unit]
[filter]
[filter_adjacent]
x,y=$x1,$y1
[/filter_adjacent]
# The defender was already damaged.
[not]
x,y=$x2,$y2
[/not]
[/filter]
[filter_second]
x,y=$x1,$y1
[/filter_second]
amount=8
damage_type=impact
fire_event=yes
experience=no
[/harm_unit]
# Harm units two hexes away from the attacker (half damage).
[harm_unit]
[filter]
[filter_location]
# Exclude the units that just received full damage.
[not]
x,y=$x1,$y1
radius=1
[/not]
# Include the remaining units within two hexes.
[and]
x,y=$x1,$y1
radius=2
[/and]
side=$enemy_sides
[/filter_location]
[/filter]
[filter_second]
x,y=$x1,$y1
[/filter_second]
amount=4
damage_type=impact
fire_event=yes
experience=yes
[/harm_unit]
[harm_unit]
[filter]
[filter_location]
# Exclude the units that just received full damage.
[not]
x,y=$x1,$y1
radius=1
[/not]
# Include the remaining units within two hexes.
[and]
x,y=$x1,$y1
radius=2
[/and]
side=$enemy_sides
[/filter_location]
[/filter]
[filter_second]
x,y=$x1,$y1
[/filter_second]
amount=$($damage/2)
damage_type=$weapon.type
fire_event=yes
experience=no
[/harm_unit]
[/event]
#enddef
#define WEAPON_SPECIAL_WORD
[dummy]
id=word
name= _ "Word of Power"
description= _ "A massive shockwave that will damage everything around the caster."
[/dummy]
#enddef
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Stupid Questions (see last post)
You should try these [harm_unit] sections one at a time, testing after each one, so if something doesn't work, you know where to look. Inside each [harm_unit] tag, you should also add your [filter] and [filter_location] conditions one at a time (testing after each one) for the same reason, and add your formulas last when you know everything else works properly. You would have found that at least some of these break at the formula step. Unless you defined $damage somewhere else, you probably wanted $damage_inflicted.
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