Events name, id and order
The place to post your WML questions and answers.
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.
- ChaosRider
- Posts: 1170
- Joined: April 15th, 2012, 1:15 pm
Events name, id and order
Post by ChaosRider »
I have two addons like Extra Weapons Mode and Stats Bonus and problem is that I don't know how to make adding stats works after extra weapons adding. I even used event name from Extra Weapons Mode with higher count value yet still Stats Bonus increase first stats like damage and strikes before adding new weapons.
Extra Weapons code:
Stats Bonus code:
Setting stats bonus value:
Extra Weapons code:
Spoiler:
Code: Select all
[event]
name=start
id=extra_weapons_unit_menu_start_1
first_time_only=no
[if]
[have_unit]
side=$side_number
[/have_unit]
[then]
{EXTRA_WEAPONS_CREATE}
[/then]
[/if]
[/event]
[event]
name=side turn
id=extra_weapons_unit_menu_start_2
first_time_only=no
[if]
[have_unit]
side=$side_number
[/have_unit]
[then]
{EXTRA_WEAPONS_CREATE}
[/then]
[/if]
[/event]
[event]
name=recruit
id=extra_weapons_unit_menu_start_3
first_time_only=no
[filter]
side=$side_number
[/filter]
{EXTRA_WEAPONS_CREATE}
[/event]
[event]
name=post advance
id=extra_weapons_unit_menu_start_4
first_time_only=no
[filter]
side=$side_number
[/filter]
{EXTRA_WEAPONS_CREATE}
[/event]
Spoiler:
Code: Select all
[event]
name=recruit,side turn end
id=extra_weapons_unit_menu_start_6
first_time_only=no
[store_unit]
[filter]
[not]
[filter_wml]
[variables]
unit_after_adding_bonuses="on"
[/variables]
[/filter_wml]
[/not]
[/filter]
variable=add_new_bonuses_for_units
kill=no
[/store_unit]
{FOREACH add_new_bonuses_for_units x}
[object]
duration=forever
silent=yes
[filter]
id=$add_new_bonuses_for_units[$x].id
[/filter]
[effect]
apply_to=hitpoints
increase=$temp_set_stats_bonus_hit_points_value
increase_total=$temp_set_stats_bonus_hit_points_value
[/effect]
[effect]
apply_to=movement
increase=$temp_set_stats_bonus_movement_points_value
[/effect]
[effect]
apply_to=attack
increase_damage=$temp_set_stats_bonus_damages_number_value
increase_attacks=$temp_set_stats_bonus_strikes_number_value
[/effect]
[effect]
apply_to=resistance
replace=no
[resistance]
blade=-$temp_set_stats_bonus_resistances_value
pierce=-$temp_set_stats_bonus_resistances_value
impact=-$temp_set_stats_bonus_resistances_value
fire=-$temp_set_stats_bonus_resistances_value
cold=-$temp_set_stats_bonus_resistances_value
arcane=-$temp_set_stats_bonus_resistances_value
[/resistance]
[/effect]
[effect]
apply_to=defense
replace=no
[defense]
deep_water=-$temp_set_stats_bonus_terrain_defenses_value
shallow_water=-$temp_set_stats_bonus_terrain_defenses_value
reef=-$temp_set_stats_bonus_terrain_defenses_value
swamp_water=-$temp_set_stats_bonus_terrain_defenses_value
flat=-$temp_set_stats_bonus_terrain_defenses_value
sand=-$temp_set_stats_bonus_terrain_defenses_value
sand=-$temp_set_stats_bonus_terrain_defenses_value
forest=-$temp_set_stats_bonus_terrain_defenses_value
hills=-$temp_set_stats_bonus_terrain_defenses_value
village=-$temp_set_stats_bonus_terrain_defenses_value
castle=-$temp_set_stats_bonus_terrain_defenses_value
cave=-$temp_set_stats_bonus_terrain_defenses_value
frozen=-$temp_set_stats_bonus_terrain_defenses_value
fungus=-$temp_set_stats_bonus_terrain_defenses_value
[/defense]
[/effect]
[/object]
{MODIFY_UNIT id=$add_new_bonuses_for_units[$x].id variables.unit_after_adding_bonuses "on"}
{NEXT x}
{CLEAR_VARIABLE add_new_bonuses_for_units}
[/event]
Spoiler:
Code: Select all
[event]
name=start
id=extra_weapons_unit_menu_start_5
first_time_only=yes
{VARIABLE temp_set_stats_bonus "off"}
{VARIABLE temp_set_stats_bonus_damages_number "off"}
{VARIABLE temp_set_stats_bonus_strikes_number "off"}
{VARIABLE temp_set_stats_bonus_movement_points "off"}
{VARIABLE temp_set_stats_bonus_resistances "off"}
{VARIABLE temp_set_stats_bonus_terrain_defenses "off"}
{VARIABLE temp_set_stats_bonus_hit_points_value "250"}
{VARIABLE temp_set_stats_bonus_damages_number_value "20"}
{VARIABLE temp_set_stats_bonus_strikes_number_value "5"}
{VARIABLE temp_set_stats_bonus_movement_points_value "5"}
{VARIABLE temp_set_stats_bonus_resistances_value "15"}
{VARIABLE temp_set_stats_bonus_terrain_defenses_value "15"}
[while]
[variable]
name=temp_set_stats_bonus
equals="off"
[/variable]
[do]
[message]
speaker=narrator
message= _ "<span foreground='gold'>Chosen stats bonus:</span><span foreground='red'>
Hit points bonus: $temp_set_stats_bonus_hit_points_value
Damages number bonus: $temp_set_stats_bonus_damages_number_value
Strikes number bonus: $temp_set_stats_bonus_strikes_number_value
Movement points bonus: $temp_set_stats_bonus_movement_points_value
Resistances bonus: $temp_set_stats_bonus_resistances_value
Terrain defense bonus: $temp_set_stats_bonus_terrain_defenses_value</span>"
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting stats bonus."}
[command]
{VARIABLE temp_set_stats_bonus "on"}
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "items/bones.png~SCALE(36,36)" "Set hit points bonus."}
[command]
{VARIABLE temp_set_stats_bonus_hit_points "off"}
[while]
[variable]
name=temp_set_stats_bonus_hit_points
equals="off"
[/variable]
[do]
[message]
speaker=narrator
message= _ "<span foreground='gold'>Chosen hit points bonus:</span>
<span foreground='red'>Max +250
Current: $temp_set_stats_bonus_hit_points_value</span>"
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting hit points bonus."}
[command]
{VARIABLE temp_set_stats_bonus_hit_points "on"}
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_hit_points_value
less_than=246
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase hit points bonus by 5."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_hit_points_value
less_than=246
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value add 5}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value value 100}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_hit_points_value
less_than=241
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase hit points bonus by 10."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_hit_points_value
less_than=246
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value add 10}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value value 100}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_hit_points_value
less_than=226
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase hit points bonus by 25."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_hit_points_value
less_than=226
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value add 25}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value value 100}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_hit_points_value
less_than=201
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase hit points bonus by 50."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_hit_points_value
less_than=201
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value add 50}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value value 100}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_hit_points_value
greater_than=4
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease hit points bonus by 5."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_hit_points_value
greater_than=4
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value sub 5}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_hit_points_value
greater_than=9
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease hit points bonus by 10."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_hit_points_value
greater_than=9
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value sub 10}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_hit_points_value
greater_than=24
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease hit points bonus by 25."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_hit_points_value
greater_than=24
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value sub 25}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_hit_points_value
greater_than=49
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease hit points bonus by 50."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_hit_points_value
greater_than=49
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value sub 50}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_hit_points_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting hit points bonus."}
[command]
{VARIABLE temp_set_stats_bonus_hit_points "on"}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "items/spear-fancy.png~SCALE(36,36)" "Set damages number bonus."}
[command]
{VARIABLE temp_set_stats_bonus_damages_number "off"}
[while]
[variable]
name=temp_set_stats_bonus_damages_number
equals="off"
[/variable]
[do]
[message]
speaker=narrator
message= _ "<span foreground='gold'>Chosen damages number bonus:</span>
<span foreground='red'>Max +20
Current: $temp_set_stats_bonus_damages_number_value</span>"
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting damages number bonus."}
[command]
{VARIABLE temp_set_stats_bonus_damages_number "on"}
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_damages_number_value
less_than=20
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase damages number bonus by 1."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_damages_number_value
less_than=20
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value add 1}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value value 20}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_damages_number_value
less_than=19
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase damages number bonus by 2."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_damages_number_value
less_than=19
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value add 2}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value value 20}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_damages_number_value
less_than=18
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase damages number bonus by 3."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_damages_number_value
less_than=18
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value add 3}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value value 20}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_damages_number_value
less_than=16
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase damages number bonus by 5."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_damages_number_value
less_than=16
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value add 5}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value value 20}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_damages_number_value
greater_than=0
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease damages number bonus by 1."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_damages_number_value
greater_than=0
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value sub 1}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_damages_number_value
greater_than=1
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease damages number bonus by 2."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_damages_number_value
greater_than=1
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value sub 2}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_damages_number_value
greater_than=2
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease damages number bonus by 3."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_damages_number_value
greater_than=2
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value sub 3}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_damages_number_value
greater_than=4
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease damages number bonus by 5."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_damages_number_value
greater_than=4
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value sub 5}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_damages_number_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting damages number bonus."}
[command]
{VARIABLE temp_set_stats_bonus_damages_number "on"}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "items/bow-crystal-2.png~SCALE(36,36)" "Set strikes number bonus."}
[command]
{VARIABLE temp_set_stats_bonus_strikes_number "off"}
[while]
[variable]
name=temp_set_stats_bonus_strikes_number
equals="off"
[/variable]
[do]
[message]
speaker=narrator
message= _ "<span foreground='gold'>Chosen strikes number bonus:</span>
<span foreground='red'>Max +20
Current: $temp_set_stats_bonus_strikes_number_value</span>"
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting strikes number bonus."}
[command]
{VARIABLE temp_set_stats_bonus_strikes_number "on"}
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_strikes_number_value
less_than=5
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase strikes number bonus by 1."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_strikes_number_value
less_than=20
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_strikes_number_value add 1}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_strikes_number_value value 5}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_strikes_number_value
less_than=4
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase strikes number bonus by 2."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_strikes_number_value
less_than=19
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_strikes_number_value add 2}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_strikes_number_value value 20}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_strikes_number_value
greater_than=0
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease strikes number bonus by 1."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_strikes_number_value
greater_than=0
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_strikes_number_value sub 1}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_strikes_number_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_strikes_number_value
greater_than=1
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease strikes number bonus by 2."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_strikes_number_value
greater_than=1
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_strikes_number_value sub 2}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_strikes_number_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting strikes number bonus."}
[command]
{VARIABLE temp_set_stats_bonus_strikes_number "on"}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "items/flower3.png~SCALE(36,36)" "Set movement points bonus."}
[command]
{VARIABLE temp_set_stats_bonus_movement_points "off"}
[while]
[variable]
name=temp_set_stats_bonus_movement_points
equals="off"
[/variable]
[do]
[message]
speaker=narrator
message= _ "<span foreground='gold'>Chosen movement points bonus:</span>
<span foreground='red'>Max +5
Current: $temp_set_stats_bonus_movement_points_value</span>"
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting movement points bonus."}
[command]
{VARIABLE temp_set_stats_bonus_movement_points "on"}
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_movement_points_value
less_than=5
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase movement points bonus by 1."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_movement_points_value
less_than=20
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_movement_points_value add 1}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_movement_points_value value 5}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_movement_points_value
less_than=4
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase movement points bonus by 2."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_movement_points_value
less_than=19
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_movement_points_value add 2}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_movement_points_value value 20}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_movement_points_value
greater_than=0
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease movement points bonus by 1."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_movement_points_value
greater_than=0
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_movement_points_value sub 1}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_movement_points_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_movement_points_value
greater_than=1
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease movement points bonus by 2."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_movement_points_value
greater_than=1
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_movement_points_value sub 2}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_movement_points_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting movement points bonus."}
[command]
{VARIABLE temp_set_stats_bonus_movement_points "on"}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "items/armor-golden.png~SCALE(36,36)" "Set resistances."}
[command]
{VARIABLE temp_set_stats_bonus_resistances "off"}
[while]
[variable]
name=temp_set_stats_bonus_resistances
equals="off"
[/variable]
[do]
[message]
speaker=narrator
message= _ "<span foreground='gold'>Chosen resistances:</span>
<span foreground='red'>Max +15%
Current: $temp_set_stats_bonus_resistances_value</span>"
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting resistances."}
[command]
{VARIABLE temp_set_stats_bonus_resistances "on"}
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_resistances_value
less_than=11
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase resistances by 5."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_resistances_value
less_than=11
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_resistances_value add 5}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_resistances_value value 15}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_resistances_value
greater_than=4
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease resistances by 5."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_resistances_value
greater_than=4
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_resistances_value sub 5}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_resistances_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting resistances."}
[command]
{VARIABLE temp_set_stats_bonus_resistances "on"}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "items/scarecrow.png~SCALE(36,36)" "Set terrain defenses."}
[command]
{VARIABLE temp_set_stats_bonus_terrain_defenses "off"}
[while]
[variable]
name=temp_set_stats_bonus_terrain_defenses
equals="off"
[/variable]
[do]
[message]
speaker=narrator
message= _ "<span foreground='gold'>Chosen terrain defenses:</span>
<span foreground='red'>Max +15%
Current: $temp_set_stats_bonus_terrain_defenses_value</span>"
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting terrain defenses."}
[command]
{VARIABLE temp_set_stats_bonus_terrain_defenses "on"}
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_terrain_defenses_value
less_than=11
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book3.png~SCALE(36,36)" "Increase terrain defenses by 5."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_terrain_defenses_value
less_than=11
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_terrain_defenses_value add 5}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_terrain_defenses_value value 15}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[variable]
name=temp_set_stats_bonus_terrain_defenses_value
greater_than=4
[/variable]
[/show_if]
message= _ {MENU_IMG_TXT "items/book2.png~SCALE(36,36)" "Decrease terrain defenses by 5."}
[command]
[if]
[variable]
name=temp_set_stats_bonus_terrain_defenses_value
greater_than=4
[/variable]
[then]
{VARIABLE_OP temp_set_stats_bonus_terrain_defenses_value sub 5}
[/then]
[else]
{VARIABLE_OP temp_set_stats_bonus_terrain_defenses_value value 0}
[/else]
[/if]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting terrain defenses."}
[command]
{VARIABLE temp_set_stats_bonus_terrain_defenses "on"}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/option]
[option]
[show_if]
[/show_if]
message= _ {MENU_IMG_TXT "misc/flag-red.png~SCALE(36,36)" "End setting stats bonus."}
[command]
{VARIABLE temp_set_stats_bonus "on"}
[/command]
[/option]
[/message]
[/do]
[/while]
[/event]
Creator of WOTG (+5500 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.18 Wesnoth server.
- ChaosRider
- Posts: 1170
- Joined: April 15th, 2012, 1:15 pm
Re: Events name, id and order
Post by ChaosRider »
Ok, I think I found the solution:
https://wiki.wesnoth.org/Eventwml#id
Spoiler:
priority
(Version 1.17.20 and later only) If several '[event]' tags have the same name, then any with a high priority value will be triggered before events with a lower priority value. Negative numbers are also supported, to run after events without a priority (as the attribute defaults to zero). For events with equal priority, the order is determined by the order in which the events were added.
(Version 1.17.20 and later only) If several '[event]' tags have the same name, then any with a high priority value will be triggered before events with a lower priority value. Negative numbers are also supported, to run after events without a priority (as the attribute defaults to zero). For events with equal priority, the order is determined by the order in which the events were added.
Creator of WOTG (+5500 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.18 Wesnoth server.
- ChaosRider
- Posts: 1170
- Joined: April 15th, 2012, 1:15 pm
Events without set priority
Post by ChaosRider »
Hey, can you guys(admins/game developers) set for events without set by players/addons authors event priority default value equals zero for priority?
https://wiki.wesnoth.org/Eventwml#id
https://wiki.wesnoth.org/Eventwml#id
Creator of WOTG (+5500 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.18 Wesnoth server.
Post Reply
4 posts
• Page 1 of 1
Jump to
- Announcements
- ↳ News
- General
- ↳ Users’ Forum
- ↳ Tournaments
- ↳ Release Announcements, Compiling & Installation
- ↳ Technical Support
- ↳ iOS Support
- ↳ Strategies & Tips
- ↳ Gameplay Feedback
- ↳ Mainline Campaign Feedback
- ↳ Tutorial
- ↳ A Tale of Two Brothers
- ↳ An Orcish Incursion
- ↳ The South Guard
- ↳ Heir to the Throne
- ↳ Liberty
- ↳ Legend of Wesmere (single player)
- ↳ Legend of Wesmere (multiplayer)
- ↳ Eastern Invasion
- ↳ The Hammer of Thursagan
- ↳ Descent into Darkness
- ↳ Delfador’s Memoirs
- ↳ Dead Water
- ↳ Secrets of the Ancients
- ↳ Sceptre of Fire
- ↳ Son of the Black Eye
- ↳ The Rise of Wesnoth
- ↳ Northern Rebirth
- ↳ Under the Burning Suns
- ↳ Winds of Fate
- ↳ Add-on Feedback
- ↳ Website
- Development
- ↳ Art Contributions
- ↳ Art Workshop
- ↳ Writers’ Forum
- ↳ WML Workshop
- ↳ Lua Labs
- ↳ Faction & Era Development
- ↳ Multiplayer Development
- ↳ Scenario & Campaign Development
- ↳ Mainline Campaign Development
- ↳ UMC Replays
- ↳ Music & Sound Development
- ↳ Translations & Internationalization
- ↳ Translation Stats
- ↳ Ideas
- ↳ Coder’s Corner
- ↳ Developers’ Discussions
- ↳ Wesnoth Organizational Updates
- ↳ Art Development
- Miscellaneous
- ↳ Game Development
- ↳ Off-Topic
- ↳ Forum Games