HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Simpler way to deal with offsets?

08-25-2003, 07:19 AM#1
Zwan
Just curious if some of you guru's knew a better way to deal with offsets. Basically I'm looking for a quicker/easier to to deal with stuff like:

function Trig_Untitled_Trigger_001_Copy_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_Hpal_0000 ) ) then
return false
endif
return true
endfunction

function Trig_Untitled_Trigger_001_Copy_Actions takes nothing returns nothing
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 0.00, -448.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 96.00, -384.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 160.00, -288.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 224.00, -256.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 272.00, -192.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 288.00, -128.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 320.00, -32.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 352.00, 64.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 416.00, 192.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 400.00, 320.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 288.00, 384.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 192.00, 448.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 64.00, 348.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), 0.00, 256.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -64.00, 348.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -192.00, 448.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -288.00, 384.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -400.00, 320.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -416.00, 192.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -352.00, 64.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -320.00, -32.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -288.00, -128.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -272.00, -192.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -224.00, -256.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -160.00, -288.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(GetTriggerUnit()), -96.00, -348.00), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001_Copy takes nothing returns nothing
set gg_trg_Untitled_Trigger_001_Copy = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_Untitled_Trigger_001_Copy, Player(0), true )
call TriggerAddCondition( gg_trg_Untitled_Trigger_001_Copy, Condition( function Trig_Untitled_Trigger_001_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Untitled_Trigger_001_Copy, function Trig_Untitled_Trigger_001_Copy_Actions )
endfunction



Just seems like a lot of clicking adding in the offests etc.
08-25-2003, 08:03 AM#2
Zoizite
If it's a pattern, you can use for loops and a little math to shorten it a lot. Sorry, don't have an example to give.

BTW, more people will be able to understand that if you just use copy as text from the gui, instead of converting to jass. I can barely read that.
08-25-2003, 08:48 AM#3
EarthxFury
offset is simple, i find. all you do is refrance a point and edit it tru a pattern of grid spaces.
08-25-2003, 09:04 AM#4
Zwan
Ya, I suppose that was a bit of a long post. Sorry about that.

I just wanted to show how many clicks it was taking to help get my point across.

Takes twice as long to input the offset data as to calculate the grid.

I'm sure there is a better way, I'm just not finding it yet.
08-25-2003, 10:36 AM#5
EarthxFury
thats what i said, use the grid widths. i made a tut about it so long ago!
08-25-2003, 03:15 PM#6
Zwan
Oh, guess I will try to find your tutorial...
08-25-2003, 03:31 PM#7
Zwan
Oh ok, well I found your tutorial. I assume there is a way to set up a grid in the editor. The spell I listed above I worked out on paper as a test and then typed in the data via the add effects at offset.

Guess I'll go dig around in the editor some more, thanks for the help.
08-25-2003, 03:31 PM#8
cideh
Smallest grid = 64
Second smallest = 128
Biggest(yellow) = 512
08-25-2003, 05:53 PM#9
Raptor--
setup a base increment, and for loop A, multiply the increment by int A, by the look of it you'd probably do a sin relation for the X part to make it wave