| 06-12-2006, 11:02 PM | #2 |
Trigger: Runes
![]() Actions
![]() ![]() Unit - Create 1 Rune for (Owner of (Casting unit)) at ((Target point of ability being cast) offset by (0.00, 0.00)) facing (Source of current camera view)
![]() ![]() Unit - Add a 60.00 second Generic expiration timer to (last created unit)
![]() ![]() Unit - Create 1 Rune for (Owner of (Casting unit)) at ((Target point of ability being cast) offset by (150.00, 0.00)) facing (Source of current camera view)
![]() ![]() Unit - Add a 60.00 second Generic expiration timer to (last created unit)
![]() ![]() Unit - Create 1 Rune for (Owner of (Casting unit)) at ((Target point of ability being cast) offset by (-150.00, 0.00)) facing (Source of current camera view)
![]() ![]() Unit - Add a 60.00 second Generic expiration timer to (last created unit)
![]() ![]() Unit - Create 1 Rune for (Owner of (Casting unit)) at ((Target point of ability being cast) offset by (0.00, 150.00)) facing (Source of current camera view)
![]() ![]() Unit - Add a 60.00 second Generic expiration timer to (last created unit)
![]() ![]() Unit - Create 1 Rune for (Owner of (Casting unit)) at ((Target point of ability being cast) offset by (0.00, -150.00)) facing (Source of current camera view)
![]() ![]() Unit - Add a 60.00 second Generic expiration timer to (last created unit)Also, on your third trigger remove the condition for (Ability being cast), with a death event there is no ability being cast. If you're serious about making it into jass and making it fit the JESP manifest you should look around the sites for tutorials and try to first attempt it yourself, then post your own jass work for looking over. You don't learn anything if someone else makes it for you. A good tutorial to get you started is here. |
| 06-13-2006, 01:17 AM | #3 |
Thanks. |
| 06-13-2006, 03:19 AM | #4 |
" Unit - A unit Begins casting an ability " is not exactly what you want, since it fires before the good stuff happens. I'm not certain it's the cause of your problem, but it will let another bug in: players will be able to cancel the actual spell cast so that they get the trigger effects with no mana or cooldown cost. Change to "starts the effect of an ability" and both problems should go away. |
| 06-13-2006, 07:20 AM | #5 |
I converted these two triggers to JASS in the editor, but I am having trouble figuring out how to combine the two and why the ubersplat does not work. JASS:function Trig_Runes_Conditions takes nothing returns boolean if ( not ( GetSpellAbilityId() == 'A028' ) ) then return false endif return true endfunction function Trig_Runes_Actions takes nothing returns nothing call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), 0.00, 0.00), GetCameraEyePositionLoc() ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), 150.00, 0), GetCameraEyePositionLoc() ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), -150.00, 0), GetCameraEyePositionLoc() ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), 0.00, 150.00), GetCameraEyePositionLoc() ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), 0.00, -150.00), GetCameraEyePositionLoc() ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) endfunction //=========================================================================== function InitTrig_Runes takes nothing returns nothing set gg_trg_Runes = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Runes, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Runes, Condition( function Trig_Runes_Conditions ) ) call TriggerAddAction( gg_trg_Runes, function Trig_Runes_Actions ) endfunction JASS:function Trig_Runes_Kill_Conditions takes nothing returns boolean if ( not ( GetUnitTypeId(GetKillingUnitBJ()) == 'n00C' ) ) then return false endif return true endfunction function Trig_Runes_Kill_Actions takes nothing returns nothing call CreateUbersplatBJ( GetUnitLoc(GetKillingUnitBJ()), "NVOL", 100, 100, 100, 0, false, false ) endfunction //=========================================================================== function InitTrig_Runes_Kill takes nothing returns nothing set gg_trg_Runes_Kill = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Runes_Kill, EVENT_PLAYER_UNIT_DEATH ) call TriggerAddCondition( gg_trg_Runes_Kill, Condition( function Trig_Runes_Kill_Conditions ) ) call TriggerAddAction( gg_trg_Runes_Kill, function Trig_Runes_Kill_Actions ) endfunction |
| 06-13-2006, 07:33 AM | #6 |
You should use GetDyingUnit(), not GetKillingUnit(), in both the condition and action. |
| 06-13-2006, 08:45 AM | #7 |
They already are MUI. Converting them into JASS will make them more efficient, though. A major problem there is leaks (10 location leaks at least). Meanwhile, THE major problem is this: JASS:GetCameraEyePositionLoc()That will desync in multiplayer (oh, and leaks as well). |
| 06-13-2006, 08:52 AM | #8 |
How do I fix the getcamera desyncing? |
| 06-13-2006, 09:04 AM | #9 |
Oh, I didn't even notice that. The problem is that camera targets are local information. You'll have to manually send the information. see http://www.wc3jass.com/viewtopic.php?t=2676&start=0 You could try mike's snippets as is. If it takes too long to sync that many values one by one, you'll have to modify it so that it sets up selections for all players at once. Of course since all you want is facing.. You might as well just say screw it and have the runes face a random direction. |
| 06-13-2006, 09:36 AM | #10 |
So here is the new first part: JASS:function Trig_Runes_Conditions takes nothing returns boolean if ( not ( GetSpellAbilityId() == 'A028' ) ) then return false endif return true endfunction function Trig_Runes_Actions takes nothing returns nothing call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), 0.00, 0.00), GetRandomLocInRect(GetPlayableMapRect()) ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), 150.00, 0), GetRandomLocInRect(GetPlayableMapRect()) ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), -150.00, 0), GetRandomLocInRect(GetPlayableMapRect()) ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), 0.00, 150.00), GetRandomLocInRect(GetPlayableMapRect()) ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) call CreateNUnitsAtLocFacingLocBJ( 1, 'n00C', GetOwningPlayer(GetSpellAbilityUnit()), OffsetLocation(GetSpellTargetLoc(), 0.00, -150.00), GetRandomLocInRect(GetPlayableMapRect()) ) call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() ) endfunction //=========================================================================== function InitTrig_Runes takes nothing returns nothing set gg_trg_Runes = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Runes, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Runes, Condition( function Trig_Runes_Conditions ) ) call TriggerAddAction( gg_trg_Runes, function Trig_Runes_Actions ) endfunction And here is the new second part: JASS:function Trig_Runes_Kill_Conditions takes nothing returns boolean if ( not ( GetUnitTypeId(GetDyingUnitBJ()) == 'n00C' ) ) then return false endif return true endfunction function Trig_Runes_Kill_Actions takes nothing returns nothing call CreateUbersplatBJ( GetUnitLoc(GetDyingUnitBJ()), "NVOL", 100, 100, 100, 0, false, false ) endfunction //=========================================================================== function InitTrig_Runes_Kill takes nothing returns nothing set gg_trg_Runes_Kill = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Runes_Kill, EVENT_PLAYER_UNIT_DEATH ) call TriggerAddCondition( gg_trg_Runes_Kill, Condition( function Trig_Runes_Kill_Conditions ) ) call TriggerAddAction( gg_trg_Runes_Kill, function Trig_Runes_Kill_Actions ) endfunction The attempts I have made in WE to combine these two have failed. I believe they have because I am not sure how to deal with the closing lines of each script, the part under the green line. At any rate, a few of the leaks should now be fixed. |
| 06-13-2006, 01:15 PM | #11 |
The bottom function, as its name implies, initializes the trigger. It adds events to it, conditions to it, and actions to it. Since you just converted from GUI you shouldn't have to worry about it (unless you want to add new events). You don't need to combine them together, they both have seperate events so there's no reason to. |
| 06-13-2006, 02:33 PM | #12 |
First trigger still has 15 location leaks. Also, you keep using BJs, rather than natives. Change to: JASS:function Trig_Runes_Conditions takes nothing returns boolean if ( not ( GetSpellAbilityId() == 'A028' ) ) then return false endif return true endfunction function Trig_Runes_Actions takes nothing returns nothing local unit u = GetTriggerUnit() local real x = GetUnitX(u) local real y = GetUnitY(u) local player p = GetOwningPlayer(p) set u = CreateUnit( p, 'n00C', x, y, 0.00) call UnitApplyTimedLife( u, 'BTLF', 60) set u = CreateUnit( p, 'n00C', x + 150, y, 0.00) call UnitApplyTimedLife( u, 'BTLF', 60) set u = CreateUnit( p, 'n00C', x - 150, y, 0.00) call UnitApplyTimedLife( u, 'BTLF', 60) set u = CreateUnit( p, 'n00C', x, y + 150, 0.00) call UnitApplyTimedLife( u, 'BTLF', 60) set u = CreateUnit( p, 'n00C', x, y - 150, 0.00) call UnitApplyTimedLife( u, 'BTLF', 60) set u = null set p = null endfunction //=========================================================================== function InitTrig_Runes takes nothing returns nothing set gg_trg_Runes = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Runes, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Runes, Condition( function Trig_Runes_Conditions ) ) call TriggerAddAction( gg_trg_Runes, function Trig_Runes_Actions ) endfunction Fixed the leaks. If you want it to face random directions, then use GetRandomReal(0, 360) in place of the 0.00 at the end. |
| 06-13-2006, 04:10 PM | #13 |
In Runes Trigger: Change the condition function to this. JASS:function Trig_Runes_Conditions takes nothing returns boolean return GetSpellAbilityId() == 'A028' endfunction In Rune Kill Trigger: Change the condition function to this. JASS:function Trig_Runes_Kill_Conditions takes nothing returns boolean return GetUnitTypeId(GetDyingUnit()) == 'n00C' endfunction And you don't need to nullify Players, Griffen. Just a heads up. :P |
| 06-13-2006, 04:24 PM | #14 |
Rising Dusk, yes, you do need to nullify players. Any local variable that extends a handle must be nullified. JASS:type player extends handle |
| 06-13-2006, 04:27 PM | #15 |
I'm not sure the reasoning offhand, but I've been told numerous times by people not to. I'd like someone who plays with jass a lot (Weeaddar/Vex/Pipe) to clarify that either way, I really am 90% sure they don't have to be nulled for some mitigating reason. |
