System Shape Creator

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Warcraft is a 32bit application.

I just tested it. Even I throw 2^999, it will work nicely too. So.. I do say hashtables are practically unlimited.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
We knew the limit before the guy made that post.
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
hail satan

Also some suggestions:
- rectangle
- transformation of circles (like scalex and scaley so you can get an eclipse)
- triangles
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
hail satan

Also some suggestions:
- rectangle
- transformation of circles (like scalex and scaley so you can get an eclipse)
- triangles

Rectangles and triangles can be made fairly easily with the createline method. (Although, I guess it could still be useful wrappers, no real harm in making them) :p
 

Executor

I see you
Reaction score
57
My sys already allows the creation of equilateral tri- and rectangles. Maybe I'll include a few wrappers for non-equilateral later on.

My new 3D-Version will include the following shapes:
  1. 3D-Line
  2. 3D-Spiral
  3. 3D-NonIntersectedStarPolygons
  4. 3D-IntersectedStarPolygons
  5. 3D-SuperEllipse

But atm I have big problems with the calculation of the x,y part depending on the emphasis of the z part. Hard to explain :banghead:
 

SanKakU

Member
Reaction score
21
JASS:
    private function onTestRepeater takes nothing returns nothing
        local Shape sd = Shape.getData()
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\SpellSteal\\SpellStealMissile.mdl",sd.x,sd.y))
    endfunction

    private function onTest takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local real x = GetUnitX(u)
        local real y = GetUnitY(u)
        local real a =  GetUnitFacing(u)*bj_DEGTORAD
        local Shape sd = 0
        set sd = Shape.createIntersectedStarPolygon(x,y,a,5,500.,1,15,0.0,function onTestRepeater)
        // creates a pentagram
    endfunction

-->
JASS:
    private function onTestRepeater takes Shape sd returns nothing
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\SpellSteal\\SpellStealMissile.mdl",sd.x,sd.y))
    endfunction

    private function onTest takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local real x = GetUnitX(u)
        local real y = GetUnitY(u)
        local real a =  GetUnitFacing(u)*bj_DEGTORAD
        local Shape sd = 0
        set sd = Shape.createIntersectedStarPolygon(x,y,a,5,500.,1,15,0.0,/*function */onTestRepeater)
        // creates a pentagram
    endfunction

Y'know. :thup:

oh, you can really make comments in the middle of a line like that? that's nice.
 

Executor

I see you
Reaction score
57
3D-Upgrade!

The system may now generate lines, circles and star polygons all in 3D.
Atm the code could be a little bit confusing and unoptimized, but as always: please give constructive criticism to help me improving it :)

....still working on presentation... demomap and screenshots will follow ;)

// demo map there!

// more screenshots there!

// I suppose it'll be best to move this topic back to the main forum of the tutorials and resources section for more reviews.
 

SanKakU

Member
Reaction score
21
effect shaper. i think you should rename it to effect shaper.
shaper just sounds way too vague. ppl want to know what is it shaping? i think of star wars the new jedi order and the yuuzhon vong shapers.

edit: the thread title was changed, not exactly according to my suggestion, but the change is better than what i suggested. but more importantly, better than how it was.
 

Executor

I see you
Reaction score
57
Ye, but it can more then only create effect shapes. This system loops through all points of a specific shape, but what to do with these points is your decision. Creating effects at this points is only one option.

But I also don't like "Shaper" that much :p, but atm I've no better idea.
 

SanKakU

Member
Reaction score
21
oh, you could make a shape of doodads huh? that's cool...or i guess flying units...couldn't you do a flying v?
 

Executor

I see you
Reaction score
57
> oh, you could make a shape of doodads huh?

yes, that's the idea

> couldn't you do a flying v?

well, I didn't implement a "V" but you could make a circle of flying units or something.
 

tooltiperror

Super Moderator
Reaction score
231
>v

In other words, two polar projected lines.

And you should add hypercycloids.

120px-Hypocycloid-3-8.svg.png

8e9b6fc6bb2338d896a74ed7d2061979.png
 

Executor

I see you
Reaction score
57
> And you should add hypercycloids.

WIP

> Yeah, and add a function that deals damage on each effect.

This system does NOT generate effects itself. It only calculates the points on the shape.. what you do with these points is your decision.
Example:

JASS:
scope DealDamageInCircle

struct DealDamageInCircle
    private static thistype enumInstance
    private static group    GROUP 
    unit caster
    
    private static method dealDamage takes nothing returns boolean
        call UnitDamageTarget(enumInstance.caster,GetFilterUnit(),100.,false,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
        return false
    endmethod
    
    private static method onCircle takes Shape sp returns nothing
        set enumInstance = sp.customValue
        call GroupEnumUnitsInRange(.GROUP,sp.x,sp.y,30.,Condition(function thistype.dealDamage))
    endmethod
    
    private static method cast takes unit u returns nothing
        local thistype this = thistype.allocate()
        local real x = GetUnitX(u)
        local real y = GetUnitY(u)
        local real z = GetUnitFlyHeight(u)
        local real f = GetUnitFacing(u)*bj_DEGTORAD
        local Shape sp = Shape.createEllipsis(x,y,z,f,0,0,250,250,12,1,0.1,thistype.onCircle,0)
        set .caster = u
        set sp.customValue = this
    endmethod
    
    private static method cons takes nothing returns boolean
        if GetSpellAbilityId() == 'A000' then
            call .cast(GetTriggerUnit())
        endif
        return false    
    endmethod
    
    private static method onInit takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(t,Condition(function thistype.cons))
        set .GROUP = CreateGroup()
    endmethod
endstruct

endscope
 

Executor

I see you
Reaction score
57
> Executor, in the Pentagram

In which pentagram? Do you mean the pentagram-spell of the demo map?
 

killingdyl

Active Member
Reaction score
6
> And you should add hypercycloids.

WIP
dam seems like you beat me to it. i also have a rose curve if you want my help just ask.
Edit: Hypocylcoids and rose curves are polar graphs so it its very easy to make without the system if anyone wants to know just pm me or something
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top