wiki lacks description for select event

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.

wiki lacks description for select event

Postby enclave » October 13th, 2016, 6:56 pm

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

Re: wiki lacks description for select event

Postby Ravana » October 13th, 2016, 7:18 pm

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.
User avatar
Ravana
Moderator
 
Posts: 1479
Joined: January 29th, 2012, 12:49 am
Location: Estonia

Re: wiki lacks description for select event

Postby enclave » October 13th, 2016, 7:46 pm

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

It doesn't fire on right-click selection either.
enclave
 
Posts: 533
Joined: December 15th, 2007, 8:52 am

Re: wiki lacks description for select event

Postby Ravana » October 13th, 2016, 8:31 pm

Because rightclick is deselect, this is what you do to be able to fire next select event.
User avatar
Ravana
Moderator
 
Posts: 1479
Joined: January 29th, 2012, 12:49 am
Location: Estonia

Re: wiki lacks description for select event

Postby enclave » October 14th, 2016, 1:12 am

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

Re: wiki lacks description for select event

Postby Ravana » October 14th, 2016, 5:38 am

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.
User avatar
Ravana
Moderator
 
Posts: 1479
Joined: January 29th, 2012, 12:49 am
Location: Estonia

Re: wiki lacks description for select event

Postby enclave » October 14th, 2016, 1:18 pm

oh i see :) that might be true, I havent tested..
enclave
 
Posts: 533
Joined: December 15th, 2007, 8:52 am

Re: wiki lacks description for select event

Postby Ravana » October 14th, 2016, 2:25 pm

Using select event multiple times in a row on same unit is exactly what I use for ageless unsynced menu.
User avatar
Ravana
Moderator
 
Posts: 1479
Joined: January 29th, 2012, 12:49 am
Location: Estonia

Re: wiki lacks description for select event

Postby enclave » October 14th, 2016, 2:30 pm

oh =] didn't realize.. i guess i couldn't figure out much since it probably was all written in lua..
enclave
 
Posts: 533
Joined: December 15th, 2007, 8:52 am


Return to WML Workshop

Who is online

Users browsing this forum: No registered users and 2 guests