(Issuetargetorder, CurrentOrder of TriggerUnit, Use on specific unit) issue

Dwalker501

New Member
Reaction score
0
Howdy new here. I'm looking for help with a trigger.

The Basic idea to give you an image.


on the event that a unit is issued an order targeting a unit.

Unit (A) jumps infront of Unit (B), Take the Triggering units current order and reorder the attack/spell at Unit B as if unit B is protecting unit A

I just cant find a way to order the triggering unit to use its current order on Unit B

(Issuetargetorder, CurrentOrder of TriggerUnit, Use on specific unit) pretty much what I'm after.

thx

Btw how Do I show my Trigger layout with the "event, conditions, action" on the forum as I see it in the editor.
 

Juggernaut

I don't know what to change it to
Reaction score
33
about that use
[noparse]
Trigger:
[/noparse] tags
And just go to the trigger, on top of Event right click and copy as text, paste it between wc3 and /wc3 and it will show.
And about the trigger, I don't understand really what you are trying to say!
What do you mean jumps infront ? Do you want a leap spell ?
Could you please clarify a little. Thanks.
 

Dwalker501

New Member
Reaction score
0
Ty for the info, be easier to show now =D. Here is the trigger Im trying to achieve.

Trigger:
  • Test trigger
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Target unit of issued order) Equal to Defended_Unit_Red
    • Actions
      • Set Attack_To_Defend_Against = (Current order of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • -------- I want the Triggering unit to use whatever attack he was issued = melee or spell on Red_Combat_Unit (Variable for Red Hero) --------
          • Unit - Order (Triggering unit) to Attack Once Red_Combat_Unit
          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
          • Wait 0.10 seconds
          • Unit - Move Red_Combat_Unit instantly to ((Position of Defended_Unit_Red) offset by 50.00 towards (Facing of Defended_Unit_Red) degrees), facing (Position of (Triggering unit))
          • Animation - Play Red_Combat_Unit's stand animation
          • Wait 2.00 seconds
          • Unit - Move Red_Combat_Unit instantly to (Center of Red <gen>), facing (Center of NPC starting Position <gen>)
        • Else - Actions


I removed most of the special effect and non important triggers to make it easier to look at. the setup is that I have a RPG turn based system. I use "defend ability" on friendly unit. The next time a enemy unit is issued an order attacking the defended unit with a spell or melee attack, I wanted the trigger to issue the same order just at a different target.

The problem I'm having atm is that I cant Order the attacking unit to repeat the exact same order = melee or spell on a different target. The standard commands in the editor has no way to do it.

I also tried creating a variable for the order given and thought that I could order a unit to use that variable. But with basic commands in the editor. it cant be done. Requires some code from what I have read on the net. Just having trouble understanding it.
 

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
Found it:
Your event hasn't been run, that's why it doesn't work.

You will also have to change the conditions.
 

Dwalker501

New Member
Reaction score
0
I think you misunderstood what i'm after.

The enemies abilities are selected off a random number from X to X. Depending on the number the enemy will choose an ability and cast it at the target I'm defending.

The Trigger above works perfect. No problem with event or conditions, my problem is where I outlined the - order event.

Trigger:
  • -------- I want the Triggering unit to use whatever attack he was issued on Red_Combat_Unit (Variable for Red Hero) --------
    • Unit - Order (Triggering unit) to Attack Once Red_Combat_Unit
    • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------


What I need is a command for the game to find out what the order was (if it was a firebolt or stormbolt for example) and use the same order on a my red unit = Red_Combat_Unit (variable) rather than its current target. Because the ability is randomly selected I cant use a trigger to order the unit to attack with (spell type) Because I dont know what the order was.

I need a command that will order triggering unit = (the unit that was issued the order that started the event) to use the Current Order (whatever order it was given that started the event) on a specific unit of my choosing ( which would be Red_Combat_Unit (variable).

So how do I make the game find out what the order was and then how do I make a unit do that order? Because the editor only has basic order instructions (eg attack/attack once or specific spells) which dosnt help because I dont know what the order was.

hopefully that gives a better understanding.

Else, would anyone know how to order a unit to use a variable order using custom script?
 

Kayoss666

Member
Reaction score
7
can we see the trigger that does the random number. cause depending on how it is done you might be able to set a variable to remember that random number then recall that number to make the unit carry out that order again.
 

Dwalker501

New Member
Reaction score
0
Trigger:
  • NPC 6 Unit type and attack
    • Events
    • Conditions
    • Actions
      • Set CURRENT_TURN_POSITION = (CURRENT_TURN_POSITION + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (NPC6_Combat_Unit is alive) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of NPC6_Combat_Unit) Equal to Magic Unit Test
            • Then - Actions
              • Set Select_Ability = (Random integer number between 1 and 2)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Select_Ability Equal to 1
                • Then - Actions
                  • Unit - Unpause NPC6_Combat_Unit
                  • Wait 0.01 seconds
                  • Unit - Order NPC6_Combat_Unit to Orc Far Seer - Chain Lightning Blue_Combat_Unit
                  • Game - Display to (All players) the text: NPC6 TURN
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Select_Ability Equal to 2
                • Then - Actions
                  • Unit - Unpause NPC6_Combat_Unit
                  • Wait 0.01 seconds
                  • Unit - Order NPC6_Combat_Unit to Attack Blue_Combat_Unit
                  • Game - Display to (All players) the text: NPC6 TURN
                • Else - Actions
            • Else - Actions
        • Else - Actions
          • Trigger - Run TURN_ORDER_TRIGGER[CURRENT_TURN_POSITION] (checking conditions)


This how the unit selects an ability. In short, the trigger checks if the unit NPC is alive(if not the trigger dosnt run), Then it checks the unit type to determine what list of attack orders to use, Then it sets a integer variable a random number from 1 - 2. depending on the integer the unit will (If 1) chain lightning and (If 2) just run up and attack.

and I think you just gave me an idea...


If I add the commands below into the test trigger it works perfectly. Just it will become a pain when adding 20 different unit types and all the abilities that come with those units.

Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Triggering unit)) Equal to Magic Unit Test
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Select_Ability Equal to 1
        • Then - Actions
          • Unit - Order (Triggering unit) to Orc Far Seer - Chain Lightning Red_Combat_Unit
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Select_Ability Equal to 2
        • Then - Actions
          • Unit - Order (Triggering unit) to Attack Red_Combat_Unit
        • Else - Actions
    • Else - Actions


any thoughts on an easier solution?
 

Kayoss666

Member
Reaction score
7
you could possible make an array of abilities and do
Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Triggering unit)) Equal to Magic Unit Test
    • Then - Actions
      • Unit - Unpause (Triggering unit)
      • Wait 0.01 seconds
      • Unit - Order (Triggering unit) to OrderAbility[Select_Ability] Red_Combat_Unit


with OrderAbility being the array of abilities. **i don't know if you can do attack with that.
 
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
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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