wiki lacks description for select event

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.
Post Reply
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

wiki lacks description for select event

Post by enclave »

select

Triggers when the primary unit is selected. Prior to version 1.11, this also triggered when a move was interrupted, as the game keeps the moving unit selected by selecting it again at the end of movement. Note: in networked multiplayer, these events are only executed by the client on which the event is triggered, leading to out of sync errors if you modify the game state in the event.
it doesn't say (in my opinion "primary unit" does not explain that) that it only works on $side_number units.. (current side)
so if you select enemy units, nothing happens.
could not test if it works while enemy turn, probably not.. in either case, there is no description for this event..
what is there is just tiny.. could at least add that it doesn't work on enemy units.. i wouldn't waste so much time on coding with it to later find out it doesn't work on selected enemies.. :(
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: wiki lacks description for select event

Post by Ravana »

From what I have observed: (for 1.12.5 and 1.12.6, before it worked differently)

For players: select event is fired on selecting currently unselected unit of own side. Might not fire while something is being executed (so shouldnt be usable during ai turn). Can be expected to be usable during any player turns.

For observers: select event is fired on selecting currently unselected unit of currently active side. Again might not fire while something is being executed.
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: wiki lacks description for select event

Post by enclave »

thx for additional information Ravana..
I'm on 1.12.2 (forgot to mention, sorry)

It doesn't fire on right-click selection either.
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: wiki lacks description for select event

Post by Ravana »

Because rightclick is deselect, this is what you do to be able to fire next select event.
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: wiki lacks description for select event

Post by enclave »

Because rightclick is deselect, this is what you do to be able to fire next select event.
Im not sure about this one in 1.12 (since deselect event is only available in 1.13)
plus when I right click I dont think that anything changes.. but if i select something then it does..
but I can't guarantee that we are talking about the same thing.. and I would need more experiments to confirm my point of view.
(right click deselects unit in the way that it can't move if i click on adjacent hex.. but it doesn't trigger select event to the best of my knowledge.. despite that it displays different unit in the right hand side menu (the one you right-clicked, but it only happens because it displays any unit that you had hoovered the mouse over last).. so it's all a bit messy... Also next select event fires just if i select the other unit with left click again.. no need for right-click)

For now I also can add that $x1, $y1 are valid for select event.. as also is $side_number and $unit
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: wiki lacks description for select event

Post by Ravana »

Also next select event fires just if i select the other unit with left click again.. no need for right-click)
Deselect is needed to select same.
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: wiki lacks description for select event

Post by enclave »

oh i see :) that might be true, I havent tested..
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: wiki lacks description for select event

Post by Ravana »

Using select event multiple times in a row on same unit is exactly what I use for ageless unsynced menu.
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: wiki lacks description for select event

Post by enclave »

oh =] didn't realize.. i guess i couldn't figure out much since it probably was all written in lua..
Post Reply