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

[Trigger] Collision Help

Status
Not open for further replies.
Level 12
Joined
Feb 23, 2008
Messages
587
My trigger is suppose to hurt the player that gets hit by the missile + have in effect that gos off on them.


How do i do the action part at the bottom.

Trigger:

Event:

Unit - A unit comes within 30.00 of Purple 0008 <gen>
Unit - A unit comes within 30.00 of Purple 0005 <gen>
Unit - A unit comes within 30.00 of Purple 0003 <gen>

Condtion :

(Unit-type of (Triggering unit)) Equal to Missle

Action:

If the purple 0008 was/is within 30 of a unit(missle) then
x = 0

If the purple 0005 was/is within 30 of a unit(missle) then
x = 1

If the purple 0003 was/is within 30 of a unit(missle) then
x = 2


Note: its not triggering unit. because the triggering unit is the missile.
I asked this question in different section and got a answer that i
thought Would solve it. but it wont. so if anyone knows how to do the
event part that would sweet.

Calestion
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
The problem is this:

When you check this:
  • If the purple 0003 was/is within 30 of a unit(missle) then
The unit is actually not in 30 radius of the unit yet. Make it 35 or something. I had the same problem when I was trying to create custom auras.
When I set it to +1 (31 in your case) it still didn't work. I had to increase it a little more.

If it still won't work well, I don't know but that should be it.
 
Level 12
Joined
Feb 23, 2008
Messages
587
Ok, not to go wrong like i did last time you helped me but...
You are most likely right about what you said.
but.. I am really trying to figure out how to make a if statement that says what you have in white or this...

"If the purple 0003 was/is within 30 of a unit(missle) then"

Or how to use my event statement that says

Unit - A unit comes within 30.00 of Purple 0008 <gen>
Unit - A unit comes within 30.00 of Purple 0005 <gen>
and
find out what one got hit.
if 0008 got hit by a missle then x = 0.
if 0005 got hit by a missle then x = 1

The simple way is too have two triggers, but i would need 8. and i am trying to streamline.

how do you say if something is within range. not a trigger but a if/condition

or with in 35(like you said may fix a bug that could come up.)

I really do appreciate your help
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
Oh, I see. Sorry.

I think in GUI it should be this:

Unit Group - Pick every unit in unit group and Do Actions
(choose Pick Units in Range Matching Condition)
(that part should look like this: Units Within 35 of Position of Triggering Unit; matching condition part should be: unit is Purple 0008 or Purple 0005 or Purple...sort all your eight units here)
The Do Actions part should damage the picked unit.

I think this is what you wanted, but the thing is it's pretty late and HOT here and your grammar and spelling is pretty lousy so it makes it really hard for me to understand your problem 100%.
 
Level 12
Joined
Feb 23, 2008
Messages
587
Thnx.

I will work on my grammer. And keeping my questions clearer.

umm.

edit: (Units Within 35 of Position of Triggering Unit). Triggering unit is the missile.
How do i say as a condition if purple 0001 is within 35 range of triggering unit?
ill take some time to read what you got and try to make it work.
you most likely got it right, and i just have to read and try it a bit more.

Hmm i wont post agien for a bit till i put a bit more time...but heres my code. and want i want to become one trigger. I have 8 triggers like this currntly

  • Missle Hits Train 1
    • Events
      • Unit - A unit comes within 30.00 of Red 0000 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Sorceress
    • Actions
      • -------- Train 1 --------
      • Unit - Set life of TheTrains[0] to ((Life of TheTrains[0]) - 25.00)
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • Unit - Remove (Triggering unit) from the game
      • Sound - Play MetalHeavyBashWood1 <gen>
      • Wait 2.00 seconds
note red 0000 = to TheTrains[0]
 
Last edited:
Level 9
Joined
May 27, 2006
Messages
498
You're trying to make a trigger, that causes a missile to explode when it collides with a certain unit? This should work, but im not sure, cant test it right now.
  • Missile
  • Events:
    • Unit - A unit comes within 30 of [your_unit]
    • Unit - A unit comes within 30 of [your_unit2]
    • Unit - A unit comes within 30 of [your_unit3]
    • and so on...
  • Conditions:
    • If (Triggering unit) Equal to [your_missile_unit]
  • Actions:
    • Set TempPoint = Position of (Triggering unit)
    • Custom script: set bj_wantDestroyGroup=true // note: this script have to be written exactly same as it is here (including all the capital letters, etc)
    • Unit Group - Pick every unit in (Units in range 35 of TempPoint matching ((Matching unit) Not equal to (Triggering unit) Equal to True) and do Unit - Order (Triggering unit) to damage (Picked unit) dealing [amount] damage of attack type Normal and damage type Spells (whatever)
    • Custom script: call RemoveLocation(udg_TempPoint)
 
Level 12
Joined
Feb 23, 2008
Messages
587
Ghost wolf is right, and you are also right about that trigger.

but the fact my train will die some times i would have to keep adding more ways for that trigger to go off. and i fear when i make a new unit it may take the old units value by chance. like remove unit Train0000 and make a new train. and it may use value Trian0000. Anyway i guess that wont mess it up but i dont like the idea of adding so many ways to do it.

Anyway i solved my problem by just not letting my train die.
That way it will only have 1 trigger for train, and i can set it up with a varbile or by clicking on it.

I changed them to hero's, so i can rez them.

Also someone told me i can make them un selectable with the locust ability which means i have many more options to explore.

I think i will be fine now. thnx for all you help guys.

If i am still stuck in a few days i might consider posting again. but i got alot of things to try now.


p.s. the missle will only hit one person and seems to work fine with out your sweet trigger.

THNX everyone!
 
Status
Not open for further replies.
Top