System GTrigger Event System

D.V.D

Make a wish
Reaction score
73
Hey Jesus, I have a question about this system. I noticed you have the unregister event function and I was wondering how your supposed to point it to which event to unregister as it takes nothing and returns nothing. Any help?
 

Bribe

vJass errors are legion
Reaction score
67
It loads the appropriate data from a [ljass]GetTriggeringTrigger()[/ljass] call, so you can't just call it arbitrarily from the middle of nowhere.

Edit: Looking at it again, those functions you mentioned just set a boolean that is similar to [ljass]bj_wantDestroyGroup[/ljass]. Since he is firing the triggers manually, he just detects those booleans and does the appropriate actions if need be.

JASS:
//
                set Trigger$NAME$NextMem=Next[Trigger$NAME$Mem]
                if TriggerEvaluate(Trig[Trigger$NAME$Mem]) then
                    call TriggerExecute(Trig[Trigger$NAME$Mem])
                endif
                if UnregisterLastEvent then
                    set UnregisterLastEvent=false
                    call Unlink(Trigger$NAME$Pointer,Trigger$NAME$Mem)
                    call FreeMem(Trigger$NAME$Mem)
                endif
                set Trigger$NAME$Mem=Trigger$NAME$NextMem
 

D.V.D

Make a wish
Reaction score
73
So it unregisters the event of GetTriggeringTrigger? Is there any way around that to unregister a event in a chosen trigger?
 

Jesus4Lyf

Good Idea™
Reaction score
395
So it unregisters the event of GetTriggeringTrigger? Is there any way around that to unregister a event in a chosen trigger?
A classic case of RTFM.
JASS:
//		   // Ability Events
//		 - GT_UnregisterSpellEffectEvent(trigger, abilityid)      (returns the trigger passed in)
//		 - GT_UnregisterBeginsChanellingEvent(trigger, abilityid) (returns the trigger passed in)
//		 - GT_UnregisterBeginsCastingEvent(trigger, abilityid)    (returns the trigger passed in)
//		 - GT_UnregisterStopsCastingEvent(trigger, abilityid)     (returns the trigger passed in)
//		 - GT_UnregisterFinishesCastingEvent(trigger, abilityid)  (returns the trigger passed in)
//		 - GT_UnregisterLearnsAbilityEvent(trigger, abilityid)     (returns the trigger passed in)
//		   // Order events // (can use String2OrderIdBJ("OrderString") for orderid
//		 - GT_UnregisterTargetOrderEvent(trigger, orderid)        (returns the trigger passed in)
//		 - GT_UnregisterPointOrderEvent(trigger, orderid)         (returns the trigger passed in)
//		 - GT_UnregisterNoTargetOrderEvent(trigger, orderid)      (returns the trigger passed in)
//		   // Item events
//		 - GT_UnregisterItemUsedEvent(trigger, itemtypeid)        (returns the trigger passed in)
//		 - GT_UnregisterItemAcquiredEvent(trigger, itemtypeid)    (returns the trigger passed in)
//		 - GT_UnregisterItemDroppedEvent(trigger, itemtypeid)     (returns the trigger passed in)
//		   // Unit events
//		 - GT_UnregisterUnitDiesEvent(trigger, unittypeid)        (returns the trigger passed in)
 

D.V.D

Make a wish
Reaction score
73
OOOH never saw that, man i feel stupid :banghead::p Thanks Jesus( I never thought Id ever say that ) :)
 

SanKakU

Member
Reaction score
21
btw, i was working on my map the other day, and was browsing through the trigger editor, and i was browsing through the systems folder and noticed that opening comment again...and counted the number of spaces. 15! so i guess that's perhaps 3 tabs and 3 spaces. or maybe 2 tabs and 7 spaces...1 tab and 11 spaces maybe...

Anyway! just thought i'd mention that recently i've started to use SpellEvent system and i'm still using GTrigger.
Although someone earlier was trying to compare the two...hmm...I don't think there's anything wrong with using both. What's your take on that? Initially I was doing stuff with GT and then now that I've tried using SpellEvent, it does seem to do stuff GT can't. But GT can do stuff SpellEvent can't. Or is this wrong?

