How to make this MUI? (Unit Movement and positioning related)

Lord_Kakashi

The Wabbits are attacking
Reaction score
27
Okay so here is what I'm trying to do. I wish to have an ability which when cast on any unit will make that one unit walk back and forth between two points for 3 seconds, as if confused, dazed or the likes..

So obviously I will set the two points depending on the units' current position
------------------------------
| *pos a
| | |
| Unit pos
| | |
| *pos b
------------------------------

These (a and b) will be variables, and the unit will as far as the idea goes also have to be stored in a variable, in order to make it move back and forth continually.

So now the big question.. How would I go around making this MUI?..

I need it so that it will be usable not only just by every player, but also by several units of the same player at the same time.
I thought about using GetLocalPlayer()? in some way... but this may cause the game to desync and then cause a server-split?..

I'm not very versed at JASS, only in the GUI form, so please.. any help would be appreciated
 

Samael88

Evil always finds a way
Reaction score
181
why don't you just make it work in GUI then convert it to JASS and change the variables needed into locals? That would make it MUI:thup:
 

Squishy

You can change this now in User CP.
Reaction score
127
First make some triggers to make sure every unit's custom value is different. Then make two point arrays. Now, in your trigger, when you need to set the points, make the array number the custom value of the target unit. Then when you want to move the unit, use it's custom as the array again to find the point.
 

Artificial

Without Intelligence
Reaction score
326
Here's a free-handed sketch about something that could work:
Code:
Events
    Something appropriate.
Conditions
    Something kewl, like "1 is equal to 1".
Actions
    Set TempPoint = (Position of (Triggering unit))
    Unit - Move (Triggering unit) instantly to PointA
    Unit - Order (Triggering unit) to Patrol PointB
    Custom Script:   call SetUnitX(GetTriggerUnit(), GetLocationX(udg_TempPoint))
    Custom Script:   call SetUnitY(GetTriggerUnit(), GetLocationY(udg_TempPoint))
    Wait 3.00 seconds
    Unit - Order (Triggering unit) to Stop
IIRC, SetUnitX and SetUnitY don't reset the unit's current order, so it'll patrol between the points. :)
 

Lord_Kakashi

The Wabbits are attacking
Reaction score
27
First make some triggers to make sure every unit's custom value is different. Then make two point arrays. Now, in your trigger, when you need to set the points, make the array number the custom value of the target unit. Then when you want to move the unit, use it's custom as the array again to find the point.

I would, but I am already using custom values for something different


>>IIRC, SetUnitX and SetUnitY don't reset the unit's current order, so it'll patrol between the points.
- Well this would cause the unit to attack anything hostile within the patrolling point which is not the intended effect, but otherwise a good idea.

>>why don't you just make it work in GUI then convert it to JASS and change the variables needed into locals? That would make it MUI
This will not cause a server split?..
 

Squishy

You can change this now in User CP.
Reaction score
127
If your up for the work, just make an integer variable, and use custom values for the arrays, and then replace everywhere you are using custom value with the array.
 

Samael88

Evil always finds a way
Reaction score
181
>>why don't you just make it work in GUI then convert it to JASS and change the variables needed into locals? That would make it MUI
This will not cause a server split?..

Why would it?
I do this everytime I can make an ability or something in GUI and want it to be MUI. It won't change anything more than to make it MUI:)
Don't know how to make the trigger tho, I don't really understand what you want to achieve. but if you get it to work and want it to be MUI, then locals are the easiest way to go:thup:
 

Lord_Kakashi

The Wabbits are attacking
Reaction score
27
>>why don't you just make it work in GUI then convert it to JASS and change the variables needed into locals? That would make it MUI
This will not cause a server split?..

Why would it?
I do this everytime I can make an ability or something in GUI and want it to be MUI. It won't change anything more than to make it MUI:)
Don't know how to make the trigger tho, I don't really understand what you want to achieve. but if you get it to work and want it to be MUI, then locals are the easiest way to go:thup:

Sounds good, I will try this, thank you... And then i hope it won't cause a server split..

Just to clarify.. A local is just a normal variable, but it is unique to the single occurrence of the script.. e.g. It will be unique for every time the script runs through?...
 

cowmenace

New Member
Reaction score
22
sorry for chiming in late. one thing I use in a lot of triggers is instead of using wait, I create a dummy for whatever player owns the unit you want to modify and set the custom value to a random number. After, I add an expiration timer equal to the time you want to wait. Then create a trigger with the event a unit dies and condition dying unit's custom value is X. you can then do things to the unit by storing it in a variable (done earlier) and referring to it as Unit_Var[Player number of (owner of dying unit))]

hope you understood cause it is a very easy way to add MUI to most triggers.
 

Lord_Kakashi

The Wabbits are attacking
Reaction score
27
sorry for chiming in late. one thing I use in a lot of triggers is instead of using wait, I create a dummy for whatever player owns the unit you want to modify and set the custom value to a random number. After, I add an expiration timer equal to the time you want to wait. Then create a trigger with the event a unit dies and condition dying unit's custom value is X. you can then do things to the unit by storing it in a variable (done earlier) and referring to it as Unit_Var[Player number of (owner of dying unit))]

hope you understood cause it is a very easy way to add MUI to most triggers.

that's rather smart.. could use that for something I think. Although not this thing in particular :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • 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 Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top