• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[Trigger] I need help with triggers again

Status
Not open for further replies.
Level 9
Joined
May 30, 2008
Messages
430
Not a good idea...

Then that will result in 1000000 calls per seconds. At the moment I'm working on the problem.

cedi

I have 4 triggers like that and on the map have 100+ units all the time and the map isn't laging so stop talking shits please. Ofc he can add his units when they enter in the playable map area to a other trigger w/e this will also be salution but everything depend. My first variant is good enough as long as u have less than 1000 units in your map at the same time
 
Level 7
Joined
Jul 20, 2008
Messages
377
Not quite, Cedi. There is, after all, a delay time before the unit automatically attacks again. The unit does not attempt to attack a million times a second. I believe the delay goes up to around .25, it's in the gameplay constants. So in reality, it might attempt to attack around four times a second.

Of course, it doesn't really cause that much lag because it's just giving units a new order, it's not that heavy on the processor. Plus, it would be wise to assume that most units would have the mana to attack at any given time, so not EVERY unit is being prohibited from attacking.
 
Level 9
Joined
May 30, 2008
Messages
430
cedi from 1.18 (that was the version sience i use this trigger) there is no problems with it the problem may have if there are 100+ units and u have pentium 2 but most of the ppl have 4+ so 500+ units and no problem as i say. After all the game isn't searching all the units with 0 mana within the map every time when a unit attack this is simple stop order no effects, no leaks, no group created, no new unit created (not storing and not creating) so there must not be problem, just think about the resources that this will use from warcraft before you say somthing i think is logical but w/e (don't read so much things posted from the new users or young ones)
 
Level 4
Joined
Mar 23, 2008
Messages
87
better solution would be to replace the unit with one that is identical except for the attack, then set a timer which switches back the unit when it expires. Hard to do if it's many unit-types which needs this though.
 
Level 10
Joined
May 19, 2008
Messages
176
@onix_noob: I looked through my old map and noticed some trigger which worked with A unit gets attack. And I think that was the problem. But the rsult is, it isn't a good idea to use your way. Because if you have some big triggers with the unit attacks event that could cause laggs. And when you use atrigger with an event which response to an order with no target that can cause laggs too. BECAUSE the unit gets a new order, it getts an attack and an order without a target and THAT could be enough to cause laggs in sertain situations. For YOU it can work, but how can YOU know that Kangaroboy never uses these events in long triggers? Do you know his map?

@Bomi: Hmm with some work this idea can work. I see two problems: First the order. When you change the units they will loose their order and stop channeling. Second you can't set the cooldown.

I made some experiments with the ability of the night elf buildings. ( root / unroot ) With them you can deactivate the attacks of the unit, but I've a problem. When you add the ability the unit can't move...

cedi
 
Level 13
Joined
Apr 15, 2008
Messages
854
I'll edit this post soon...
Just to make you notice I'll try to help ya ;3

EDIT:
  • No Mana is no Attack
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Triggering unit)) Equal to 0.00
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
 
Level 10
Joined
Aug 15, 2008
Messages
720
For Anti-Leaks, get Global variable (Normal Variable (Click X in Trigger Editor)) of type of Unit and name it, dunno TriggerUnit example? And then set TriggerUnit variable to (Triggering Unit). Ofc all variables must be set at main start of Actions.

Then Replace (Mana of (Triggering unit)) to (Mana of (TriggerUnit))
Also replace Order (Triggering Unit) to Order (TriggerUnit)

In small words, replace all (Triggering Unit) in that trigger to your Variable (In my case as example "TriggerUnit" variable)
 
Level 2
Joined
Jul 23, 2008
Messages
11
Thank you again so much! Im sure it will work this time! :grin:

As you can see, im pretty noob with triggers... and im surprised that i got this far!


:thumbs_up: :thumbs_up: :thumbs_up: :thumbs_up: :thumbs_up:
 
Status
Not open for further replies.
Top