ON_SIGHTING Macro
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.
ON_SIGHTING Macro
So I know that using anything to do with sighting is bug prone but I wanted to know if there was anything I could do to get that fixed. I saw that the wiki recommended using the ON_SIGHTING macro and I tried using it. I still am running into bugs and I wanted to know if I was doing something wrong or if it's just an inevitability of doing what I'm trying to do.
I use the macro twice once for the first time a unit of side 2 is sighted, once the first time a unit of side 3 is. The first time a unit is sighted both of them fire. The scenario objectives do not show up until both dialogues end.
-This is what the code looks like (less the dialogue), I followed the example given.
I use the macro twice once for the first time a unit of side 2 is sighted, once the first time a unit of side 3 is. The first time a unit is sighted both of them fire. The scenario objectives do not show up until both dialogues end.
-This is what the code looks like (less the dialogue), I followed the example given.
Code: Select all
{ON_SIGHTING () 1 side=3 (
[message]
#Long string of messages
[/message]
[objectives]
[objective]
description= _ "Defeat the enemy leader."
condition=win
[/objective]
{HOW_TO_LOSE}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
)}
{ON_SIGHTING () 1 side=2 (
[message]
#several more messages
[/message]
)}
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
Re: ON_SIGHTING Macro
The macro/event should have an id if more than one is used (the unused argument in your example). Other than that, plain old moveto events are probably the only safe way to get the desired behavior.
Note that in 1.11.x sighted events can be relayed again.
Note that in 1.11.x sighted events can be relayed again.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: ON_SIGHTING Macro
"relied upon"trewe wrote:Note that in 1.11.x sighted events can be relayed again.
Yes, please support jamit's hard work in this area, and report any potential remaining problems to him, when using 1.11.x.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: ON_SIGHTING Macro
This was for 1.11.x
So for mutliple of these I need to provide each of them with a distinct id. Am I safe in assumeing that how the id actually reads is irrelevant?
So for mutliple of these I need to provide each of them with a distinct id. Am I safe in assumeing that how the id actually reads is irrelevant?
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."