Help with sighted events

The place to post your WML questions and answers.

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.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

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.
Hope springs eternal.
Wesnoth acronym guide.
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

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.
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
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

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?
Hope springs eternal.
Wesnoth acronym guide.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

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?
Do you mean sighted events in general, or sighted events triggered upon player 1 moving?

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
bruno
Inactive Developer
Posts: 293
Joined: June 26th, 2005, 8:39 pm
Contact:

Post by bruno »

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.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

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.

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]
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.
Hope springs eternal.
Wesnoth acronym guide.
ILikeProgramming
Posts: 837
Joined: April 14th, 2005, 4:17 am

Post by ILikeProgramming »

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...
Filter returns only one unit(I think) so this works only for 1 unit!
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

ILikeProgramming wrote:
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...
Filter returns only one unit(I think) so this works only for 1 unit!
You're wrong.

(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. :roll:
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
Post Reply