movespeed detection system on highlighted unit... how?

snmiglight

Active Member
Reaction score
3
once i've downloaded an unofficial dota map. in official dota map, when you entered "-ms"; there's a prompt that shows your hero's movespeed. but in the unofficial map, though, when you type it, the prompt shows the highlighted unit's movespeed. how is it done?
 

Nerfpl

New Member
Reaction score
53
i would make it in 2 triggers.

1
Event - unit is selected
actions - set X = selected unit

2
event - game chat msg = -ms
action - show curnet movement speed of X
 

Exfyre

hmm...
Reaction score
60
that only works for one player.

for multi players:

event
player 1 types "-ms"
player 2 types "-ms"
...
player 12 types "-ms"
cond
act
pick every unit in (units currently selected by triggering player)
game text (move speed of (picked unit))
 

snmiglight

Active Member
Reaction score
3
how about if i want it to show the unit's name together with its movespeed?

something like this:

(Unit's Name)'s movespeed is (N)

ohhh.. wait what kind of variable should i use? unit or unit group?
 

istar

New Member
Reaction score
31
game display text, use substrings
like
substring(Get unit name)+" current movespeed is "+value of ms
theres a get unit name function in GUI somewhere, go find it
 

Curo

Why am I still playing this game...?
Reaction score
109
Here's the trigger I use in my map:
Trigger:
  • Ms
    • Events
      • Player - Player 1 (Red) types a chat message containing -ms as An exact match
      • Player - Player 2 (Blue) types a chat message containing -ms as An exact match
      • Player - Player 3 (Teal) types a chat message containing -ms as An exact match
      • Player - Player 4 (Purple) types a chat message containing -ms as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -ms as An exact match
      • Player - Player 6 (Orange) types a chat message containing -ms as An exact match
      • Player - Player 7 (Green) types a chat message containing -ms as An exact match
      • Player - Player 8 (Pink) types a chat message containing -ms as An exact match
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching (((Matching unit) is selected by (Triggering player)) Equal to True))
      • Set TempPlayerGroup = (Player group((Triggering player)))
      • Unit Group - Pick every unit in TempGroup and do (Game - Display to TempPlayerGroup for 5.00 seconds the text: (Movespeed of + ((Proper name of (Picked unit)) + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + (String((Integer((Current movement speed of (Picked unit))))))))))
      • Custom script: call DestroyForce (udg_TempPlayerGroup)
      • Custom script: call DestroyGroup (udg_TempGroup)


If you only want to display the movespeed of the hero (not other units), then just add the condition "Matching unit is a hero" when you set the group.
 

snmiglight

Active Member
Reaction score
3
are these correct?

Trigger:
  • Select Unit
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Set Movespeed_Group = (Units currently selected by (Triggering player))
      • Set Movespeed_Typer = (Triggering player)



Trigger:
  • Movespeed is Typed
    • Events
      • Player - Player 1 (Red) types a chat message containing -ms as A substring
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Movespeed_Group and do (Actions)
        • Loop - Actions
          • Game - Display to (Player group(Movespeed_Typer)) the text: (((Name of (Picked unit)) + &#039;s movespeed is ) + (String((Current movement speed of (Picked unit)))))
      • Custom script: call DestroyGroup(udg_Movespeed_Group)



EDIT: wow it works... but how can i remove the .000? (it shows blah-blah's movespeed is 300.000)
 

istar

New Member
Reaction score
31
you dont have to set them as 2 separate triggers
the first event triggers every time the player selects a unit, and if the player selects a unit to do other actions other than -ms(which is pretty often) the actions are redundant
also, you didnt remove units from the group
if player selects A,deselects A ,then B, then C.....then Z, all 26 units are in inside as you didnt remove the deselected units
just
Code:
Set Movespeed_Group = (Units currently selected by (Triggering player))
just add this to the second trigger
 

istar

New Member
Reaction score
31
just a reminder, also put a error msg if player didnt selects any when he type -ms
if you want
 

Curo

Why am I still playing this game...?
Reaction score
109
Did you totally just skip over the fully working trigger I gave you?
 

Curo

Why am I still playing this game...?
Reaction score
109
Lol, well he can at least refer to my trigger to answer his questions.

To get rid of the ".000", convert the real to an integer.
 

SerraAvenger

Cuz I can
Reaction score
234
that only works for one player.

for multi players:

event
player 1 types "-ms"
player 2 types "-ms"
...
player 12 types "-ms"
cond
act
pick every unit in (units currently selected by triggering player)
game text (move speed of (picked unit))
Leaks too much ; )

Use what the first one supposed, just with X being an array and using
X[ player number of triggering player ] instead of just X.
EDIT: Curos system is fine too, for sure. But IDK if that loop through all units is equally as efficient.
 

SerraAvenger

Cuz I can
Reaction score
234
And running a trigger EVERY time someone selects a unit IS efficient? Sorry if I misunderstood :p

Well the problem Is that the trigger run everytime someone selects a unit will only have a low amount of operations at once, while yours will have more => There's a risk for reaching the OP_LIMIT.
 

snmiglight

Active Member
Reaction score
3
EXCUSE ME... CAN SOMEONE TELL ME HOW TO GET RID OF THE ".000" I CAN'T SEE WHERE TO CONVERT REAL TO INTEGER. (sorry for the all caps; for nobody seems to hear me.)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
It's simple though,
where it waits for you to enter a string, use "conversion - convert integer to string",
that integer will be "conversion - convert real to integer",
the real being whatever you want to show there.

Will look somthing like this:
String(Integer(Movespeed ...))
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top