| 12-04-2007, 09:54 AM | #1 |
Its me again with another noobish question! I'm wondering, whats more efficient to use for spells, a local trigger or a global trigger? also, in a global trigger, should I destroy triggeractions and triggerconditions? Thanks! |
| 12-04-2007, 10:00 AM | #2 |
Depends on what you use them for. |
| 12-04-2007, 10:06 AM | #3 |
How about spells? Sorry I can't rep anymore today ill be sure to +REP you tomorrow, Thanks for all the help man! |
| 12-04-2007, 10:15 AM | #4 |
Spells like? |
| 12-04-2007, 10:22 AM | #5 |
100 % Jass spells that are MUI |
| 12-04-2007, 10:28 AM | #6 |
What kind of spells, really. I don't even think using triggers for spells are needed, they're overkill. |
| 12-04-2007, 10:40 AM | #7 |
No I mean Jass Custom Spells// Triggered Spells, not the ordinary warcraft spells like strom bolt lol, I mean the ones like in the resources section. |
| 12-04-2007, 10:53 AM | #8 |
Doesn't really matter if it's only created once. And if a trigger needs to be created more than once, you probably need to rethink your code. |
| 12-04-2007, 10:54 AM | #9 |
You already said that. I have not seen any spell in the resource section that uses triggers. |
| 12-04-2007, 11:15 AM | #10 |
and what about a global trigger with local variables ? And of course you can destroy actions and conditions on a global trigger, but why ? |
| 12-04-2007, 12:36 PM | #11 |
Ok, I think I got it. I was talking about the last function in a trigger that creates a trigger, this one: JASS:function InitTrig_Holy_Light takes nothing returns nothing local integer i = 0 // global variable ? set gg_trg_Holy_Light = CreateTrigger( ) // or local gg_trg_Holy_Light = CreateTrigger( ) loop call TriggerRegisterPlayerUnitEvent( gg_trg_Holy_Light, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT,null) set i = i + 1 exitwhen i== bj_MAX_PLAYERS endloop call TriggerAddCondition( gg_trg_Holy_Light, Condition( function HolyLightcondition ) ) call TriggerAddAction( gg_trg_Holy_Light, function HolyLightactions ) endfunction |
| 12-04-2007, 01:34 PM | #12 | |
Quote:
|
| 12-04-2007, 08:31 PM | #13 |
The only place where you will need a global variable for a trigger is when you disable/enable the trigger in some other function. And that will happen only in some really rare cases. So, why dont you use local trigger vars since those cant be modified easily and are a bit faster. |
| 12-05-2007, 06:36 AM | #14 | |
Quote:
|
| 12-05-2007, 07:08 AM | #15 |
Ok guys I'll just keep using globals since I'm not having any trouble with it. Thanks to all who replied, sorry I cant REP you guys right now. |
