System GTrigger Event System

D.V.D

Make a wish
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
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
So it unregisters the event of GetTriggeringTrigger? Is there any way around that to unregister a event in a chosen trigger?
 

Jesus4Lyf

Good Idea™
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
OOOH never saw that, man i feel stupid :banghead::p Thanks Jesus( I never thought Id ever say that ) :)
 

SanKakU

Member
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™
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
Why don't you make it use TriggerEvaluate? Would save me a hell of a lot of time of recoding :)
 

tooltiperror

Super Moderator
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:
    seeing some weird stuff doing some moves to the new Weird News forum please see the bathroom admins
  • The Helper The Helper:
    :) it is weird
  • The Helper The Helper:
    btw it was just lag the weirdness is gone
  • Wizard Wizard:
    I checked!
    +1
  • Blackveiled Blackveiled:
    How is everyone doing?
  • Wizard Wizard:
    Alright!
  • The Helper The Helper:
    Doing well thanks!
  • The Helper The Helper:
    Tom Mai check out the post I just found you made in 2006, from an apparent banned account, I do not remember that happening, the post is in the General Discussion Hall of Fame about record breakers
  • Blackveiled Blackveiled:
    Lmao thats somethin right there.
  • tom_mai78101 tom_mai78101:
    How far back were you looking at?
  • tom_mai78101 tom_mai78101:
    But yes, that was me.
  • The Helper The Helper:
    Do you think I am looking back in the forums for this stuff? LOL, no, I find these posts in the Members Online section or the stats - all these old posts I am bumping and moving around are what people are actually looking at on the website
  • tom_mai78101 tom_mai78101:
    Interesting.
  • The Helper The Helper:
    hey Tom your Burrito news is going viral by TheHelper.net standards LOL
  • The Helper The Helper:
    looks like The Burrito has been shared to facebook lol I am getting the facebook bots in now
  • The Helper The Helper:
    I am going to do one more News Forum like the Weird News but this one is Science News for all the cool science and technology articles in the Archive
  • tom_mai78101 tom_mai78101:
    Hmm, do I need to start posting some of the Science and Technology news to this new section in the future?
  • tom_mai78101 tom_mai78101:
    Or do we need to move the news to their respective sections once the threads are old enough, read to be put into the News Archive?
  • The Helper The Helper:
    The 2nd thing
  • The Helper The Helper:
    I have been moving stuff from the current Headline news like a year old and stuff over when I see it in the logs or members online but mostly I have been moving stuff from the Archives
  • The Helper The Helper:
    It is possible to automate it so that instead of moving to Archive if it has the Science, technology or sci tech tag that it gets archived there instead. I am considering a new Weird News Tag
  • tom_mai78101 tom_mai78101:
    Please do. I'll try to tag the news appropriately when I get the chance.
  • The Helper The Helper:
    The new Discourse forum software we are moving to next does alot with the tags and also hashtags
  • The Helper The Helper:
    OK I found the source of your burrito post stuff it is from Reddit and possibly a facebook post too but definitely reddit

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top