Tricky WML (Clever people needed)
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.
Tricky WML (Clever people needed)
Hi,
Can anyone tell me what's wrong with this code?
When I remove it works, but I need this part.
#note, the bit about the holy staff at the end is fine, I describe it earlier, just not posted.
If you want to help and need more info pls ask.
Thanks
Can anyone tell me what's wrong with this code?
When I remove
Code: Select all
{OBJ_BOOK_STRATEGY 33 22 book_strategy}
#note, the bit about the holy staff at the end is fine, I describe it earlier, just not posted.
If you want to help and need more info pls ask.
Thanks
Code: Select all
#define OBJ_BOOK_STRATEGY X Y book_strategy
{PLACE_IMAGE items/book1.png ({X}) ({Y})}
{VARIABLE book_taken 0}
[event]
name=moveto
first_time_only=no
[filter]
side=1
x={X}
y={Y}
[/filter]
[if]
[variable]
name=book_taken
numerical_equals=0
[/variable]
[then]
[message]
speaker=narrator
image="items/book1.png"
message= _ "Do you want this unit to pick up the staff?"
[object]
id={ID}
name= _ "Undead Strategy Guide"
image=items/staff-magic.png
duration=forever
description= _ "This legendary staff belonged to Minister Edmond, advisor to Prince Haldric and founder of the White order of Magi. When he passed away from old age, the staff was thought to have been lost."
cannot_use_message= _ "Only a powerful warrior or mage can use this staff!"
[/message]
[then]
[removeitem]
x,y={X},{Y}
[/removeitem]
[message]
speaker=narrator
image="items/book1.png"
message= _ "As you pick up the ornate staff, it starts to pulse with arcane energy. This mighty weapon will decimate magical creatures."
[/message]
{VARIABLE book_taken 1}
[/then]
[effect]
[set_menu_item]
id=book_strategy
description= _ "Undead Strategy Guide"
image=items/book1.png
[while]
[variable]
name=quit_menu
numerical_equals=0
[/variable]
[do]
[message]
speaker=narrator
side_for=$side_number
caption= _ " Undead Strategy Guide "
message= _ " Choose what you want to know: "
image=items/book1.png
[option]
message=*{MENU_IMG_TXT "items/book1.png" _"Close Strategy Guide"}
[command]
[set_variable]
name=quit_menu
value=1
[/set_variable]
[/command]
[/option]
[/message]
[/do]
[/while]
[clear_variable]
name=quit_menu
[/clear_variable]
[/set_menu_item]
[/effect]
[/object]
[/command]
[/option]
[/message]
[/then]
[/if]
[/event]
#enddef
{OBJ_STAFF_HOLY 9 12 holy_staff}
{OBJ_BOOK_STRATEGY 33 22 book_strategy}
Re: Tricky WML (Clever people needed)
#define OBJ_BOOK_STRATEGY X Y book_strategy
Re: Tricky WML (Clever people needed)
?
Code mistake?
Concept of strategy book?
Something really obvious that someone with IQ>0 could see?
Sorry, I don't get what your sarcastic but perfectly executed eye-rolling is directed at.
Code mistake?
Concept of strategy book?
Something really obvious that someone with IQ>0 could see?
Sorry, I don't get what your sarcastic but perfectly executed eye-rolling is directed at.
Re: Tricky WML (Clever people needed)
The book_strategy part of the macro isn't necessary.
Also, I don't see why a [/set_menu_item] tag is there when no [set_menu_item] tag was opened up.
Also, I don't see why a [/set_menu_item] tag is there when no [set_menu_item] tag was opened up.
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
Re: Tricky WML (Clever people needed)
book_strategy makes no difference it seems and set menu thingy is here:
[set_menu_item]
Code: Select all
#define OBJ_BOOK_STRATEGY X Y book_strategy
{PLACE_IMAGE items/book1.png ({X}) ({Y})}
{VARIABLE book_taken 0}
[event]
name=moveto
first_time_only=no
[filter]
side=1
x={X}
y={Y}
[/filter]
[if]
[variable]
name=book_taken
numerical_equals=0
[/variable]
[then]
[message]
speaker=narrator
image="items/book1.png"
message= _ "Do you want this unit to pick up the staff?"
[object]
id={ID}
name= _ "Undead Strategy Guide"
image=items/staff-magic.png
duration=forever
description= _ "This legendary staff belonged to Minister Edmond, advisor to Prince Haldric and founder of the White order of Magi. When he passed away from old age, the staff was thought to have been lost."
cannot_use_message= _ "Only a powerful warrior or mage can use this staff!"
[/message]
[then]
[removeitem]
x,y={X},{Y}
[/removeitem]
[message]
speaker=narrator
image="items/book1.png"
message= _ "As you pick up the ornate staff, it starts to pulse with arcane energy. This mighty weapon will decimate magical creatures."
[/message]
{VARIABLE book_taken 1}
[/then]
[effect]
Code: Select all
id=book_strategy
description= _ "Undead Strategy Guide"
image=items/book1.png
[while]
[variable]
name=quit_menu
numerical_equals=0
[/variable]
[do]
[message]
speaker=narrator
side_for=$side_number
caption= _ " Undead Strategy Guide "
message= _ " Choose what you want to know: "
image=items/book1.png
[option]
message=*{MENU_IMG_TXT "items/book1.png" _"Close Strategy Guide"}
[command]
[set_variable]
name=quit_menu
value=1
[/set_variable]
[/command]
[/option]
[/message]
[/do]
[/while]
[clear_variable]
name=quit_menu
[/clear_variable]
[/set_menu_item]
[/effect]
[/object]
[/command]
[/option]
[/message]
[/then]
[/if]
[/event]
#enddef
{OBJ_STAFF_HOLY 9 12 holy_staff}
{OBJ_BOOK_STRATEGY 33 22 book_strategy}
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: Tricky WML (Clever people needed)
You want #define OBJ_BOOK_STRATEGY X Y ID
Re: Tricky WML (Clever people needed)
Thanks but I've done this:
and get
Also, this didn't seem to affect anything on my holy_staff define earlier...
Code: Select all
#define OBJ_BOOK_STRATEGY X Y ID
Also, this didn't seem to affect anything on my holy_staff define earlier...
Re: Tricky WML (Clever people needed)
Just look at all the unnecessary closing tags you have at the end.
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
Re: Tricky WML (Clever people needed)
Code: Select all
#define OBJ_BOOK_STRATEGY X Y ID
{PLACE_IMAGE items/book1.png ({X}) ({Y})}
{VARIABLE book_taken 0}
[event]
name=moveto
first_time_only=no
[filter]
side=1
x={X}
y={Y}
[/filter]
[if]
[variable]
name=book_taken
numerical_equals=0
[/variable]
[/if]
[then]
[message]
speaker=narrator
image="items/book1.png"
[object]
id={ID}
name= _ "Undead Strategy Guide"
image=items/staff-magic.png
duration=forever
message= _ "This legendary staff belonged to Minister Edmond, advisor to Prince Haldric and founder of the White order of Magi. When he passed away from old age, the staff was thought to have been lost."
cannot_use_message= _ "Only a powerful warrior or mage can use this staff!"
[/object]
[/message]
[removeitem]
x,y={X},{Y}
[/removeitem]
[message]
speaker=narrator
image="items/book1.png"
message= _ "As you pick up the ornate staff, it starts to pulse with arcane energy. This mighty weapon will decimate magical creatures."
[/message]
{VARIABLE book_taken 1}
[/then]
[effect]
[set_menu_item]
id=book_strategy
description= _ "Undead Strategy Guide"
image=items/book1.png
[while]
[variable]
name=quit_menu
numerical_equals=0
[/variable]
[do]
[message]
speaker=narrator
side_for=$side_number
caption= _ " Undead Strategy Guide "
message= _ " Choose what you want to know: "
image=items/book1.png
[/message]
[option]
message=*{MENU_IMG_TXT "items/book1.png" _"Close Strategy Guide"}
[command]
[set_variable]
name=quit_menu
value=1
[/set_variable]
[/command]
[/option]
[/do]
[clear_variable]
name=quit_menu
[/clear_variable]
[/while]
[/set_menu_item]
[/effect]
[/then]
[/event]
#enddef
Re: Tricky WML (Clever people needed)
Then find out what is wrong. It's that simple.
Re: Tricky WML (Clever people needed)
What a brilliant idea, thanks
I have spent all evening trying different things to find out what is wrong...
I may just delete this and start again, most of the WML for this comes from some other add-on, but I modified it and...
I have spent all evening trying different things to find out what is wrong...
I may just delete this and start again, most of the WML for this comes from some other add-on, but I modified it and...
Re: Tricky WML (Clever people needed)
Try using wmlindent to make things easier for us.
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
Re: Tricky WML (Clever people needed)
OK, I'll do so and post tomorrow, ty for help/advice
Re: Tricky WML (Clever people needed)
Then figure out a more effective way of finding out what's wrong than reading the thing over and over again and changing random things. I'm not kidding. Read the sticky thread again if you've forgotten.Longbow wrote:I have spent all evening trying different things to find out what is wrong...
- DEATH_is_undead
- Posts: 960
- Joined: March 4th, 2007, 3:00 pm
- Location: Northern United States
Re: Tricky WML (Clever people needed)
Kind of cruel there, Zookeeper...zookeeper wrote:Then figure out a more effective way of finding out what's wrong than reading the thing over and over again and changing random things. I'm not kidding.Longbow wrote:I have spent all evening trying different things to find out what is wrong...
This might help with tags, if it is one.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.