Warcraft III resources & community, 2003–2006 · archived

Selecting hero (double click)

12 posts
#1

Selecting hero (double click)

Hey again :lol: :lol:

Ill go straight to the point.
Atm when i select a hero (press on it) the hero will be removed and recreated to another place to that player.. i wana make it so when i double click on hero with will be removed and recreated for that player :P so peeps could see heroes stats before they select them :P

Thank You :wink: :!:
#2
Maybe with trigger...

EVENT:
Your stuff....

Actions:
set "LittleBrat" = "LittleBrat" + 1
If "LittleBrat"= 2 then Do what you want, else dont do anything...
#3
VolrathMaybe with trigger...

EVENT:
Your stuff....

Actions:
set "LittleBrat" = "LittleBrat" + 1
If "LittleBrat"= 2 then Do what you want, else dont do anything...


that inefficiently requires too many variables for such a simple task

this on the otherhand, works fine


Event: unit selected
Actions:
If (triggering unit) != var_unitSelect[pnum of trig player] then
    set var_unitSelected[pnum of trig player] = (triggering unit)
else
    //SELECT UNIT FOR PLAYER
#4
Your triggers have one weakness in common.
If you select hero A ( A=1 ), then select hero B ( B=1 ), and the, just to review the stats reselect hero A ( A=2 ) you would alread have "doubleclicked" on that unit even thought you haven't.

My idea:
Event:
OnSelect
Action:
Set CustomValue(SelectedUnit) = CustomValue(SelectedUnit) + 1
If CustomValue(SelectedUnit) >= 2 <create it somehow>

Event:
Every X seconds of game
Action:
selectEveryUnit ( units in <selection Area> ) and do
set CustomValue(pickeUnit) = 0

This way you can customize your "doubleClick-Speed" via setting "X" and you can get shure tht it is truly doubleClicked

but i think not even that trigger works, because it triggers on "select" not on "Click" and you aren't selecting a unit twice only clicking on it twise...

dont now how to do the right trigger...
#5
ehh :wink: mission impossible..
ill try ur way mby it works :lol:
but could it be possible with JASS ?
#6
Omg people, please. This is the system currently in place in the map im making right now. What it does is there is a unit group variable, array 1-14. When a player selects a hero Selected[player number of triggering player] has the clicked unit added to it. That way if you click a unit and its in the group already it is given to you. Also when doing this it empties the variable before the new unit is added
#7
Lord RaszulYour triggers have one weakness in common.
If you select hero A ( A=1 ), then select hero B ( B=1 ), and the, just to review the stats reselect hero A ( A=2 ) you would alread have "doubleclicked" on that unit even thought you haven't.


Lord Raszul, did you even read my trigger? it will not think that because it does no incrementing
#8
Chuckle BrotherOmg people, please. This is the system currently in place in the map im making right now. What it does is there is a unit group variable, array 1-14. When a player selects a hero Selected[player number of triggering player] has the clicked unit added to it. That way if you click a unit and its in the group already it is given to you. Also when doing this it empties the variable before the new unit is added


ie what i said, only using a unit-group variable is needless as you simply have to hold 1 unit... i'll restate it since reading appears to be in shortness


Event: unit selected
Actions:
If ( (triggering unit) != var_unitSelect[pnum of trig player] ) then
    set var_unitSelected[pnum of trig player] = (triggering unit)
else
    //SELECT UNIT FOR PLAYER
#9
see extreme candy wars on how to do this,also i have seen a such function at www.wc3jass.com but i couldn't find it. :roll:
#10
Raptor--

ie what i said, only using a unit-group variable is needless as you simply have to hold 1 unit... i'll restate it since reading appears to be in shortness


Sorry, I didn't read yours, I just saw the other one nd it ws somewhat stupid. But yeah I guess you dont need it to be a unit groupd, I just do because I like unit groups over unit variables
#11
Try this one

Event: A player selects a unit
Conditions: Triggering unit is in HeroSelectregion
Actions:
If Triggering Unit is equal to SelectUnit[Player number of triggering play]
Then Create 1 Unit-type of triggering unit for triggering player at HeroCreateRegion
Else Set SelectUnit[Player number of Triggering Player] = Triggering Unit


it might be selected unit instead of triggering unit... but it should all work

Bort
#12
BortTry this one

etc...

Bort


i love how little people actually read, since thats the same as what i wrote and what chuckle (ok, he used a unit-group, but same concept) wrote