Modifying unit and other questions by Elmor
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.
Modifying unit and other questions by Elmor
Hello, I`m trying to solve my problems with WML and it would be nice if I can have some advice.
I want to modify unit and here what exactly I need:
1) Add specials from variable or simply add specials.
2) Modify unit`s image.
3) Subtract damage from attack.
How can I do it in most easy way?
And where I can find all unit`s standart variables, which I can use when I store him to variable?
Also, I got prooblem with this part of code:
It must be "last breath" event", but it fires like "attack".
P.S.
Sorry for my english.
I want to modify unit and here what exactly I need:
1) Add specials from variable or simply add specials.
2) Modify unit`s image.
3) Subtract damage from attack.
How can I do it in most easy way?
And where I can find all unit`s standart variables, which I can use when I store him to variable?
Also, I got prooblem with this part of code:
Code: Select all
[event]
name=last breath
first_time_only=yes
[filter_second]
id=Bandit Leader
side=2
[/filter_second]
[message]
speaker=Bandit Leader
message= _ "You won!"
[/message]
[endlevel]
result=victory
[/endlevel]
[/event]
P.S.
Sorry for my english.
Last edited by Elmor on March 20th, 2014, 8:16 pm, edited 1 time in total.
Re: Modifying unit and other questions by Elmor
Coordinates $x and $y are wrong, use $x1 and $y1 instead (or $x2 and $y2 depends on the event where you use it).For now I got this, but it does
You've mistaken [filter] and [filter_second], your event fires when the bandit leader kills somebody.Also, I got prooblem with this part of code:
Re: Modifying unit and other questions by Elmor
Thank You, Dugi. I solved that, but its still open question about variables.
Also I realised that I don`t know how to use english in WML with arithmetic. I need to subtract damage, but I don`t know how to do it.
Also I realised that I don`t know how to use english in WML with arithmetic. I need to subtract damage, but I don`t know how to do it.
Re: Modifying unit and other questions by Elmor
It isn't obvious how to use mathematical functions in WML, because there aren't many examples. But, here are the basics.
Code: Select all
{VARIABLE x 3} # Sets x to 3
{VARIABLE_OP x sub 1} # Subtracts 1 from x, resulting in x=2
{VARIABLE_OP x add 20} # Adds 20 to x, resulting in x=22
{VARIABLE_OP x multiply 3} # Multiplies x by 3, resulting in x=66
{VARIABLE_OP x divide 6} # Divides x by 6, resulting in x=11
{VARIABLE_OP x rand (1..10)} # Sets a random number between 1 and 10 to x
# You can also do this instead:
{VARIABLE x "$($second_unit.hitpoints-20+$unit.resistance.fire*73/)"}
Re: Modifying unit and other questions by Elmor
Now I got this problem:
In that part of code I want make message to show options, which will show next options. But second options must be shown only if variable match filter. For now second options are always shown.
In that part of code I want make message to show options, which will show next options. But second options must be shown only if variable match filter. For now second options are always shown.
Code: Select all
[command]
[message]
speaker=Elmor
[option]
message="message"
[command]
[if]
[variable]
name=variable
not_equal="status"
[/variable]
[then]
[message]
speaker=Elmor
[option]
message="show info"
[command]
[message]
message="info"
[/message]
[/command]
[/option]
[/message]
[/then]
[/if]
[/command]
[/option]
[/message]
[/command]
Re: Modifying unit and other questions by Elmor
It's not_equals, not not_equal.