Antar, Son of Rheor [Development Thread]
Moderator: Forum Moderators
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
Does anyone find it strange that Grimbold—a Guardsman—says "These wretched skeletons will feel the wrath of my axe!"?
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
@gooby:
Strange that I never noticed this.
Will be fixed with the next update.
Thank you.
Strange that I never noticed this.
Will be fixed with the next update.
Thank you.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
hey i just played the first scenario (on 11.2) and i liked it.
But some parts bother me:
1) in the wmlcode there is some code about new units abilites:
but it doesnt work like that,becue the second [modification] tag will be ignored, and you have to use [set_specials] if you want to add a weapn special. better use:
2) Antars "hit and run" ability dissalows undo his moves, becuase of an event wich handles his movetos, i would be happy if you could so somthing against that.
But some parts bother me:
1) in the wmlcode there is some code about new units abilites:
Code: Select all
[unit]
x,y=1,25
type=Lowitz_0
id=Lowitz
name= _ "Lowitz"
side=1
profile="data/campaigns/Liberty/images/portraits/harper.png"
facing=se
[modifications]
{TRAIT_LOYAL}
{TRAIT_RESILIENT}
[/modifications]
[modifications]
[object]
silent=yes
[effect]
apply_to=attack
name=club
[specials]
{WEAPON_SPECIAL_BACKSTAB}
[specials]
[/effect]
[/object]
[/modifications]
{IS_LOYAL}
[/unit]
[unit]
x,y=2,25
type=Segurd_0
id=Segurd
name= _ "Segurd"
side=1
profile="portraits/Segurd.png"
facing=se
[modifications]
{TRAIT_LOYAL}
{TRAIT_STRONG}
[/modifications]
[modifications]
[object]
silent=yes
[effect]
apply_to=new_ability
[abilities]
{ABILITY_STEADFAST}
[/abilities]
[/effect]
[/object]
[/modifications]
{IS_LOYAL}
[/unit]
Code: Select all
[unit]
x,y=1,25
type=Lowitz_0
id=Lowitz
name= _ "Lowitz"
side=1
profile="data/campaigns/Liberty/images/portraits/harper.png"
facing=se
[modifications]
{TRAIT_LOYAL}
{TRAIT_RESILIENT}
[/modifications]
[+modifications]
[object]
silent=yes
[effect]
apply_to=attack
name=club
[set_specials]
mode=append
{WEAPON_SPECIAL_BACKSTAB}
[/set_specials]
[/effect]
[/object]
[/modifications]
{IS_LOYAL}
[/unit]
[unit]
x,y=2,25
type=Segurd_0
id=Segurd
name= _ "Segurd"
side=1
profile="portraits/Segurd.png"
facing=se
[modifications]
{TRAIT_LOYAL}
{TRAIT_STRONG}
[/modifications]
[+modifications]
[object]
silent=yes
[effect]
apply_to=new_ability
[abilities]
{ABILITY_STEADFAST}
[/abilities]
[/effect]
[/object]
[/modifications]
{IS_LOYAL}
[/unit]
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
Thank you. Glad you like it.gfgtdf wrote:hey i just played the first scenario (on 11.2) and i liked it.
Oh, thank you for pointing me this issue.gfgtdf wrote: But some parts bother me:
1) in the wmlcode there is some code units abilites:
but it doesnt work like that,becue the second [modification] tag will be ignored, and you have to use [set_specials] if you want to add an ability.
And thank you for giving me a solution.
I know about that problem, but I have no solution.gfgtdf wrote:2) Antars "hit and run" ability dissalows undo his moves, becuase of an event wich handles his movetos, i would be happy if you could so somthing against that.
Maybe someone here can tell me how to fix it.
Here is the code:
Code: Select all
### Code original written by TheBladeRoden
#define WEAPON_SPECIAL_HIT_AND_RUN
[dummy]
id=hit and run
name= _ "hit and run"
description= _ "Hit and Run: Antar is light on his feet, this allows him to step back after attacking."
[/dummy]
#enddef
#define HIT_AND_RUN_EVENTS
[event]
name=side turn
first_time_only=no
[store_unit]
[filter]
side=$side_number
[filter_wml]
[attack]
[specials]
[dummy]
id=hit and run
[/dummy]
[/specials]
[/attack]
[/filter_wml]
[/filter]
variable=stored_hitandrun_unit
[/store_unit]
{FOREACH stored_hitandrun_unit i}
[set_variable]
name=stored_hitandrun_unit[$i].variables.saved_moves
value=$stored_hitandrun_unit[$i].max_moves
[/set_variable]
[unstore_unit]
variable=stored_hitandrun_unit
find_vacant=no
[/unstore_unit]
{CLEAR_VARIABLE stored_hitandrun_unit}
{NEXT i}
[/event]
[event]
name=moveto
first_time_only=no
[filter]
[filter_wml]
[attack]
[specials]
[dummy]
id=hit and run
[/dummy]
[/specials]
[/attack]
[/filter_wml]
[/filter]
[store_unit]
[filter]
x,y=$x1,$y1
[/filter]
kill=no
variable=stored_hitandrun_unit
[/store_unit]
[set_variable]
name=stored_hitandrun_unit.variables.saved_moves
value=$unit.moves
[/set_variable]
[unstore_unit]
variable=stored_hitandrun_unit
[/unstore_unit]
{CLEAR_VARIABLE stored_hitandrun_unit}
[/event]
[event]
name=attack end
first_time_only=no
[filter_attack]
special=hit and run
[/filter_attack]
[clear_variable]
name=adding_moves_back
[/clear_variable]
[store_unit]
variable=adding_moves_back
[filter]
x,y=$x1,$y1
[/filter]
[/store_unit]
[set_variable]
name=adding_moves_back.moves
value=$unit.variables.saved_moves
[/set_variable]
[set_variable]
name=adding_moves_back_minus_one
value=$unit.variables.saved_moves
[/set_variable]
{ASoR_REDRAW}
[if] ### the unit should have in any case three (or more) movepoints left after an offensive attack
[variable]
name=adding_moves_back_minus_one
greater_than=3
[/variable]
[then]
{VARIABLE_OP adding_moves_back_minus_one sub 1}
[/then]
[else]
[if]
[variable]
name=adding_moves_back_minus_one
equals=3
[/variable]
[then]
### do nothing
[/then]
[else]
[if]
[variable]
name=adding_moves_back_minus_one
equals=2
[/variable]
[then]
{VARIABLE_OP adding_moves_back_minus_one add 1}
[/then]
[else]
[if]
[variable]
name=adding_moves_back_minus_one
equals=1
[/variable]
[then]
{VARIABLE_OP adding_moves_back_minus_one add 2}
[/then]
[else]
[if]
[variable]
name=adding_moves_back_minus_one
equals=0
[/variable]
[then]
{VARIABLE_OP adding_moves_back_minus_one add 3}
[/then]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
{ASoR_REDRAW}
[unstore_unit]
variable=adding_moves_back
[/unstore_unit]
{MODIFY_UNIT x,y=$x1,$y1 moves $adding_moves_back_minus_one}
{CLEAR_VARIABLE adding_moves_back_minus_one}
{CLEAR_VARIABLE adding_moves_back}
[/event]
#enddef
Thanks for playing.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
well here http://wiki.wesnoth.org/UnitTypeWML#Attacks they say something about an "movement_used" key on attacks, i have never used it but it may work.
to have teh same effect as the former ability, you have to set the moves to 3 if they are lower than 3. in the attack_end event
to have teh same effect as the former ability, you have to set the moves to 3 if they are lower than 3. in the attack_end event
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
You mean I should use only the attack_end [event] instead of the Hit&Run ability?gfgtdf wrote:well here http://wiki.wesnoth.org/UnitTypeWML#Attacks they say something about an "movement_used" key on attacks, i have never used it but it may work.
to have teh same effect as the former ability, you have to set the moves to 3 if they are lower than 3. in the attack_end event
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
well currently you store the moved a unit has left (in the moveto event) to restore it later (in the attack_end event), becuase after a unit attacks the movement is set to 0.
but according to that page you can just add "movement_used=0" to the attack, to avoid movement points being taken by attacking.
but your code also checks weather the unit has less than 3 moves left and sets the moves to 3 in that case.
so if you want that behavior, you still have to do that manualy in the attck_end event.
so my plan was to add movement_used=0 to antar melee attack, the hit and run abiltiy and this event:
(note that i havent tested this events yet)
but according to that page you can just add "movement_used=0" to the attack, to avoid movement points being taken by attacking.
but your code also checks weather the unit has less than 3 moves left and sets the moves to 3 in that case.
so if you want that behavior, you still have to do that manualy in the attck_end event.
so my plan was to add movement_used=0 to antar melee attack, the hit and run abiltiy and this event:
(note that i havent tested this events yet)
Code: Select all
[event]
name=attack end
first_time_only=no
[filter_attack]
special=hit and run
[/filter_attack]
[lua]
code = <<
-- i think this is easier than wml.
local context = wesnoth.current.event_context
local unit = wesnoth.get_unit(context.x1, context.y1)
local max = function(a, b) return (a > b) and a or b end
unit.moves = max(unit.moves, 3)
>>
[lua]
[/event]
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
Great, I will give it a try.
Only thing:
I'm not sure if I understand you right.
Your code sets the remaining moves to three in any case, right?
But my intention was to set them at least to three (three ore more than three).
Sorry, but I don't understand what this lua code exactly does.
Only thing:
I'm not sure if I understand you right.
Your code sets the remaining moves to three in any case, right?
But my intention was to set them at least to three (three ore more than three).
Sorry, but I don't understand what this lua code exactly does.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
"max(unit.moves,3)" means "maximum of {unit.moves,3}" so unit.moves or 3 depending on what is higher.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
i tested your code, and it works perfectly.
Thank you.
Only thing is that this part seems not to work.
EDIT: May it be that unit.moves is zero in this case, because it has already attacked?
Thank you.
Only thing is that this part seems not to work.
The result is always three,in any case.gfgtdf wrote:"max(unit.moves,3)" means "maximum of {unit.moves,3}" so unit.moves or 3 depending on what is higher.
EDIT: May it be that unit.moves is zero in this case, because it has already attacked?
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
maybe you forgot adding "movement_used=0" on the antar file?
EDIT: in the sceond scenario when you meet GELPHRAD there is the same issue as in the first chapter with the double [modifications] tag
Code: Select all
[attack]
name=saber
movement_used=0
[specials]
{WEAPON_SPECIAL_HIT_AND_RUN}
[/specials]
[/attack]
EDIT: in the sceond scenario when you meet GELPHRAD there is the same issue as in the first chapter with the double [modifications] tag
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
Sorry, my fault.
Thank you very much for the code.
It works perfect now.
And it is so much shorter than the code I used before.
If you reach scenario 07 Revenge, there is also some code that prevents to undo a move.
I know this issue since a long time, but I have no idea what causes it, or how to fix it.
Maybe you like to help me again to fix it.
Thank you very much for the code.
It works perfect now.
And it is so much shorter than the code I used before.
If you reach scenario 07 Revenge, there is also some code that prevents to undo a move.
I know this issue since a long time, but I have no idea what causes it, or how to fix it.
Maybe you like to help me again to fix it.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
Fixed.gfgtdf wrote:EDIT: in the sceond scenario when you meet GELPHRAD there is the same issue as in the first chapter with the double [modifications] tag
Thank you.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
i took a look at chpter 7 and i found this:
in this event you use [if] instead of a filter so it is aways triggered, (the if is alwasy ckecked inside the events while filters are always checkted before event in called.)
using [filter_condition] instead of "if" seems like a good idea to me.
Code: Select all
[event]
name=moveto
first_time_only=no
[if]
[not]
[have_unit]
side=1,3
{UNSAVE_SIDE_OF_THE_RIVER}
[/have_unit]
[/not]
[and]
[variable]
name=message_already_spoken
numerical_equals=0
[/variable]
[/and]
[then]
[message]
speaker="ElorialDin"
message= _ "All of us are on the other side of the river!"
[/message]
[message]
speaker="ElorialDin"
message= _ "Now to you, Orc."
[/message]
{VARIABLE_OP message_already_spoken add 1}
[/then]
[/if]
[/event]
using [filter_condition] instead of "if" seems like a good idea to me.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Antar, Son of Rheor [Singleplayer Campaign Feedback Thr
Indeed, this did fix the issue.gfgtdf wrote:i took a look at chpter 7 and i found this:
...
in this event you use [if] instead of a filter so it is aways triggered, (the if is alwasy ckecked inside the events while filters are always checkted before event in called.)
using [filter_condition] instead of "if" seems like a good idea to me.
You found the problem in a bunch of code, in a very short time.
Wow, I am very very impressed.
Thank you very much.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR