• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Selecting hero (double click)

Status
Not open for further replies.
Level 3
Joined
Apr 27, 2005
Messages
45
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: :!:
 
Level 7
Joined
Jul 30, 2004
Messages
451
Volrath said:
Maybe 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

Code:
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
 
Level 6
Joined
Feb 18, 2005
Messages
263
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...
 
Level 7
Joined
May 16, 2004
Messages
355
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
 
Level 7
Joined
Jul 30, 2004
Messages
451
Lord Raszul said:
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.

Lord Raszul, did you even read my trigger? it will not think that because it does no incrementing
 
Level 7
Joined
Jul 30, 2004
Messages
451
Chuckle Brother said:
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

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

Code:
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
 
Level 7
Joined
May 16, 2004
Messages
355
Raptor-- said:
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
 
Level 6
Joined
Aug 29, 2004
Messages
159
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
 
Status
Not open for further replies.
Top