| 10-19-2006, 10:17 AM | #1 |
Ive been working on a Jass spell, which uses spinning orbs. I was wondering if I can involve the Y axis making multiple orbs spin on there own seperate axis. Exactly like Defensive Matrix This picture is an example, sorry bout the sloppyness. ![]() |
| 10-19-2006, 11:36 AM | #2 |
That's the Z axis. And yes, use unit flying heights. |
| 10-19-2006, 12:28 PM | #3 |
Do note: Polar projections into 3 axes are very difficult to maintain and calculate in the WC3 world. Consider making it 100% along either the x/y plane as a massive simplification. |
| 10-19-2006, 12:51 PM | #4 |
lol cant believe I said Y, I meant Z of course :-/ I cant find a method to move a unit with Z in there. |
| 10-19-2006, 01:25 PM | #5 | ||
Quote:
JASS:function ChaosStar_Actions takes nothing returns nothing local unit cas = GetTriggerUnit() local integer lev = GetUnitAbilityLevel(cas,ChaosStar()) local location loc = GetSpellTargetLoc() local location pos = GetUnitLoc(cas) local real dir = (AngleBetweenPoints(pos,loc)+90)*bj_DEGTORAD local real ang = 1.5 * bj_PI local real rad = ChaosStar_Rad(lev) local trigger trg = CreateTrigger() local integer tib = NewTableIndex() local string tab = I2S(tib) local integer LN = 0 local real array VX local real array VY local real array VZ local integer VN = ChaosStar_N(lev) local integer A=1 local integer B set VX[0]=GetLocationX(loc) set VY[0]=GetLocationY(loc) set VZ[0]=rad loop exitwhen (A>VN) set VX[A]=VX[0]+rad*Cos(dir)*Cos(ang) set VY[A]=VY[0]+rad*Sin(dir)*Cos(ang) set VZ[A]=VZ[0]+rad*Sin(ang) set ang = ang + ((2*bj_PI) / VN) set A=A+1 endloop set A=1 loop exitwhen (A>VN) set B=A+1 loop exitwhen (B>VN) set LN=LN+1 call SetTableObject(tab,I2S(LN), AddLightningEx( GetAbilityEffectById(ChaosStar(),EFFECT_TYPE_LIGHTNING,0) ,true,VX[A],VY[A],VZ[A],VX[b],VY[b],VZ[b]) ) set B=B+1 endloop set A=A+1 endloop call RemoveLocation(loc) call AttachInt(trg,"tib",tib) call SetTableInt(tab,"LN",LN) call SetTableInt(tab,"lev",lev) call SetTableReal(tab,"X",VX[0]) call SetTableReal(tab,"Y",VY[0]) call DestroyEffect(AddSpellEffectById(ChaosStar(),EFFECT_TYPE_SPECIAL,VX[0],VY[0])) call SetTableReal(tab,"dir",dir) call SetTableObject(tab,"cas",cas) call TriggerRegisterUnitEvent(trg,cas,EVENT_UNIT_SPELL_ENDCAST) call TriggerAddAction(trg,function ChaosStar_Triger) call TriggerRegisterTimerEvent(trg,ChaosStar_ShootInterval(lev),true) set trg=null set cas=null endfunction Quote:
Flying height trick... |
| 10-19-2006, 03:52 PM | #6 |
Vex, they are when the average person has 0 idea what you just posted. I cannot read your mind. I want to see it work before I believe that it's "easy". |
| 10-19-2006, 04:05 PM | #7 |
It is not much harder than the XY polar projection |
| 10-19-2006, 06:00 PM | #8 |
Might not be much harder, but Fulla is still a beginner. @Fulla - Just use the SetUnitHeight and a count to see if you will be moving the unit up or down at a certain time(get your fixed max and min height, along with the time it takes to move up/down then base it all on that) |
| 10-19-2006, 09:21 PM | #9 |
Ok it all works now, thx guys. However I cant think of a way of making 2 balls synchronise orbits. This is how Id like it e.g.: When casting ability you get: - 1 small ball - 2nd small ball (in same orbit) - 3rd small ball BUT instead they all merge making 1 big ball (prefably having the ball in same orbit 180 degrees apart) Then next it repeats but a new unique orbit. Current code im working with: JASS:function Trig_Terror_Conditions takes nothing returns boolean return GetRandomInt(1, 100) <= Terror_Chance() and GetUnitAbilityLevel(GetAttacker(), Terror_AbilId()) > 0 endfunction function Terror_Balls takes nothing returns nothing local timer t = GetExpiredTimer() local string s = GetAttachmentTable(t) local unit c = GetTableUnit(s,"Caster") local unit d = GetTableUnit(s,"Ball") local integer counter = GetTableInt(s,"Counter") local real r = GetTableReal(s,"Angle") local real z = GetTableReal(s,"Height") local boolean check = GetTableBoolean(s,"Check") if z >= 216 then set check = false endif if z <= 0 then set check = true endif if check == true then set z = z + 12 endif if check == false then set z = z - 12 endif set r = r + 10 call SetUnitFlyHeight(d, z, 240) call SetUnitPositionLoc( d, PolarProjectionBJ(GetUnitLoc(c), 125, r)) call SetTableReal(s,"Angle",r) call SetTableReal(s,"Height",z) call SetTableBoolean(s,"Check",check) call SetTableObject(s,"Ball",d) if counter == 0 then call PauseTimer(t) call DestroyTimer(t) endif endfunction function Trig_Terror_Actions takes nothing returns nothing local timer t = CreateTimer() local string s = GetAttachmentTable(t) local unit c = GetAttacker() local unit d local location l = GetUnitLoc(c) local real r = 0 local real z = 0 local integer lvl = GetUnitAbilityLevel(c, Terror_AbilId()) local integer counter = Terror_Number(lvl) local player owner = GetOwningPlayer(c) local boolean check = true loop exitwhen counter == 0 set r = r + (360 / (I2R(Terror_Number(lvl)) + I2R(udg_tempinteger))) set d = CreateUnitAtLoc(owner, 'h00X', PolarProjectionBJ(l, 125, r), bj_UNIT_FACING) call UnitAddAbility(d, 'A085') call UnitRemoveAbility(d, 'A085') set counter = counter - 1 endloop set counter = Terror_Number(lvl) set udg_tempinteger = udg_tempinteger + 1 call SetTableObject(s,"Caster",c) call SetTableObject(s,"Ball",d) call SetTableInt(s,"Counter",counter) call SetTableReal(s,"Angle",r) call SetTableReal(s,"Height",z) call SetTableBoolean(s,"Check",check) call TimerStart(t,0.05,true,function Terror_Balls) endfunction |
| 10-20-2006, 11:56 AM | #10 |
Just do what you did, in a loop, for each ball. Use SetTableWhatever(STRING,ID+I2S(ObjNum),Blah) So make an array of thingamajigs in the cache, the loop for each ball. As to the unique orbit....what? |
