Giving units new abilities.
Moderator: Forum Moderators
Giving units new abilities.
I ran into a small problem while making my campaigns third scenario. I have opponent(trevor) that gives you a staff of teleportation when he dies. The problem is how i give the unit teleport? I don`t know if it can be done with [object], i have tried Scott`s idea( i have been bugging him with PM`s of my WML N00biness) of variables, but it doesn`t seem to work.
I have tried teleunit.abilities and teleunit.ability.
This is my current try...
I have tried teleunit.abilities and teleunit.ability.
This is my current try...
Code: Select all
[event]
name=die
[filter]
description=Trevor
[/filter]
[message]
id=Moun_Laedos_42
description=Trevor
message= "No! My staff! It`s mine! MINE!"
[/message]
[kill]
description=Trevor
[/kill]
[item]
x=49
y=10
image=misc/item-staff.png
[/item]
[event]
name=moveto
[filter]
side=1
x=49
y=10
[/filter]
[object]
id={ID}
name= _ "staff of teleportation"
image=misc/item-staff.png
duration=forever
description= _ "This staff allows its wielder to teleport. It`s quite simple to use too!"
[filter]
side=1
x=49
y=10
[/filter]
[then]
[removeitem]
x=49
y=10
[/removeitem]
[/then]
[/object]
[event]
name=moveto
[filter]
side=1
x=49
y=10
[/filter]
[store_unit]
[filter]
x=49
y=10
[/filter]
variable=teleunit
[/store_unit]
[set_variable]
name=teleunit.ability
teleport=on
[/set_variable]
[unstore_unit]
variable=teleunit
x=49
y=10
[/unstore_unit]
[clear_variable]
variable=teleunit
[/clear_variable]
[/event]
[/event]
[/event]
Read about the adventurers of my pen & paper RPG group
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
When you set the variable, try something like
[set_variable]
name=teleunit.abilities.teleport
value=on
[set_variable]
I would try to get this to work by itself and not worry about defining the object. The object should be defined outside of the [event] tag - it should be a child of [scenario].
However, if there is a way to define an object so that it will give you teleport, then never mind about storing the unit/setting the variable.
[set_variable]
name=teleunit.abilities.teleport
value=on
[set_variable]
I would try to get this to work by itself and not worry about defining the object. The object should be defined outside of the [event] tag - it should be a child of [scenario].
However, if there is a way to define an object so that it will give you teleport, then never mind about storing the unit/setting the variable.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
- Elvish_Pillager
- Posts: 8137
- Joined: May 28th, 2004, 10:21 am
- Location: Everywhere you think, nowhere you can possibly imagine.
- Contact:
Abilities are not unit variables. The only way to change a unit's abilities is to change its type.scott wrote:name=teleunit.abilities.teleport
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
What a shame. I quess i`ll have to come up with different "reward" for killing him.Elvish Pillager wrote: Abilities are not unit variables. The only way to change a unit's abilities is to change its type.
Read about the adventurers of my pen & paper RPG group
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?