Thread: xe0.9
View Single Post
Old 06-28-2008, 01:41 AM   #6
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Yes, I need better samples, I haven't made them yet since object editing is a little tiresome on WINE:

Most people may find it more complicated than the caster system, because of the rather alien way to use it, this is the xecast module:

Collapse JASS:
 local xecast mp = xecast.createA()
    set mp.abilityid='Ahpm' //let's say this is polymorph's rawcode, ok?
    set mp.orderstring="polymorph"
    set mp.owningplayer = GetOwningPlayer(GetTriggerUnit())
    call mp.castOnAOE(x,y,radius)

Now, what I wanted is more flexibility and things that look similar, this casts AOE polymorph on various points:



Collapse JASS:
 local xecast mp = xecast.create()
    set mp.abilityid='Ahpm' //let's say this is polymorph's rawcode, ok?
    set mp.orderstring="polymorph"
    set mp.owningplayer = GetOwningPlayer(GetTriggerUnit())
    call mp.castOnAOE(x,y+500.0,radius)
    call mp.castOnAOE(x-500.0,y,radius)
    call mp.castOnAOE(x,y,radius)
    call mp.castOnAOE(x-500.0,y-500.0,radius)
    call mp.destroy()

The real deal is that you don't need to keep creating stuff and worry about struct 'leaks'



Collapse JASS:
globals
    private xecast mp
endglobals

//.. on init
   set mp = xecast.create()
    set mp.abilityid='Ahpm' //let's say this is polymorph's rawcode, ok?
    set mp.orderstring="polymorph"


// later:
    set mp.owningplayer = GetOwningPlayer(GetTriggerUnit())
    call mp.castOnAOE(x,y+500.0,radius)
    call mp.castOnAOE(x-500.0,y,radius)
    call mp.castOnAOE(x,y,radius)
    call mp.castOnAOE(x-500.0,y-500.0,radius)

What if you want to target a unit group instead? you keep everything and just replace mp.castOnAOE(x,y,radius) with mp.castOnGroup(g) ,

And when all the modules are done, it will probably get larger than the caster system. Though very few people will have to implement them all.

And... spells with embedded systems are an abomination, not something 'good' it is terrible and no reason for pride.

I don't really like how xecast works right now, xefx on the other hand...
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote