(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.
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top