• 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.

pls help with this...

Status
Not open for further replies.
Level 2
Joined
Jul 2, 2013
Messages
12
ok,so this has been driving me crazy..
I tried to create a trigger that takes control over all enemy units around my char
when it uses a certain skill (based off channel)
but it got tricky when I tried to exclude Heroes,Magic immune units,Summoned units,Mechanical units and strctures...
to me at least the trigger looks like it should work but nothing happens...
im not that great with triggers so im hoping you guys/gals could provide some insight
 
Level 2
Joined
Jul 2, 2013
Messages
12
triger prob.png
 
first here is how to properly post triggers. http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/
plz dont double post instead hit the edit button on ur last post.

next just damage the unit in the then block. in the else block leave it empty. change triggering player to owner of triggering unit. also never use casting unit use triggering unit instead
u leak a location and anything u use twice or more store into a temp variable and use that. it increases speed and efficiency. take a look at my tutorial things a GUIer should know. it will help u a lot. and look at things that leak tutorial.

edit: eleandor beat me to it lol

edit 2: dont damage units sry i meant to say change ownership in this portion
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1- Use
  • tags to paste triggers text.
  • 2- Inside the "Then" actions, directly change the ownership of the Picked Unit.
  • 3- No need for the ConfessedToBe Group so far.
  • 4- "Else" actions can be empty. No need for anythignt there.
  • 5- The last action can be removed too.
  • 6- After "Set ConDorConfessor" add this custom script
  • [trigger]
  • t
  • Custom script: set bj_wantDestroyGroup = true
@Eleandor: "Triggering Player" stands for "Owner of Triggering Unit" on any Unit Generic Event.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
JASS:
call TriggerRegisterAnyUnitEventBJ( gg_trg_Melee_Initialization, EVENT_PLAYER_UNIT_SPELL_EFFECT ) 
// turns into 
call TriggerRegisterPlayerUnitEvent(gg_trg_Melee_Initialization, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT , null)

No, player doesn't returns null spell triggering.
 
this is wrong.
  • ((Matching unit) is A structure) Equal to False
  • ((Matching unit) is A Hero) Equal to False
  • ((Matching unit) is Mechanical) Equal to False
  • ((Matching unit) is Magic Immune) Equal to False
  • ((Matching unit) is Summoned) Equal to False
none of us said to switch that.
put picked unit back in there. i said anything u use twice or more store into a temp variable and use that.
remove the stuff in the then block and just change the owner of picked unit

@spartipilo
u are right i was thinking of something else. sry about tht
 
Level 2
Joined
Jul 2, 2013
Messages
12
it works now but still

if you could show me the spot regardless thatd be great
  • start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Con Dar
    • Actions
      • Set ConDorConfessor = (Triggering unit)
      • Unit Group - Pick every unit in (Units within 400.00 of (Position of (Triggering unit)) matching ((Owner of (Matching unit)) Not equal to (Owner of (Triggering unit)))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is A Hero) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
              • ((Picked unit) is Summoned) Equal to False
            • Then - Actions
              • Unit - Change ownership of (Picked unit) to (Owner of (Triggering unit)) and Change color
            • Else - Actions
 
will update in 3 minutes

here u go. i cleaned the leaks and made it more efficient. Also u can check out my tutorial Things a GUIer Should Know it will help a lot with triggering.
capitals for the letters does matter. so u can just use it the exact way i do and u will be fine

  • start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Con Dar
    • Actions
      • Set tempUnit2 = (Triggering unit)
      • Set tempPlayer = (Owner of tempUnit2)
      • Set tempPoint = (Position of tempUnit2)
      • Set tempGroup = (Units within 400.00 of tempPoint matching ((Owner of (Matching unit)) Not equal to tempPlayer))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Set tempUnit = (Picked unit)
              • (tempUnit is A structure) Equal to False
              • (tempUnit is A Hero) Equal to False
              • (tempUnit is Mechanical) Equal to False
              • (tempUnit is Magic Immune) Equal to False
              • (tempUnit is Summoned) Equal to False
            • Then - Actions
              • Unit - Change ownership of tempUnit to tempPlayer and Change color
            • Else - Actions
      • Custom script: call RemoveLocation( udg_tempPoint)
      • Custom script: call DestroyGroup( udg_tempGroup)
 
Status
Not open for further replies.
Top