So... you think you know it all, right?

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
So you think you know it all?
You mastered the Art of the Trigger?
You just basically own?
You're uber by nature?

Yes, so it seems, doesn't it?

Well, for us normal WE people, every now and then, we write a trigger that can't possibly go wrong,
and, yet, it fails miserably.
Or, of course, the other way around:
You write a trigger and somehow it works, though you don't really see why.

What follows is a short collection of obvious stuff, that might just have an extra feature.
Nothing truly mysterious here.
Just some triggers.

Anyone can read them.
And, hopefully, think a bit about them.

Any and all discussion welcome.
Should there still remain any "problems" after... we'll see that, I'll post the "solution" so to speak.

Hope you're having fun.


Yours,
AceHart


Problem 1:

Code:
Losing an item
    Events
        Unit - A unit Loses an item
    Conditions
        ((Item being manipulated) is owned) Equal to True
    Actions
        Game - Display to (All players) the text: (Name of (Item being manipulated))

The condition sees if the item is still owned.
However, we were waiting for it to be lost.
Conclusion: the action will not run.


Problem 2:

Code:
Unit dies 1
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Trigger - Run Unit dies 2 <gen> (ignoring conditions)

Code:
Unit dies 2
    Events
    Conditions
    Actions
        Game - Display to (All players) the text: (Name of (Dying unit))

Clearly, the second trigger has no events, so the event response "Dying unit" does not exist there.


Problem 3:

Code:
Triggering Caster
    Events
        Unit - A unit Spawns a summoned unit
    Conditions
        (Triggering unit) Not equal to (Summoning unit)
    Actions
        Game - Display to (All players) the text: This can't happen, ...
        Game - Display to (All players) the text: (T:  + (Name of (Triggering unit)))
        Game - Display to (All players) the text: (C:  + (Name of (Summoning unit)))

Indeed, can't possibly happen.


Problem 4:

Code:
Count 1
    Events
        Map initialization
    Conditions
    Actions
        Set UnitCount = 0
        Unit - Create 1 Furbolg for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees
        Unit - Create 2 Furbolg for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees
        Unit - Create 3 Furbolg for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees

Code:
Count 2
    Events
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Set UnitCount = (UnitCount + 1)

Code:
Count 3
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Game - Display to (All players) the text: (Units created:  + (String(UnitCount)))

Obviously, UnitCount will be 0 since "map init" happens before any other triggers run, so it will never be updated.


Problem 5:

Code:
Integer A
    Events
        Time - Elapsed game time is 2.00 seconds
    Conditions
    Actions
        For each (Integer A) from 10 to 1, do (Actions)
            Loop - Actions
                Game - Display to (All players) the text: (Current value of "Integer A":  + (String((Integer A))))
                Custom script:   set bj_forLoopAIndex = bj_forLoopAIndex - 2

"Integer A", as we all know, is a global variable, a "bj" actually, called "bj_forLoopAIndex".
Given for loops automatically add +1 on each run, we could use some JASS magic to subtract 2.
Which, in fact, subtracts 1 and we can loop "backwards".


Problem 6:

Code:
Alliance 1
    Events
        Time - Elapsed game time is 2.00 seconds
    Conditions
    Actions
        Player Group - Make (All players) treat (All players) as an Enemy with shared vision

After that, all players, literally, will be enemies.
This also includes Neutrals.
As such, you will be enemy to, for example, Neutral Passive.

Code:
Alliance 2
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Game - Display to (All players) the text: All players:
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Game - Display to (All players) the text: (Name of (Picked player))

So, obviously, this will show all players 1 to 12, those that are in the game that is.
And, of course, given Neutrals are always there, and we noticed how it works from the previous trigger, this will also show all the Neutrals.
 

Tyman2007

Ya Rly >.
Reaction score
74
AceHart sorry if i am of trouble, but i don't understand what this topic is all about. Is it just naming off problems for people to think about and come up with a good solution so they are better with the world editor's basic GUI triggers
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
It wouldn't run simply because that triggers starts working after the map init. When those units are created, the enter region trigger it's like... non-existant, thus there's nothing to be triggered.
 

Flare

Stops copies me!
Reaction score
662
It wouldn't run simply because that triggers starts working after the map init. When those units are created, the enter region trigger it's like... non-existant, thus there's nothing to be triggered.

So, InitTrigs are called sometime after Map Init is run?

AceHart sorry if i am of trouble, but i don't understand what this topic is all about. Is it just naming off problems for people to think about and come up with a good solution so they are better with the world editor's basic GUI triggers
I'm guessing pointing out some obvious mistakes for people to have a think about, and realise that they are doing something stupid (if they are doing any of these things)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> problems for people to think about

Yes.

Like I said, every now and then, triggers come with a "surprise".
As in, they somehow don't work as expected.
Or, they actually do work, yet not as planned.


> so they are better with the world editor's basic GUI triggers

I'm not expecting miracles :p

Though, if it helps... who knows.


On a related note, not every trigger up here works according to description.
Or, maybe they do?
Or not?

:p
 

Genyuumaru

New Member
Reaction score
15
Problem 1 - you're stupid...

You don't seem like a pro to me. Just write some triggers that obviosly won't work.

