• 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] why isnt my trigger working :(

Status
Not open for further replies.

mik

mik

Level 4
Joined
Dec 13, 2007
Messages
59
hello guys, i need help...

i wanted to make a trap door for my tower defense, which kills a unit every 45 seconds just by letting it fall into it. :grin:#

it got the devour ability and a range of 64, is walkable, the trap itself works.


but

unfortunately, the acquisition range setting doesnt stop it from attacking, meaning that it kills every creep that walked over it after 45 seconds (and gives the bounty=point value twice)

WHYYY


did i anything wrong? (of course i did -.-)
or is there another solution preventing this glitch?


i attached my trigger, its a "german" version but i think its no problem.

wird angegriffen=is attacked
rathaus=town hall (the trap is the only town hall typed building)
verschlingen=devour
spieler=player
einheit=unit

hate this german/english mix btw...


THANK YOU GUYS
 

Attachments

  • trigger.JPG
    trigger.JPG
    25.5 KB · Views: 115

mik

mik

Level 4
Joined
Dec 13, 2007
Messages
59
hmm its not what i wanted... i'll try to explain it in other words.


the autocast works well, as does the trap itself.


its just that i got a "side" effect, resulting of the trigger i postet.
every unit attacked from this building will be removed after 45 seconds, and i just didnt get to stop the building from attacking or triggering the autocast, nor could i invent another solution, for example that the 45 seconds->dead trigger just works on the devoured units.
 
Level 5
Joined
Aug 16, 2007
Messages
149
I'd do it like this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is A town-hall-type unit) Equal to True
    • Actions
      • Custom script: local location udg_temploc
      • Unit - Order (Attacking unit) to Neutral - Devour (Triggering unit)
      • Player - Add (Point-value of (Triggering unit)) to (Owner of (Attacking unit)) Current gold
      • Set temploc = (Position of (Attacking unit))
      • Unit - Remove (Attacking unit) from the game
      • Wait 45.00 game-time seconds
      • Unit - Create 1 (Unit-type of (Attacking unit)) for (Owner of (Attacking unit)) at temploc facing Default building facing degrees
      • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at temploc facing Default building facing degrees
      • Unit - Kill (Last created unit)
      • Custom script: call RemoveLocation(udg_temploc)
that way you create a local variable temploc, assign the attacking unit's location to it, remove both units, wait 45 seconds then create both the units again at temploc then kill the triggering unit. Won't work with heroes though as it would reset their level. If you don't underestand what I've done, there's an easy answer: learn JASS.
 

mik

mik

Level 4
Joined
Dec 13, 2007
Messages
59
thanks for that...

but 1. it seems to remove the building from the game during the 45 seconds. thats not what i wanted.

2. im new to the world editor. i wanted to get familiar with it before learning jass, which shouldnt be a problem then as i know some other programming languages.

3. i got it myself now :grin:

its soo simple, it just didnt came to my mind before.
thanks, solved.
 

mik

mik

Level 4
Joined
Dec 13, 2007
Messages
59
no

its basically the trigger i postet above. but instead of setting the acquisition range to 0 and after 45 sec back to 500, i removed the classification "town hall" from it, and gave it back to it after 45 sec.
 
Status
Not open for further replies.
Top