System GTrigger Event System

nor do I

and just because you have a global array(they are all of size 8191, unless you make use of extended arrays, in which case you have size/8191 total globals) does not mean all of there members are pointing some place
 
Who said GTrigger was limited to spells? :D

If you don't want to limit the system to spells only, you could use a similar method for unit type birth events. Using an additional boolean as input could include preplaced units as well.
 
> What this has to do with spell events?

See for yourself!

[thread=123721]Ultima[/thread]
 
Item 1: Investigate the null boolexpr leak and publish my results here.

As said, I have investigated this. This rumour is an absolute myth, at least for player events like those used to trigger on spell cast (I only tested this). Point is, unless someone prooves this rumour to be true for another type of event for some reason, I deem this absolutely false. Using null as the filter for "TriggerRegisterPlayerUnitEvent" is perfectly valid and leaks nothing. In fact, it is faster. So do it.

Careful what you repeat, Dax! ;)
Let me test it first. :D

HOWEVER! I would like to note one important discovery, which is indeed in favour of using GTrigger. Always.

When you leak (or more to the point, simply don't destroy, for example leaving it in existance when players leave the game, which happens all the time) a trigger for which you have called TriggerRegisterPlayerUnitEvent, it kicks around in memory some how. It increases the time it takes to call TriggerRegisterPlayerUnitEvent in the future, until WC3 is closed and restarted. Note that it does not leak a handle into other maps! It only leaks the lag involved in calling that function. I repeat, the handle count is not effected in the next map. Also, note that this does not affect triggers that are destroyed and nulled. :)

So basically the more maps you run that don't use GTrigger, the longer it takes for other maps that don't use GTrigger to initialise, or create dynamic triggers.

Solution? Use GTrigger. No brainer, huh?

To-do:
  • Upload a test map for this system's approval.
  • Add AnyUnitDies style event.

PS.
>you could use a similar method for unit type birth events
Unit birth? Never heard of it. What's this about?
 
This is a pretty cool system, makes initialising spells and such so much easier.

Do you think you could add events for TARGET_UNIT and TARGET_POINT or whatever they are. They are used quite frequently in comparison with some of the events you have already.

Also, whats up with saying the alternate interface is not recommended? Is it just because you need to make your functions return false?

> Due to the storage method, only 8191 events are possible at any one time.

Thats not really an issue is it, i can't see that being reached ever, unless im mistaken about what you mean by it.

Overall, this kicks ass, nice work.
 
>This is a pretty cool system
Well thanks, you're a pretty cool person. :D

>Do you think you could add events for TARGET_UNIT and TARGET_POINT
I assume you mean the events for when unit is issued a target/unit/notarget order. Done. Thanks for the hit of inspiration. :D

>whats up with saying the alternate interface is not recommended? Is it just because you need to make your functions return false?
Yep. Pretty much. I couldn't be bothered explaining how to use it or why in any more detail. But it's stable and all, perfectly fine to use. Just make sure if you want to remove an action you use GT_RemoveTriggeringAction() to remove actions as opposed to GT_UnregisterTriggeringEvent() to remove events, or it will leak a trigger.

>i can't see that being reached ever
Correct. It means you'd need 8191 triggers or something like that to go with it. But I must mention all issues... But that's why that's in the details, not the cons. :thup:

Thanks again for the encouragement.

Version 1.04 released. Sorry to Daxtreme who will need to switch his calls to GT_AddSpellEffectAction(function DoStuffReturningFalse, 'A00X'). If you have any problems, check the good ol' documentation. I felt compelled to change the syntax (before the system gets too popular, assuming it does) because it feels more intuitive this way.

Demo map is uploaded. Please approve this system! :D
 
Just tested it on a spell (Path of Shadows) with a more complicated conditions system (needed 3 different orderid's and an ability with a level > 0) and it still worked fine, and cut down the code by 5-8 lines.

May I suggest adding a GT_AddHeroSkillAction() or GTAddLearnsAbilityAction() for EVENT_PLAYER_HERO_SKILL, as it would come in handy for passives and such.

Also the syntax and naming conventions are easier to remember than i originally thought for this. For naming, if you know your events, its just GT_Add*Event*Action(), and if you dont know your events, i think it would be easier to just remember the functions from GTriggers.

EDIT:

I just took a look the script and realised all the events run off EVENT_PLAYER_UNIT_ while if you added GT_AddHeroSkillAction() it would need EVENT_PLAYER_HERO_.

Could that be fixed by just expanding the macro? like EVENT_PLAYER_$EVENT$ and then having UNIT_SPELL_EFFECT, UNIT_SPELL_CAST and HERO_SKILL. Or is it a little more complicated than that.
 
>needed 3 different orderid's
You can actually even register multiple orderids on one trigger, by attaching more than one event, if you so desire.

>worked fine, and cut down the code by 5-8 lines.
Sweet. :thup:

>May I suggest adding a GT_AddHeroSkillAction() or GTAddLearnsAbilityAction()
Done. Version 1.05. GT_AddLearnsAbilityAction/GT_RegisterLearnsAbilityEvent.

>Also the syntax and naming conventions are easier to remember than i originally thought for this. For naming, if you know your events, its just GT_Add*Event*Action(), and if you dont know your events, i think it would be easier to just remember the functions from GTriggers.

Glad you think so! I actually changed the syntax in version 1.04 to try to acomplish this. :cool:
Used to be like... AddActionToXEvent which was lame. :)

>Could that be fixed by just expanding the macro? like EVENT_PLAYER_$EVENT$ and then having UNIT_SPELL_EFFECT, UNIT_SPELL_CAST and HERO_SKILL.

Yep, that's exactly how I did it. But I only just read this now. Haha...

Thanks for your interest in the system and willingness to test it. :D
 
> Careful what you repeat, Dax!

Hmm, the guy that told me this did so a while ago, and I was still re-getting into vJASS so I kind of believed him. Also, it seemed pretty logical.

But blizzard's coding isn't logical. :)

Also, I will get to test this system in my friend's huge map soon, with 400 custom spells (I won't convert them all there...), and so things will be set concerning its stability.

Nice new version! Can't wait to use it in my spells. As of now, I can tell you it looks promising, stable, and yet so simple!
 
The current 'knowledge' seems to be that null boolexpr leak only in GroupEnums. If you'd like to test that one as well in your own way we can have some more supporting evidence.
 
I find no evidence in favour of "The current 'knowledge'".

Enclosed is my test. Just do call Test() and see for yourself.
JASS:
function H2I takes handle h returns integer
return h
return 0
endfunction
function Test takes nothing returns nothing
local group eg
loop
call BJDebugMsg("Throw Handle: "+I2S(H2I(CreateGroup())-0x100000))
set eg=CreateGroup()
call GroupEnumUnitsInRect(eg,bj_mapInitialPlayableArea,null)
call DestroyGroup(eg)
set eg=null
call TriggerSleepAction(0.1) // Must wait for handles to be recycled.
endloop
endfunction

If null handle doesn't leak, this should leak exactly one handle per tick, the group created in the Throw Handle line. In other words, the number displayed should count up by 1 if it doesn't leak, and by 2 or more if it does.

The result? It counts up by 1.

So I say this is an absolute myth until someone shows me otherwise.
 
Just because it doesn't leak a handle doesn't mean it's leakless. Nothing in Jass is watertight. Null boolexprs in group enums are proven to leak. Disproving that null in event registry leaks, I don't think there is any big conclusion. Not yet.
 
Lol, sorry Bob, I did indeed already remove the part of my post that was relevant to. I figured it out. :thup:

May I ask you to spoiler your post or something? :D

>Just because it doesn't leak a handle doesn't mean it's leakless
Other leaks are very rare. But one such is proven in this thread (event registry on triggers that are never destroyed leaks delay into other maps, but does not leak a handle), and GTrigger helps solve it.

>Null boolexprs in group enums are proven to leak
Then show us the proof, please.
 
May I ask you to spoiler your post or something? :D

I removed it since it was not needed anymore.

However, when counting handles I'd strongly recommend eliminating as many potential influencing factors as possible. I'm talking about creating handles dynamically such as that group up there. Use globals wherever you can to minimize them affecting the outcome.

In addition, I don't think TriggerSleepAction() is equivalent to letting a function finish running and starting again. It might do many of the same things, but not all.
 
Eh, you're right. But I don't beleive it will change anything, and this is completely off topic now. I'm happy for you to post a new thread with your test in JASS help, discussing the issue, and linking to there from here if you'd like to continue further. This discussion should get back to GTrigger.
 
Eh, you're right. But I don't beleive it will change anything, and this is completely off topic now. I'm happy for you to post a new thread with your test in JASS help, discussing the issue, and linking to there from here if you'd like to continue further. This discussion should get back to GTrigger.

There's no need. Personally I don't think using null as a filter in GroupEnum's leak anyway. None of my tests give any indication that it should.

As far as GTrigger goes, I'd like to see it being expanded to UnitType events as well. I like how this method reduces the number events triggering at any given moment. You may disagree though.
 
>I'd like to see it being expanded to UnitType events as well

It has been. Note the UnitDies event.

I was thinking of adding UnitAttacked, by how often is that used? Usually it's UnitTakesDamage, and but I believe you must specify a specific unit for that. Let me know if you think any others should be added.
 
Can I just ask what you meant by this:

>needed 3 different orderid's

You can actually even register multiple orderids on one trigger, by attaching more than one event, if you so desire.

I just want to make sure I am using this correctly.
 
You can add multiple GTrigger events to one trigger.

call GT_RegisterXEvent(trigger,case1)
call GT_RegisterXEvent(trigger,case2)
call GT_RegisterXEvent(trigger,case3)

Likewise you can remove these in the same manner later, if you destroy the trigger.

Let me know if you have any problems with that. I didn't actually test it, but I don't believe it does anything special that could break anything. In every way, GTrigger should function exactly like WC3 events (except that you need to unregister them manually if you destroy the trigger).

PS. Is this going to get approved? I know many people are already using it and I've put a lot of work into it, and followed Romek's request for a demo map. Anything else required?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    We have some elderly guests that regularly come hang out at the bar at the end of the night, and every once in a while we don't see someone for a few weeks and then someone shows up with their obituary.
  • Varine Varine:
    We usually let them do their memorials there in the morning if they want to and I'll make them some snacks and drinks. There was one guy named Tom that came in like every night and would sit by himself and get a bunch of soup and a glass of wine. idk why but he LOVED our fucking soup, like he would order a fucking quart of it at a time and would always get so sad when we stop doing it for the summer.
    +1
  • Varine Varine:
    But he also loved our calamari, which is another thing I hate but it sells super well so I can't change it. There was one day he came in and was asking me how to make it, because he tried to at home once in the off season when we stop running it and he really wanted it lol
  • Varine Varine:
    I think he's one of the only people I've made recipes for for free because he really wanted a broccoli cheddar, and it was like dude I don't have a recipe, it's just whatever I have, but here, this is how you do it
  • Varine Varine:
    I don't think he ever figured out how to do the calamari in a pan though, like idk how to do that either. He was afraid of the at home deep fryers though and it's like yeah, that's fair, I am too
  • Varine Varine:
    He was just such a sweet old man, we had two servers pregnant and they held a baby shower together, he was soooooo fucking excited to get to see a baby. Unfortunately he died a month or so before they were born
  • The Helper The Helper:
    So I decided to Google some people that I had not seen or heard from in a while and sure enough one of my old best friends, we had a falling out years ago but whatever, find out he died of Pancreatic Cancer in January. I have also lost a few of my closer acquaintances from growing up the last year. Getting old - people die - I kinda thought it was going to be this way a few years ago....
    +2
  • The Helper The Helper:
    Forum running super slow again
  • Ghan Ghan:
    Not really clear from the stats as to what is causing the slowness.
  • Ghan Ghan:
    We get a lot of guest traffic so it may just be the load is getting too high and not from any particular source.
  • Ghan Ghan:
    Looks like the server is maxed out on CPU.
  • Ghan Ghan:
    Oh it looks like a lot of the traffic is Silkroad Forums. That domain isn't protected by Cloudflare.
  • Ghan Ghan:
    But the old Silkroad site is still on its own server. I just had a test site set up on this server for it.
  • Ghan Ghan:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?
  • The Helper The Helper:
    I am doing my first Vibe Coding project. In installed the environment and tools according to instructions but it is all chat doing this for me at my direction. It is fun really and holy shit I might finish in 2 hours what it would have taken a day to in my Access and this would be an electron app complete new
  • Ghan Ghan:
    Good stuff.
  • Ghan Ghan:
    Just make sure it is secure. :)
    +1
  • The Helper The Helper:
    It will only be on internal network
  • jonas jonas:
    Man the AI is good about gaslighting about security though. I've had several times where I pointed out security problems and it tried to convince me that with a tiny tweak it suddenly becomes secure
  • jonas jonas:
    Like using a distrobox as a "secure" container, and when I point out that's not secure at all, it claimed that specifying home will make it secure

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top