Item problem
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.
Item problem
I have troubles with creating an "effect". What is does is if a unit moves over the item it doesn't pick it up. I made it work in one occasion but then i added another event and it stopped working.
Here is the other event and the item part:
Here is the other event and the item part:
Code: Select all
[event]
name=moveto
first_time_only=yes
[filter]
side=1
x=5
y=6
[/filter]
[message]
speaker=narrator
message= _ "I sense the ancient sceptre is nearby. I should take a look at that tree"
[/message]
[/event]
[event]
name=moveto
first_time_only=yes
[filter]
x=4
y=5
[not]
side=2
[nor]
type=Bowman,Swordsman,Spearman
[/nor]
[/not]
[/filter]
[object]
{PLACE_IMAGE items/sceptre-of-fire.png X Y}
id=item_1
duration=forever
description= _ "The glorious red bright of the sceptre reflects on your armor."
[filter]
x=$x1
y=$y1
[/filter]
[then]
[remove_item]
x,y=4,5
[/remove_item]
[message]
speaker=narrator
image=items/sceptre-of-fire.png
message= _ "you have obtained the ancient fire sceptre"
[/message]
[/then]
[effect]
apply_to=new_attack
name=Sceptre of Fire
description= _ "ancient sceptre of fire"
icon=attacks/fireball.png
type=fire
range=ranged
[specials]
{WEAPON_SPECIAL_MAGICAL}
[/specials]
damage=20
number=2
[/effect]
[effect]
apply_to=new_animation
[attack_anim]
[filter_attack]
name=sceptre of fire
[/filter_attack]
{MISSILE_FRAME_FIREBALL_XY 0 0}
start_time=-200
[frame]
sound=fire.wav
[/frame]
[/attack_anim]
[/effect]
[/object]
[/event]
Re: Item problem
The first problem I spotted is "[nor]"... that is not a valid tag. Only use tags that are documented in the WML Reference as existing.
Could you explain what you are trying to do more clearly? Provide a detailed example of what you expect to happen. Then describe what goes wrong with your current implementation.Vonkex wrote:What is does is if a unit moves over the item it doesn't pick it up.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
- Pentarctagon
- Project Manager
- Posts: 5527
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Item problem
The Reference WML page is here. All documented valid tags are in the box on the right.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Item problem
If an unit moves to the item location and it stays there, the unit won't "pick" it up, i mean, the item will stay there waiting for an unit type which matches with the unit in the [filter] tag. Is very basic the "effect" Here is an example: if a bowman is standing over the sceptre of fire, it won't "pick it up". But if a general stands over it, it will "pick it up"Sapient wrote:The first problem I spotted is "[nor]"... that is not a valid tag. Only use tags that are documented in the WML Reference as existing.
Could you explain what you are trying to do more clearly? Provide a detailed example of what you expect to happen. Then describe what goes wrong with your current implementation.Vonkex wrote:What is does is if a unit moves over the item it doesn't pick it up.
Re: Item problem
I have entered the filter example page and i didn't found the nor tag, i misread the tag.