Problem 2 - I don't know about dying, but if you write triggering unit it will work, noob! If you run a trigger from a diffrent trigger, the triggering unit/maybe other units will still be there. Try it, and it works.

Problem 3 - WTF? I thought this thread was for triggering masters? This is a piece of sh*t!

Problem 4 - OMG YOU ARE SUCH A NOOB. ZOMG WTF!

It WILL work you noob! You are WRONG on this one. Omg what a noob...
You aren't a pro triggerer ;D You hardly know about it...

Problem 5 - pffff... I don't believe a guy like you exists.

What will happen:
For each (Integer A) from 10 to 1, do (Actions)
Game - Display to (All players) the text: (Current value of "Integer A": + (String((Integer A))))
Custom script: set bj_forLoopAIndex = bj_forLoopAIndex - 2

bj_forLoopAIndex is now 10-2 = 8
Check if 8 is bigger than 1.
It is - exit For.

IT WON'T WORK OMG NOOB!

Problem 6 - You're on a wrong streak! The Neutrals won't be shown.

Edit: Wait a second. Is this a thread where we must find mistakes in the triggers?

Well Problem 1 - The item may still be owned even after it is dropped for about 0.0001 seconds.

Problem 3 - It's not realy CASTING unit, is it?

Well there you go, I proved all triggers wrong! Do I win something :p ? Maybe a cookie.
 

Tyman2007

Ya Rly >.
Reaction score
74
Flare thanks for clarifying
AceHart thanks also for clarifying
Genyuumaru who exactly are you calling a noob? AceHart for pointing out the obvious and making little to none mistakes, or the person who is making the mistake?

If its against AceHart just dont bother... no one likes to hear that someone is calling another person a noob, especially when your that person or the noob.
 
M

MaEt-ReLLiK

Guest
"Originally Posted by Genyuumaru":

I hope you're being sarcastic..:p
 

Genyuumaru

New Member
Reaction score
15
I start to think that this is a thread where you need to find mistakes in the triggers.

Well I win :p

What now :) ?

Edit: I didn't get the point of the thread at first :D He didn't say it anywhere, so I though: "He is just stating triggers that won't even work as he wrote". That made me SO mad that I wrote "noob" and other stuff.

Anyway, sorry :p

Next time write the objective of the thread in the first post.
 

Chocobo

White-Flower
Reaction score
409

shinami

Redirect your complaints to the nearest wall
Reaction score
47
I start to think that this is a thread where you need to find mistakes in the triggers.

Well I win :p

What now :) ?

Edit: I didn't get the point of the thread at first :D He didn't say it anywhere, so I though: "He is just stating triggers that won't even work as he wrote". That made me SO mad that I wrote "noob" and other stuff.

Anyway, sorry :p

Next time write the objective of the thread in the first post.

Isin't it freakin obvious since after the "noob" triggers he writes an EXPLANATION why it doesn't work? It's so obvious he just wants to point out common mistakes <_<
 

Exide

I am amazingly focused right now!
Reaction score
448
I was thinking about:
Code:
Alliance 1
    Events
        Time - Elapsed game time is 2.00 seconds
    Conditions
    Actions
        Player Group - Make (All players) treat (All players) as an Enemy with shared vision

Here's my.. "solution":

In:
There's a comment saying:
JASS:

function SetPlayerAllianceStateBJ

    // Prevent players from attempting to ally with themselves.


I'm guessing that SetPlayerAllianceStateBJ will also prevent players from attempting to become their own enemies?

And since:


Code:
[I]Player Group - Make X treat Y as Z[/I]

has the following if-state:
JASS:

if (targetForce==bj_FORCE_ALL_PLAYERS or IsPlayerInForce(Player(targetIndex), targetForce)) then
  call SetPlayerAllianceStateBJ(Player(sourceIndex), Player(targetIndex), allianceState)
endif


I'm guessing nothing at all will happen..
(I've been tracing these BJs) for quite some time now, and probably lost track of myself somewhere.. But I think I got it right. :p)

PS.
Can you all quit talking about Genyuumaru's response and get back OnTopic, please?
 
A

AstonOst

Guest
No no no no!
This thread isn't about pointing out common mistakes. Did you try any of the triggers yourselves? If you do you will see that they don't work as you expected.
I for one tried #1 and #3, and they both worked! They work even though it seems obvious that they shouldn't. And I think the discussion about why it is so is at least one of the main intentions with this thread. To qoute the original post by AceHart:

"Or, of course, the other way around:
You write a trigger and somehow it works, though you don't really see why."

So please, before you think of any "solutions" to these examples, try them out so you know what your dealing with (and what your talking about, for that matter)
 

Exide

I am amazingly focused right now!
Reaction score
448
>Congratulations. That puts you way ahead of most to all other members that replied here.

I wanted to state my way of thinking, before trying. -Thats how I learned to experiment in school. :p
And the results were... simply chocking! :(
 
A

AstonOst

Guest
Thank you very much AceHart :)

To further reward my postreading talents, could you please take a look at the PM I sent you a little while ago? I would be really greatful :)

(Everybody, I'm sorry if this message is a bit off-topic, but you don't mind do you?)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top