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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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