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 The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      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