JASS:
//*  If you specify a spell id when registering a function then
//*  that function will only run when that ability is cast; only
//*  one function per ability per event is supported, if you
//*  register more functions then only the last one registered will
//*  be called. If, however, you pass 0 as the ability id parameter
//*  then the registered function will run for all spells. Up to
//*  8190 functions can be registered this way for each event.
//*  These functions will be called before the ability's specific
//*  function in the order they were registered.
//*

could you do this in GT as well? if so, i didn't realize it.

but of course, the other side of the coin is that SpellEvent doesn't have this stuff:
JASS:
//               - GT_UnregisterLearnsAbilityEvent(trigger, abilityid)     (returns the trigger passed in)
//                 // Order events // (can use String2OrderIdBJ("OrderString") for orderid
//               - GT_UnregisterTargetOrderEvent(trigger, orderid)        (returns the trigger passed in)
//               - GT_UnregisterPointOrderEvent(trigger, orderid)         (returns the trigger passed in)
//               - GT_UnregisterNoTargetOrderEvent(trigger, orderid)      (returns the trigger passed in)
//                 // Item events
//               - GT_UnregisterItemUsedEvent(trigger, itemtypeid)        (returns the trigger passed in)
//               - GT_UnregisterItemAcquiredEvent(trigger, itemtypeid)    (returns the trigger passed in)
//               - GT_UnregisterItemDroppedEvent(trigger, itemtypeid)     (returns the trigger passed in)
//                 // Unit events
//               - GT_UnregisterUnitDiesEvent(trigger, unittypeid)        (returns the trigger passed in)
 

Jesus4Lyf

Good Idea™
Reaction score
395
When you said SpellEvent, I initially confused it for SpellStruct. :p

GT doesn't support the passing of 0 although it could.. SpellStruct actually is a much better event system, in my opinion. To me, GT is the most lightweight thing you can use for ability events, and SpellStruct is the most endowed.

I don't know SpellEvent intimately so I can't really comment - but use what you like! And I see no problem with using two, aside from redundancy. But if that's your flavour, by all means... :)
 

tooltiperror

Super Moderator
Reaction score
231
Why don't you make it use TriggerEvaluate? Would save me a hell of a lot of time of recoding :)
 

tooltiperror

Super Moderator
Reaction score
231
Yeah, I figured out using [LJASS]TriggerAddCondition[/LJASS] with the trigger it supplies, never bothered editing that post.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Friday Night!
    +1
  • V-SNES V-SNES:
    Happy Friday Night!
    +1
  • The Helper The Helper:
    Going out of a town for the weekend will be back sunday night! Hope everyone has a great weekend!
    +2
  • The Helper The Helper:
    Happy Monday!
  • Ghan Ghan:
    Monday? Speak for yourself. :p
    +2
  • The Helper The Helper:
    Happy Taco Tuesday!
    +1
  • The Helper The Helper:
    Tacos! :)
  • The Helper The Helper:
    Check out the discord for taco pictures :) You cannot put pictures in this chat
    +1
  • The Helper The Helper:
    Damn here come the bots again - 193 online but they are totally invisible to any stats - bunch of bots!'
  • C cubanismo:
    Re: Taco Tuesday, if there were some way to share edible tacos over the internet, technology would be complete.
    +2
  • The Helper The Helper:
    One can only wish!
  • tom_mai78101 tom_mai78101:
    I'm back from Taiwan
    +1
  • The Helper The Helper:
    I am reorganizing the site I know nobody will notice but I am not done quite yet but the main forums order has been changed and there is a new news category in Other News which is all the remaining headline news stuff not categorized - Headline News is just the stuff that shows on the main page now and the news archive is off the main forums page
  • The Helper The Helper:
    and the real archive lives off of headline news
  • The Helper The Helper:
    Happy Monday!
  • V-SNES V-SNES:
    Happy Saturday!
  • The Helper The Helper:
    Happy Saturday Night!

    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