System GTrigger Event System

Troll-Brain

You can change this now in User CP.
Reaction score
85
Then i will probably use it.
"But" (Not your fault) that's a shame that we can't use the Null of the ascii table, we would be allowed to make "easy" mathematical links between stuff in the object editor.
ASCII1.GIF
 

Blackrage

Ultra Cool Member
Reaction score
25
This system must hate PolledWait() (Or PolledWait2())....

It makes the PolledWaits skip the remaining actions.

Don't flame me for using Polled Wait please :p
 

Blackrage

Ultra Cool Member
Reaction score
25
Oh.

Who reads the full instructions here anyways? xD

All I read is how to use it, and what commands there were.
 

XeNiM666

I lurk for pizza
Reaction score
138
I replaced my creating triggers and such with this and I have to say I ROCKS!!!

Also, I want to suggest something, Add another Unit Event, When a unit is attacked, it will check whether the attacked unit has the ability. And another unit event than will check the attacked unit's unit-type id (Raw Code)
 

Jesus4Lyf

Good Idea™
Reaction score
397
>another Unit Event, When a unit is attacked, it will check whether the attacked unit has the ability
I thought about it, and that doesn't follow the hashing princible GTrigger is based on. Internally it would have to check, unlike for the other events where it actually performs an array read. :)

If you want to do this though, you can use Event with an And boolexpr, or just however you like...

>And another unit event than will check the attacked unit's unit-type id (Raw Code)
Ah. I may be able to do this. Hmmm. What should I call it, though? Lol... Hmm..
 

BRUTAL

I'm working
Reaction score
118
I like this after using it for 10 minutes, just one question.
JASS:
...
    static method attackcheck takes nothing returns boolean
        return GetAttacker() == Data(filter).caster and Data(filter).ticks > 0
    endmethod
...

private function qwe takes nothing returns nothing
    local trigger t2 = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t2, EVENT_PLAYER_UNIT_ATTACKED)
    call TriggerAddCondition(t2, Condition(function Data.attackcheck))
    call TriggerAddAction(t2, function Data.stopattack)
endfunction

How would I make a GTrigger event with a condition, like how this is
JASS:
call TriggerAddAction(GT_RegisterStartsEffectEvent(CreateTrigger(), ID) , function a)
all in one line.
 

Deaod

Member
Reaction score
6
What advantage does this have over SpellEvent by Anitarf? Why doesnt this use function interfaces? Why doesnt it use Table to map AbilityIDs to triggers/functions (which would, now that we have hashtables, be the faster way)?
 

Jesus4Lyf

Good Idea™
Reaction score
397
What advantage does this have over SpellEvent
Dynamic triggers, adding/removing events, multiple triggers per spell, functions like a real WC3 event, and it's probably more efficient (haven't benchmarked). Also has events for items and all kinds of things.
Why doesnt this use function interfaces?
Because this is meant to simulate a real WC3 event, not some vJass magic. This is much more efficient. I don't know if function interfaces even existed when I released this.
Why doesnt it use Table to map AbilityIDs to triggers/functions (which would, now that we have hashtables, be the faster way)?
Not only is that an unfounded assumption, but I thoroughly believe it to be wrong. I don't think hashtables existed when I released this, either.

Can I note two things: I'm happy to assume this is faster than function interfaces and faster than hashtables until anyone benchmarks otherwise, and also that this was released well before SpellEvent and the like. This is also compatible through all versions of WC3. Indeed, it was released in the days of
JASS:
function H2I takes handle h returns integer
    return h
    return 0
endfunction

and I can't see any proven way to improve it. :thup:

If I may make myself clearer: I don't think that hashtables are faster than [LJASS]abil-(abil/8191)*8191[/LJASS] with my collision detection.
 

Deaod

Member
Reaction score
6
Dynamic triggers
Thats not an advantage.
adding/removing events
Why would you EVER want to remove an event?
multiple triggers per spell
Which is not an advantage.
functions like a real WC3 event
Meh, dont care much for that.
and it's probably more efficient
I dont care for speed. Its not like this is a system where speed is mission-critical.
Also has events for items and all kinds of things.
Do you use them?

Because this is meant to simulate a real WC3 event, not some vJass magic.
Once you realize vJass magic is better (for you, mostly) than a "real WC3 event", this point becomes void.
This is much more efficient.
Yeah, because using triggers is SO different from function interfaces.
I don't know if function interfaces even existed when I released this.
Yes, function interfaces already existed. Else, Anitarf wouldnt have used them in his system, which was released only 9 days after yours.

Not only is that an unfounded assumption
Yes, i havent done hashtable benchmarks myself, and from what i heard hashtables take about twice the time arrays take (feel free to refer me to better benchmarks). Your system does two arrays accesses PLUS HASHING.
I don't think hashtables existed when I released this, either.
No, they probably didnt, but that shouldnt stop you from using them NOW.

and I can't see any proven way to improve it.
I can: use table and function interfaces.
 

Switch33

New Member
Reaction score
12
from Troll-Brain:
Then i will probably use it.
"But" (Not your fault) that's a shame that we can't use the Null of the ascii table, we would be allowed to make "easy" mathematical links between stuff in the object editor.

We can't simply press SHIFT and then edit and type a space then press ok? At least for somethings that work like names. There used to be tests done in which you can actually code straight from the object editor pretty much, but it just did not turn out too well.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Yup. Well, it did. I don't really know if it still does.
We can't simply press SHIFT and then edit and type a space then press ok?
Using the object merger, I'm pretty sure it can be achieved.
I dont care for speed. Its not like this is a system where speed is mission-critical.
...
Yes, i havent done hashtable benchmarks myself, and from what i heard hashtables take about twice the time arrays take (feel free to refer me to better benchmarks). Your system does two arrays accesses PLUS HASHING.
Make your mind up.
I can: use table and function interfaces.
The one thing I do aside from writing efficient code with simple interfaces is I support backwards compatibility. There is no advantage from either table or function interfaces (the system already supports having a one-line spell event registration just like using function interfaces would) so I'm lost as to why you're suggesting this at all.

I've heard hashtables are from 2x-7x the speed of arrays.

Now, lastly, if you're into vJass magic and bells and whistles, you should be looking at SpellStruct. That uses function interfaces with hashtables (with good reason).
 

Deaod

Member
Reaction score
6
Make your mind up.
Why? My mind is already made up. Those two sentences dont contradict each other.

There is no advantage from either table or function interfaces (the system already supports having a one-line spell event registration just like using function interfaces would) so I'm lost as to why you're suggesting this at all.
Except that using function interfaces would clean up the API (as you wouldnt have to return false), and that using Table would simplify internal code, no, theres no other reason than "good style".
 

Deaod

Member
Reaction score
6
Maybe, if using function interfaces had been considered before, you wouldnt have to choose between retaining backwards compat and using a "proper" API now.
 

Jesus4Lyf

Good Idea™
Reaction score
397
using a "proper" API now.
Portraying highly opinionated comments as absolute truth leads to flame wars (please don't).

I consider this proper - I provide an intuitive (JASS style) event interface which is more efficient than the alternative interface you propose. Based on these facts, not only am I satisfied not to change, but I would make the same decision again.

This API lets me do whatever I like behind the scenes to provide people a better product, in general.

you should be looking at SpellStruct.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top