Which is better? Many triggers or one with many conditions

Dois

New Member
Reaction score
1
is it better to use a lot of triggers or one trigger with many if,then,elses

e.g.

When unit steps into Region(X) [ive got a lot of regions]
then - attack-move to next region.

OR

one trigger with MANY EVENTS (steps into Region(x or y or z or asd0i02kg)

and then

if Entering Unit's custom value = X then issue orde to triggering unit to attack-move to (another region)
edit: oh yeah and give it a new custom value as well
 
Maybe you could mke a varible!

Like:
region(1)=street
region(2)=house1
region(3)=house2
etc.
Just put all you regions in it! try to let some regions together:
Like:
reion(1-10)= all about in the mansion
region(10-20)= all about on the street
Just a bit orginazation is that.

Now the trigger(sorry dont have wc3 editor on this comp so i will type it myself):

Event:
A unit enters region - (All regions, are entered as event)
condition - nothing(i dont really use the this condition :p)
Action -
Loop for integer A 1 to - (-= how many varbiables you got)
if/then/else
If
region(LoopA) contains triggering unit
Then
do actions you want
else
Nothing?
 
oh i know what to do... im doing something else... just wanted to know which way would be better... of course if it eats up less system performance or whatever you measure that in, ill prefer to use that certain way.

but theres gonna be no noticeable difference so ill rather do it in one trigger
 
> I would personally use 1 trigger so that everything is "together".

I'd use several, as it cuts down on lines per trigger. Easier to read than an endless "if"...

In the end, the conditions need to be checked anyway.
Presumably, "if" might be faster, in the sense that the trigger could stop on the first condition that fits.
Then again... go with whatever makes the most sense to you.

Look at your trigger.
Imagine you'll have to edit something in there three weeks from now.
Do you think you'd still get what it is doing?
If yes: good, keep it up.
If not: ... you need a better trigger.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top