• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

aaaaa what is happening

Status
Not open for further replies.
Level 25
Joined
Oct 18, 2008
Messages
945
  • test
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set MTempPoint[2] = (Position of Peasant 0238 <gen>)
      • Set TempPlayer = Player 1 (Red)
      • Unit Group - Pick every unit in (Units within 260.00 of MTempPoint[2] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of TempPlayer) Equal to True))) and do (Actions)
        • Loop - Actions
          • Set MTempUnit[1] = (Picked unit)
          • Unit - Create 1 Rifleman for Player 2 (Blue) at MTempPoint[2] facing Default building facing degrees
          • Set MTempUnit[2] = (Last created unit)
          • Unit - Order MTempUnit[2] to Attack MTempUnit[1]
          • Unit - Add a 3.00 second Generic expiration timer to MTempUnit[2]
http://i.imgur.com/lmRzjYL.jpg

look at these. they aren't attacking.

if I switch player 2 and player 1 and create them near my own units, red riflemen will happily accept an order to attack red units.

I don't understand how they can just deny the command if they are blue. tested with neutral hostile too, they also ignore my commands.
 
Last edited:
Level 11
Joined
Oct 9, 2015
Messages
721
I made tried this and it worked, it may help you!
  • doom sheep's trigger
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set MTempPoint1 = (Position of Peasant 0238<gen>)
      • Set TempPlayer = (Triggering player)
      • Unit Group - Pick every unit in (Units within 256.00 of MTempPoint1) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Owner of (Picked unit)) is an ally of TempPlayer) Equal to False
            • Then - Actions
              • Set MTempUnit[1] = (Picked unit)
              • Set MTempPoint2 = (Position of (Picked unit))
              • Unit - Create 1 Rifleman for Player 2 (Blue) at MTempPoint2 facing Default building facing degrees
              • Set MTempUnit[2] = (Last created unit)
              • Unit - Order MTempUnit[2] to Attack MTempUnit[1]
              • Unit - Add a 3.00 second Generic expiration timer to MTempUnit[2]
            • Else - Actions
      • Custom script: call RemoveLocation(udg_MTempPoint1)
      • Custom script: call RemoveLocation(udg_MTempPoint2)
 
First of all, you are leaking that unitgroup.
  • Custom script: bj_wantDestroyGroup = true
Next you picked enemies of player 1, now (picked unit) and then created a rifleman for player 2 i.e. (last created unit) and ordered (last created unit to attack (picked unit). However, Rifleman is owned by player 2. This makes me think your picked unit is also player 2. In which case, your test is likely not working because your peasant is player 1. So when you search for an enemy of player 1 you find nothing. Remember computers don't really mess up only people can do that. Your units are not refusing orders, you aren't giving them proper orders. You are likely ordering them to attack "no unit."

Also, it is hard to tell what you are trying to do from your post. Please explain what you want to happen. Is this really something that happens when ESC is pressed? What's going on in the game when you want this to happen?
 
Level 25
Joined
Oct 18, 2008
Messages
945
Next you picked enemies of player 1, now (picked unit) and then created a rifleman for player 2 i.e. (last created unit) and ordered (last created unit to attack (picked unit). However, Rifleman is owned by player 2. This makes me think your picked unit is also player 2. In which case, your test is likely not working because your peasant is player 1. So when you search for an enemy of player 1 you find nothing. Remember computers don't really mess up only people can do that. Your units are not refusing orders, you aren't giving them proper orders. You are likely ordering them to attack "no unit."

Also, it is hard to tell what you are trying to do from your post. Please explain what you want to happen. Is this really something that happens when ESC is pressed? What's going on in the game when you want this to happen?

it is supposed to create a dummy for the owner of the unit because the spell's user may not have vision of the unit to have his units target it.

it was originally part of a spell but attempts at debug pinpointed it here so I put it in this simpler trigger.

the unit they are told to attack is set to 'picked unit', and since they are created within the enum (they are successfully created, as you can see there are riflemen in the screenshot), it is necessarily a valid variable value.
 
Streetpunk's suggested trigger should do the trick, but his trigger still leaks a location for every unit picked, leaks a unit group, and has room for a bit of efficiency:

  • test
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set MTempPoint1 = (Position of Peasant 0238<gen>)
      • Set Player = (Triggering player)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 256.00 of MTempPoint1) and do (Actions)
        • Loop - Actions
          • Set MTempUnit[1] = (Picked unit)
          • Set TempPlayer = (Owner of MTempUnit[1])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MTempUnit[1] is alive) Equal to True
              • (TempPlayer is an enemy of Player) Equal to True
            • Then - Actions
              • Set MTempPoint2 = (Position of MTempUnit[1])
              • Unit - Create 1 Rifleman for Player 2 (Blue) at MTempPoint2 facing Default building facing degrees
              • Set MTempUnit[2] = (Last created unit)
              • Unit - Order MTempUnit[2] to Attack MTempUnit[1]
              • Unit - Add a 3.00 second Generic expiration timer to MTempUnit[2]
              • Custom script: call RemoveLocation(udg_MTempPoint2)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_MTempPoint1)
 
Level 25
Joined
Oct 18, 2008
Messages
945
well you're clearly wrong.

  • Unit - Create 1 Shaman for Player 2 (Blue) at (Position of Peasant 0238 <gen>) facing Default building facing degrees
  • Unit - Order (Last created unit) to Orc Shaman - Purge Peasant 0238 <gen>
reduced to these two lines it still creates inert units for player 2 and functional units for player 1
 
well you're clearly wrong.
Obviously not if both streetpunk and I can get it working in our test maps. The issue is with whatever you are doing. I'm just going to ignore you even said that.

My first suggestion for you is to make a small test map with the triggers streetpunk and I have and see if it works. If it does, that means you have something conflicting (variables/systems/libraries) with the creation.
 
Level 25
Joined
Oct 18, 2008
Messages
945
your analyses are incorrect and your triggers do the same as mine.

I've identified the phenomenon to require two factors: unit not being owned by player 1, and having an expiration timer added to it. it seems to nullify its current orders, but only in my map and not blank testmaps for whatever reason.

giving the orders after the expiration timer solves my problem. quite a mystery, though.
 
your analyses are incorrect and your triggers do the same as mine.
Lol my analysis? There's obviously something wrong here:

Animation.gif

it seems to nullify its current orders, but only in my map and not blank testmaps for whatever reason.
Could mean that there's some system/trigger in play here like I said.
 
Status
Not open for further replies.
Top