| 02-26-2007, 02:32 PM | #1 |
I'll be posting all my questions about triggers on this thread, 1. I need an action that makes some units follow my custom hero. Can someone please tell me how this i can do it. 2. I need to know how to make a trigger work only if my custom hero is a certain level. Please answer to my questions, i need really good triggers for my campaign. |
| 02-26-2007, 02:59 PM | #2 |
Hi lome, -> 1. If you want to make them just follow, like they would when you order them to in game u need a trigger like this: JASS:function Trig_Sample_Actions takes nothing returns nothing call IssueTargetOrderBJ( udg_YourUnit, "move", udg_Hero ) endfunction //=========================================================================== function InitTrig_Sample takes nothing returns nothing set gg_trg_Sample = CreateTrigger( ) call TriggerRegisterTimerEventPeriodic( gg_trg_Sample, 1.00 ) call TriggerAddAction( gg_trg_Sample, function Trig_Sample_Actions ) endfunction If you're aiming for something like summons in other rpgs (like DiabloII) you might want to use this system: http://www.wc3campaigns.net/showthread.php?t=83384 ->2. You add a integer comparison as condition to your trigger: JASS:function Trig_Sample_Conditions takes nothing returns boolean if ( not ( GetHeroLevel(udg_Hero) == udg_Level ) ) then return false endif return true endfunction function Trig_Sample_Actions takes nothing returns nothing endfunction //=========================================================================== function InitTrig_Sample takes nothing returns nothing set gg_trg_Sample = CreateTrigger( ) call TriggerAddCondition( gg_trg_Sample, Condition( function Trig_Sample_Conditions ) ) call TriggerAddAction( gg_trg_Sample, function Trig_Sample_Actions ) endfunction hope this helps EDIT: sry i'm getting a little confused about those trigger tags Edited by vexorian. Reason: please use [jass] tags instead of [trigger] for Jass code.... |
| 02-26-2007, 07:53 PM | #3 |
You just need to use [jass] tags for JASS scripts, and you GUI triggers (ctrl + c/v) in [trigger] tags. But yeah, from a quick glance, tamishrah's way does work. |
| 02-27-2007, 01:51 AM | #4 |
tamisrah's functions optimizied: JASS:function Trig_Sample_Actions takes nothing returns nothing call IssueTargetOrder( udg_YourUnit, "move", udg_Hero ) endfunction //=========================================================================== function InitTrig_Sample takes nothing returns nothing set gg_trg_Sample = CreateTrigger( ) call TriggerRegisterTimerEventPeriodic( gg_trg_Sample, 1.00 ) call TriggerAddAction( gg_trg_Sample, function Trig_Sample_Actions ) endfunction JASS:function Trig_Sample_Conditions takes nothing returns boolean return GetHeroLevel(udg_Hero) == udg_Level endfunction function Trig_Sample_Actions takes nothing returns nothing //Your actions here endfunction //=========================================================================== function InitTrig_Sample takes nothing returns nothing set gg_trg_Sample = CreateTrigger( ) call TriggerAddCondition( gg_trg_Sample, Condition( function Trig_Sample_Conditions ) ) call TriggerAddAction( gg_trg_Sample, function Trig_Sample_Actions ) endfunction |
| 02-27-2007, 03:00 PM | #5 |
Um, why the hell are you using Jass, when its simply done in GUI. |
| 02-27-2007, 05:04 PM | #6 |
Because we're jass gurus and so should everyone else! Mwaha! Wording might be off, but the general action is there. That'll work well for what you want. For the other, it's an integer check. Just check the level of the hero before running actions. Depending on where you want it (Trig. Cond or normal if/then/else) it will look differently. Most of the time it's -- Trigger: If you'd prefer jass, it'd be much easier to explain. |
| 02-27-2007, 05:42 PM | #7 |
Thank u all but the GUI is way easier to use. I have somemore questions. 1.Is there a way to change the team all units in a certain region? 2.Is there a way to make my unit do one if its animations for a cinematic? 3.Is there a way to make lightning strike once at a certain time instead of it repeating? GUI please PS. I know this doesn't have anything to do with the trigger editor but, in my campaign will my hero keep his level for all the missions |
| 03-01-2007, 07:54 PM | #8 |
I have somemore questions. 1. is there a way to make a unit build something and then use a trigger to stop him from saying "Jobs Done" or something? 2. Is there a way to make so you havr to do all the events in a trigger before it starts? |
| 03-01-2007, 08:41 PM | #9 |
->1.1 Trigger: ->1.2 ->1.3 When you destroy an effect immediately after creating it will finish its animation before being destroyed. ->2.1 Could you explain that again? I don't really get what you want to do. ->2.2 No, there isn't, but you should be able to achieve what you want by using conditions. @Anopob: ctrl+c doesn't work, at least not for me. I had to use 'copy as text' by right clicking the trigger |
| 03-01-2007, 11:12 PM | #10 |
Er, that's what I meant. My bad. |
