| 02-10-2004, 04:39 AM | #1 |
I am trying to figure out a way to do the following: Have a set of switches, most likely foot switches, set up for each player (TD map) that are selectable by the player rather than walked on. (I have already got this part, just have the footswith selectable and not walkable. The rest is what I need help with.) When selected, the switch is activated (dead) and the other switches (there are 5 per set) are reset to be clickable (alive) again. The main thing I am having problems with is registering when the switch is clicked on. The resetting of switches I could do, probably not a cleanly or concise as some people, so a nice simple script for this would be welcome as well. I would like to have the switches stay destructables, but if the only way to do this is by making them units, then I guess you gotta do what you gotta do. If that is unclear, essentially what I am trying to do is create a user clickable way to set a variable instead of doing the old "unit selects the variable by standing in different regions" way of doing it. I think that this would be quite a useful thing to figure out as there are many maps with the latter system being used which would look much cleaner with former. If more information is needed please say so, it is late and I am tired so I may have missed something. |
| 02-10-2004, 04:48 AM | #2 |
if the switches are units themselves and not selectable doodads, you can detect when it is selected, also with UMSE you can use trackable's and detect when they are selected also. |
| 02-10-2004, 05:11 AM | #3 |
Yea just use a unit and when clicked play the different animations. |
| 02-10-2004, 07:40 AM | #4 |
Well, after you guys said it had to be units it was pretty easy. So I went ahead and did a demo map. The map has two sets of 5 switches, and four other buttons. The 1st set (preplaced) can hide/unhide and keep the button states, the second set is deleted and recreated without button state kept (although it could be done by checking the variable and setting the right animation) The sets work kind of like a switchboard, if one is pressed the others pop up. The extra buttons are Hide/Unhide which is pressed and pops back up, a stale button, and a set of create/delete buttons that toggle each other. It is not great, but I think it gets the point across and give some reference for people that want to use this, gonna post it somewhere else too, just not sure where that is. |
| 02-10-2004, 01:51 PM | #5 |
By the way trackables aren't useful in multiplayer maps since there is no way to determine which Player clicked the trackable |
| 02-10-2004, 05:01 PM | #6 |
So if I did Code:
event - player 1 selects a unit condition - unit of type (whatever) action - do stuff here event - player 2 selects a unit condition - unit of type (whatever) action - do stuff here etc It would not tell the difference between who selected the unit? Or are trackables something else just in umswe? Or, in other words, the map I posted would not work correctly if another set was added for another player and used online? |
| 02-10-2004, 07:35 PM | #7 |
Trackable (from what I under stand) are an object- not a unit/destructable/anything else that you can only CREATE with JASS (tBlizzard left them unfinished- no destruction support or variables) that you can detect mouse overs and left clicks on. Its just a model. You also cant tell who clicked them or moused over them- just that it happened. This is sfrom my limited understanding of them, so some ASS job like vexorian or AIandy, feel free ot correct me |
| 02-10-2004, 10:33 PM | #8 |
Little Smurf, you are fine, Trackables are in fact something different all together, don't worry about it. |
| 02-10-2004, 11:33 PM | #9 | |
Quote:
oh, whoops, i never messed with them really, thanx for pointing that out |
