Nice Triangle Form

soulmaka

New Member
Reaction score
2
i have a sliding trigger. i have created a special effect on the Position of triggering unit and that special effect is a Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl It can create a nice triangle form.. but how?? is it a Math Trigger?
 

SwedishChef

New Member
Reaction score
32
i guess he means /\ :p you can use create lightning effect between point and use point with offset to set the points
 

Danis[h]

New Member
Reaction score
19
i have a sliding trigger. i have created a special effect on the Position of triggering unit and that special effect is a Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl It can create a nice triangle form.. but how?? is it a Math Trigger?

For creating a triangle, you will need 3 points i believe.

I would use the units position as reference then set the 2nd point somewhere at the unit's x+[some value]
and then setting the 4rd point to unit's y+[some value]

so Unitposition is
A(x1,y1)
then point 2 would be
B(x2+x1,y1)
and point 3 would be
C(x1,y3+y1)

There might be an easier way though.
 

soulmaka

New Member
Reaction score
2
For creating a triangle, you will need 3 points i believe.

I would use the units position as reference then set the 2nd point somewhere at the unit's x+[some value]
and then setting the 4rd point to unit's y+[some value]

so Unitposition is
A(x1,y1)
then point 2 would be
B(x2+x1,y1)
and point 3 would be
C(x1,y3+y1)

There might be an easier way though.

LOL .. 4rd?? hahaha.. btw what is this value?? Math??
 

soulmaka

New Member
Reaction score
2
I acidentally hit 4 instead of 3. That's meant to be 3rd.. Obviously you dont have points 1, 2 and then 4. Just skipping 3.

This??

Code:
Set LF_CP = ((Center of (Playable map area)) offset by (1.00, 1.00))
 

Danis[h]

New Member
Reaction score
19
Actions
Set Point[1] = (Position of (Triggering unit))
Set Point[2] = (Point[1] offset by (100.00, 0.00))
Set Point[3] = (Point[1] offset by (0.00, 100.00))

Would make out a small triangle.
 

soulmaka

New Member
Reaction score
2
Actions
Set Point[1] = (Position of (Triggering unit))
Set Point[2] = (Point[1] offset by (100.00, 0.00))
Set Point[3] = (Point[1] offset by (0.00, 100.00))

Would make out a small triangle.

only 2 points?? how aboutthe third one?? i can't be the Position of triggering unit.. because it's his position.. he will still move on it's current position.. means.. nothing happens
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
use angles, not coordinates...

take some center point, like position of unit

like this:

Trigger:
  • actions
    • set StartPoint = position of <unit>
    • set Angle = -30.00
    • for each (Integer A) from 1 to 3 do actions
      • loop
        • set Point1 = StartPoint offset by 500 towards angle degrees
        • set Point2 = StartPoint offset by 500 towards angle + 120.00 degrees
        • lighting effect - create a lighting effect starting from Point1 to Point2
        • call RemoveLocation(udg_Point1)
        • call RemoveLocation(udg_Point2)
        • set angle = angle + 120.00


this will form a nice triangle around the unit

don't forget to destroy the effects
 

soulmaka

New Member
Reaction score
2
use angles, not coordinates...

take some center point, like position of unit

like this:

Trigger:
  • actions
    • set StartPoint = position of <unit>
    • set Angle = -30.00
    • for each (Integer A) from 1 to 3 do actions
      • loop
        • set Point1 = StartPoint offset by 500 towards angle degrees
        • set Point2 = StartPoint offset by 500 towards angle + 120.00 degrees
        • lighting effect - create a lighting effect starting from Point1 to Point2
        • call RemoveLocation(udg_Point1)
        • call RemoveLocation(udg_Point2)
        • set angle = angle + 120.00


this will form a nice triangle around the unit

don't forget to destroy the effects

Hmmm.. I'll Try this one.. can you make it In Jass?? I'm Learning Jass Now.. ^^
 

Tyrulan

Ultra Cool Member
Reaction score
37
Making it in Jass wouldn't be that hard but if you wanted to lets say make it MUI while removing all leaks well then you've asked someone to do a fair amount of work. Get as far as you can on your own making this spell (or triangle) and ask for help when you need it and I'd be glad to!
 

soulmaka

New Member
Reaction score
2
Making it in Jass wouldn't be that hard but if you wanted to lets say make it MUI while removing all leaks well then you've asked someone to do a fair amount of work. Get as far as you can on your own making this spell (or triangle) and ask for help when you need it and I'd be glad to!

Sure!! btw.. it worked!! thanks Dinowc!! +rep
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
can you make it In Jass??

JASS:
scope triangle initializer init

// You can change this:
globals
    private constant integer ID = 'AHbz' 
    private constant string light = "DRAM" //I used mana drain effect
    private constant real radius = 500.00 //the size of the triangle
    private constant real EffectZ = 50.00 //the height of the triangle
    private constant integer n = 3 //number of angles
    private constant real angleInc = 360.00 / I2R(n)
    private constant real duration = 5.00
endglobals

//Don't touch this:

private function conditions takes nothing returns boolean
    return GetSpellAbilityId() == ID
endfunction

private function PolarX takes real x, real dist, real angle returns real
    return x + dist * Cos(angle * bj_DEGTORAD)
endfunction

private function PolarY takes real y, real dist, real angle returns real
    return y + dist * Sin(angle * bj_DEGTORAD)
endfunction

private function actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local location target = GetSpellTargetLoc()
    local lightning array Effect
    
    local real angle = GetUnitFacing(caster) - angleInc
    local real x = GetLocationX(target)
    local real y = GetLocationY(target)
    
    local integer i = 0
    
    loop
        set Effect<i> = AddLightningEx(light, false, PolarX(x,radius,angle), PolarY(y,radius,angle), EffectZ, PolarX(x,radius,angle + angleInc), PolarY(y,radius,angle + angleInc), EffectZ)
        set angle = angle + angleInc
        set i = i + 1
        exitwhen i &gt;= n
    endloop
    
    call TriggerSleepAction(duration)
    
    set i = 0
    loop
        call DestroyLightning(Effect<i>)
        set i = i + 1
        exitwhen i &gt;= n
    endloop
    
    call RemoveLocation(target)
    set caster = null
    set target = null
endfunction
//===========================================================================
private function init takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
    loop
        call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
        set i = i + 1
        exitwhen i == bj_MAX_PLAYER_SLOTS
    endloop
    
    call TriggerAddCondition(t, Condition(function conditions))
    call TriggerAddAction(t, function actions)
    
endfunction

endscope
</i></i>


I was bored :p

it's MUI ofc
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top