Help with sighted events
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.
Maybe it has something to do with the AI not being subject to fog or shroud.
I have a proximity detector that you might be able to use. It takes a single number for the radius, but you could use the unit's movement. However, it might not be too execution-efficient for multiple units on each side.
I have a proximity detector that you might be able to use. It takes a single number for the radius, but you could use the unit's movement. However, it might not be too execution-efficient for multiple units on each side.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
-
- Retired Developer
- Posts: 2633
- Joined: March 22nd, 2004, 11:22 pm
- Location: An Earl's Roadstead
If that is the problem, you might try turning on fog for the AI sides. It will have no effect on their ability to play, but it might do the trick for the sighted event WML.scott wrote:Maybe it has something to do with the AI not being subject to fog or shroud.
I have a proximity detector that you might be able to use. It takes a single number for the radius, but you could use the unit's movement. However, it might not be too execution-efficient for multiple units on each side.
"you can already do that with WML"
Fight Creeeping Biggerism!
http://www.wesnoth.org/forum/viewtopic. ... 760#131760
http://www.wesnoth.org/forum/viewtopic. ... 1358#11358
I am having similar problems with sighted events, but I found out that turning on fog like you suggested fixed the problem. To clarify, the sighted event does NOT fire with shroud, but DOES fire when fog is on (shroud or no shroud).
I don't think this is the correct behavior. Right?
I don't think this is the correct behavior. Right?
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
Do you mean sighted events in general, or sighted events triggered upon player 1 moving?scott wrote:I am having similar problems with sighted events, but I found out that turning on fog like you suggested fixed the problem. To clarify, the sighted event does NOT fire with shroud, but DOES fire when fog is on (shroud or no shroud).
I don't think this is the correct behavior. Right?
Sighted events in general work without fog, as you can see in Escape Tunnel, in Eastern Invasion.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
I think where the problem comes in is if a unit you are supposed to spot moves out from under the shroud, I don't think there is a way for you to sight it. (Unless it goes back under the shroud.)
The sighted event should probably be rethought, especially with the effort being put into making multiplayer campaigns.
One option might be to have it based on whether or not the unit being spotted is within or adjacent to the hexes that the spotting unit could move to on its next turn and not worry specifically about shroud or fog. However, this may not be very efficient.
One might also reconsider whether spotting can only be triggered once for each sighted unit or each pair of sighting and sighted units.
The sighted event should probably be rethought, especially with the effort being put into making multiplayer campaigns.
One option might be to have it based on whether or not the unit being spotted is within or adjacent to the hexes that the spotting unit could move to on its next turn and not worry specifically about shroud or fog. However, this may not be very efficient.
One might also reconsider whether spotting can only be triggered once for each sighted unit or each pair of sighting and sighted units.
This only works if fog is activated.
This is what I want to happen: when I move my unit and sight a bad guy, the dialog is displayed. I realize that the filter tags are backwards, but it works just like that with fog. Nothing with shroud only.
With shroud only, I can get the bad guys (side 4) to talk when they attempt to attack my side 1 units by reversing the filter tags.
This is what I want to happen: when I move my unit and sight a bad guy, the dialog is displayed. I realize that the filter tags are backwards, but it works just like that with fog. Nothing with shroud only.
Code: Select all
[event]
name=sighted
[filter]
side=4,5
[/filter]
[filter_second]
side=1
[/filter_second]
[message]
speaker=unit
message= _ "Intruders! Go call for help!"
[/message]
[message]
speaker=second_unit
message= _ "So much for stealth."
[/message]
[/event]
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
-
- Posts: 837
- Joined: April 14th, 2005, 4:17 am
Filter returns only one unit(I think) so this works only for 1 unit!turin wrote:I think I (kind of) figured it out. Sighted events with [filter] side=1 [/filter] never work. At least, I can't get them to. Can anyone else?
With most sighted events this can be bypassed, but not really with the one I have here, so I'd like to get htis fixed... if no one can show me how to do it, I'll submit a bug report...
You're wrong.ILikeProgramming wrote:Filter returns only one unit(I think) so this works only for 1 unit!turin wrote:I think I (kind of) figured it out. Sighted events with [filter] side=1 [/filter] never work. At least, I can't get them to. Can anyone else?
With most sighted events this can be bypassed, but not really with the one I have here, so I'd like to get htis fixed... if no one can show me how to do it, I'll submit a bug report...
(An obvious example is that a moveto event is allowed to filter upon, for example, race. Or unit type. Or side. Or all of the above.)
Now, seriously, I happen to know quite a bit about WML, so it is somewhat annoying when people suggest solutions that are obviously incorrect.

For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm