System GTrigger Event System

Ahh, okay. Thats what I did. I just thought you may have meant something else.

I have this:

JASS:
// Unit target orders.
call GT_AddTargetOrderAction(function Move_actions,ORDER_MOVE)
call GT_AddTargetOrderAction(function Move_actions,ORDER_SMART)
call GT_AddTargetOrderAction(function Move_actions,ORDER_ATTACK)    

// Point target orders.
call GT_AddPointOrderAction(function Move_actions,ORDER_MOVE)
call GT_AddPointOrderAction(function Move_actions,ORDER_SMART)
call GT_AddPointOrderAction(function Move_actions,ORDER_ATTACK)

// Learns ability for leveling.
call GT_AddLearnsAbilityAction(function Learn_conditions,LEARN_ID)


It works perfectly, and shaved about 20+ lines from the script.

I'm pretty sure this will get approved. It may just take some time, as mods can be pretty busy.
 
Yeah, understood.

>It works perfectly, and shaved about 20+ lines from the script.

Wonderful. :D

Edit: Actually, although that works (and works fine), you're better off using GT_RegisterXEvent in that situation in theory... The reason is because internally GT_AddXAction makes a new trigger, but if you just registered the events on the one trigger stored in a local variable, the trigger would be reused. It doesn't really make a difference to anything, just 6 handles instead of one, really. Up to you.
 
About your edit, so you mean something like this:

JASS:
// Unit target orders.
call TriggerAddCondition(GT_RegisterTargetOrderEvent(trig,ORDER_MOVE),Condition(function Move_actions))
call TriggerAddCondition(GT_RegisterTargetOrderEvent(trig,ORDER_SMART),Condition(function Move_actions))
call TriggerAddCondition(GT_RegisterTargetOrderEvent(trig,ORDER_ATTACK),Condition(function Move_actions))
    
// Point target orders.
call TriggerAddCondition(GT_RegisterPointOrderEvent(trig,ORDER_MOVE),Condition(function Move_actions))
call TriggerAddCondition(GT_RegisterPointOrderEvent(trig,ORDER_SMART),Condition(function Move_actions))
call TriggerAddCondition(GT_RegisterPointOrderEvent(trig,ORDER_ATTACK),Condition(function Move_actions))

// Learns ability for leveling.
call GT_AddLearnsAbilityAction(function Learn_conditions,LEARN_ID)


Just making sure im using it right.
 
Nup. That would add the conditions 6 times.

This:
JASS:
//local trigger trig=CreateTrigger() // Make sure there&#039;s a trigger. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />
call TriggerAddCondition(trig, Condition(function Move_actions))
// Unit target orders.
call GT_RegisterTargetOrderEvent(trig,ORDER_MOVE)
call GT_RegisterTargetOrderEvent(trig,ORDER_SMART)
call GT_RegisterTargetOrderEvent(trig,ORDER_ATTACK)
    
// Point target orders.
call GT_RegisterPointOrderEvent(trig,ORDER_MOVE)
call GT_RegisterPointOrderEvent(trig,ORDER_SMART)
call GT_RegisterPointOrderEvent(trig,ORDER_ATTACK)

Roar! :D

The shortcuts aren't always appropriate. For multiple events, this is how you do it. :)

Edit: Don't forget your other thing... ;)
JASS:
// Learns ability for leveling.
call GT_AddLearnsAbilityAction(function Learn_conditions,LEARN_ID)
 
Haha, yeah i figured it out after reading through the documentation again. What was a thinking :p

Anywho, thanks for your help with it, its working perfectly. And funnily enough, when using a handle counter, there as less handles when using the system (by ~50 or so). Not sure if that has any significance, but hey.

This rawks! :D
 
Remember that when reviewing things mods need to see what the system does, look through the code, see if there are any imperfections. We also need to understand what the system does, as well as what the code is doing.
It's tough, especially when there are a lot of resources waiting to be reviewed, or when moderators are busy.

I won't review this for now, I'm busy. :p (Spell Contest and Life)
 
>there as less handles when using the system
Wha? You mean... less handles? By 50? That makes sense, because previously you'd spawn a handle for each of 16 events! Thats one of the great things about GTrigger. However, if you get more when you first add GTrigger to a map with only 1 spell, that's because it carries a certain number of handles itself, naturally.

>Remember that when reviewing things mods need to see what the system does, look through the code, see if there are any imperfections. We also need to understand what the system does, as well as what the code is doing.

Crap. This system is doomed to kick around here for ages. No one will ever understand its code! :(
Lol. =/
I'll rep the mod who understands it... Not that mods care about that...
 
> No one will ever understand its code!
Don't underestimate the mods.
It just takes a good looking through the code.

I'll start reviewing resources once I'm done with spells.

> I'll rep the mod who understands it... Not that mods care about that...
Indeed. So trying to bribe mods with rep isn't going to get you far. :)
 
I'd like to see this with Unit is attacked event.

As for the system itself, I still haven't found a single bug or flaw...

Anybody tested it enough to notice an important flaw?

EDIT: Concerning order events, how it's designed is quite unusual. The way blizzard does it is different but makes it more useful. For example, if I wanted to code Berserker's Call in DotA (Which prevents units from doing anything BUT attacking Axe), the blizzard event registration say (along with conditions): Register any order event, and cancel anything not equal to "Attack Axe". Your event registration go like this: Register x order event. register y order event. register z event, and so on, until you've done them all. Keep only attack.

It's a bit complex but what I mean is that it's less usefull to use your system than blizzard events when toying with order events.
 
Interesting point. The idea was if you issue a specific order, you can trigger off it. For things like Berserker's Call, wouldn't you use specific unit events, instead of "any unit is issued any order" and then filter whether or not they have the buff? Depends how evil you think dynamic triggers are, I suppose.

Kenny seemed to find a use for specific orders. I can make two events, one for on specific order issueing, and one for any order issued. I'll find time to do that at some point, perhaps. :thup: Thoughts?

Aside from that, would data attachment be useful in GTrigger?
Quite seriously, I could write an extremely efficient mechanism for attaching data to a GT event. Much more efficient than any other trigger attaching mechanism ever written. But only if people think it may be of some use. (Of course, it would be completely optional to use. :))
 
considering that spell may trigger once every 15s or so, creating a few dozen dynamic triggers that you just disable at the end, to make things easier, really doesn't matter
 
> Quite seriously, I could write an extremely efficient mechanism for attaching data to a GT event.

That would be nice. Attaching to triggers requires tables and stuff, at least that's what I use, and I don't like it.
 
Mmm. My question, I suppose, is how useful is GTrigger for dynamic triggers in the first place?

Of course, I could make it more useful by adding "AnyX" style events, instead of filtering... And then data attachment may be more useful... How would you use GTrigger with attaching? What sort of situations?

Wouldn't it be for unit-specific events? And GTrigger isn't going to be appropriate for those any time too soon, I think.
 
Anyone has anything to input before I approve this?

I tested it in many angles and means possible, and it's working great.
 
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