T32, how to use the ".startperiodic" method ? :S

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
JASS:
            set this.alpha = 255
            set this.red = 255
            set this.green = 255
            set this.blue = 255

Actually not all units' colors are 255, users may change the value in Object editor.
 

Viikuna

No Marlo no game.
Reaction score
265
Write some lua script which can read that shit from MPQ and use JassHelpers SLK - struct - thingy to copy paste all unit related data such as:

JASS:


module unitdata
    real Red
    real Green
    real Blue
    real Scale

    //Someday...
    //real BaseLife
    //real BaseMana
    
    real LaunchX
    real LaunchY
    real LaunchZ
    real ImpactZ

    integer ArmorBase
    integer ArmorType

    attacktype AttackType
    integer    WeaponType

    string  PrimaryAttribute
    
    boolean MissileHoming
    string  MissileArt
    real    MissileArc
    real    MissileSpeed
    
    real DamagePoint
    real DamageMin
    real DamageMax
    real DamageAreaFull
    real DamageAreaMedium
    real DamageAreaSmall
    real DamageFactorMedium
    real DamageFactorSmall

    // etc.


This is from UnitProperties ObjectData module, which is used by all the cool systems in Tides of Blood.

( Theres no alpha in this module, because its already in main UnitProperties code. This module only has stuff that is different for all unit types depending on object editor stuff. )

edit. Current public version of UnitProperties only has damage point of all this stuff, because its used by evasion module. Read more here, UnitProperties thread.

edit2. About [lJASS]//!loaddata[/lJASS] command, you can read from JassHelper manual.

I myself know nothing about any other coding that Jass, so I cant advice you how to make tools that automaticly get you stuff from MPQ and create those .slk files for you. I guess you gotta ask about that from some real programming forums.

edit3. Damn, this thread is long. I guess it should at least attract peoples attention if anything.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
edit3. Damn, this thread is long. I guess it should at least attract peoples attention if anything.

Hehe, yeah... hopefully :thup:

And, I'm afraid I know nothing about any programming language except JASS either :( So, hopefully someone here at the forums knows it, and might be able to help :D:D:D

But, basically what you're saying is that I need an extern application, which will create an .lsk file from an MPQ ? :eek:
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Ok, then...
Well, could I just simply skip that part then, and maybe submit this resource ? :eek:
 

Viikuna

No Marlo no game.
Reaction score
265
Well, its not really a problem to initialize all that stuff manually by typing it, but then it has some problems.

-You must remember to change your code every time you do some changes in object editor.

-If you have many different unit types, you have to type a lot to initliaze all that data.


I mean, just try to do something like this without any tools:

[lJASS]set s=s__unitWeapID_getFromKey('Hamg') set s__unitWeapID_dmgpt1=0.55 set s=s__unitWeapID_getFromKey('Hblm') set s__unitWeapID_dmgpt1=0.55 set s=s__unitWeapID_getFromKey('Hmkg') set s__unitWeapID_dmgpt1=0.35 set s=s__unitWeapID_getFromKey('Hpal') set s__unitWeapID_dmgpt1=0.433 set s=s__unitWeapID_getFromKey('hbot') set s=s__unitWeapID_getFromKey('hbsh') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('hdes') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('hdhw') set s__unitWeapID_dmgpt1=0.43 set s=s__unitWeapID_getFromKey('hfoo') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('hgry') set s__unitWeapID_dmgpt1=0.8 set s=s__unitWeapID_getFromKey('hgyr') set s__unitWeapID_dmgpt1=0.03 set s=s__unitWeapID_getFromKey('hkni') set s__unitWeapID_dmgpt1=0.66 set s=s__unitWeapID_getFromKey('hmil') set s__unitWeapID_dmgpt1=0.39 set s=s__unitWeapID_getFromKey('hmpr') set s__unitWeapID_dmgpt1=0.59 set s=s__unitWeapID_getFromKey('hmtm') set s__unitWeapID_dmgpt1=1 set s=s__unitWeapID_getFromKey('hmtt') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('hpea') set s__unitWeapID_dmgpt1=0.433 set s=s__unitWeapID_getFromKey('hphx') set s__unitWeapID_dmgpt1=0.43 set s=s__unitWeapID_getFromKey('hpxe') set s=s__unitWeapID_getFromKey('hrif') set s__unitWeapID_dmgpt1=0.17 set s=s__unitWeapID_getFromKey('hrtt') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('hsor') set s__unitWeapID_dmgpt1=0.75 set s=s__unitWeapID_getFromKey('hspt') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('hwat') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('hwt2') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('hwt3') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('halt') set s=s__unitWeapID_getFromKey('harm') set s=s__unitWeapID_getFromKey('hars') set s=s__unitWeapID_getFromKey('hatw') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('hbar') set s=s__unitWeapID_getFromKey('hbla') set s=s__unitWeapID_getFromKey('hcas') set s=s__unitWeapID_getFromKey('hctw') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('hgra') set s=s__unitWeapID_getFromKey('hgtw') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('hhou') set s=s__unitWeapID_getFromKey('hkee') set s=s__unitWeapID_getFromKey('hlum') set s=s__unitWeapID_getFromKey('hshy') set s=s__unitWeapID_getFromKey('htow') set s=s__unitWeapID_getFromKey('hvlt') set s=s__unitWeapID_getFromKey('hwtw') set s=s__unitWeapID_getFromKey('Obla') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('Ofar') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('Oshd') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('Otch') set s__unitWeapID_dmgpt1=0.36 set s=s__unitWeapID_getFromKey('nwad') set s=s__unitWeapID_getFromKey('obot') set s=s__unitWeapID_getFromKey('ocat') set s__unitWeapID_dmgpt1=0.1 set s=s__unitWeapID_getFromKey('odes') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('odoc') set s__unitWeapID_dmgpt1=0.73 set s=s__unitWeapID_getFromKey('oeye') set s=s__unitWeapID_getFromKey('ogru') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ohun') set s__unitWeapID_dmgpt1=0.31 set s=s__unitWeapID_getFromKey('ohwd') set s=s__unitWeapID_getFromKey('okod') set s__unitWeapID_dmgpt1=0.85 set s=s__unitWeapID_getFromKey('opeo') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('orai') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('oshm') set s__unitWeapID_dmgpt1=0.43 set s=s__unitWeapID_getFromKey('osp1') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('osp2') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('osp3') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('osp4') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ospm') set s=s__unitWeapID_getFromKey('ospw') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('osw1') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('osw2') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('osw3') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('otau') set s__unitWeapID_dmgpt1=0.467 set s=s__unitWeapID_getFromKey('otbk') set s__unitWeapID_dmgpt1=0.31 set s=s__unitWeapID_getFromKey('otbr') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('otot') set s=s__unitWeapID_getFromKey('owyv') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('oalt') set s=s__unitWeapID_getFromKey('obar') set s=s__unitWeapID_getFromKey('obea') set s=s__unitWeapID_getFromKey('ofor') set s=s__unitWeapID_getFromKey('ofrt') set s=s__unitWeapID_getFromKey('ogre') set s=s__unitWeapID_getFromKey('oshy') set s=s__unitWeapID_getFromKey('osld') set s=s__unitWeapID_getFromKey('ostr') set s=s__unitWeapID_getFromKey('otrb') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('otto') set s=s__unitWeapID_getFromKey('ovln') set s=s__unitWeapID_getFromKey('owtw') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('Edem') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('Edmm') set s__unitWeapID_dmgpt1=0.26 set s=s__unitWeapID_getFromKey('Ekee') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('Emoo') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('Ewar') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('earc') set s__unitWeapID_dmgpt1=0.72 set s=s__unitWeapID_getFromKey('ebal') set s__unitWeapID_dmgpt1=0.1 set s=s__unitWeapID_getFromKey('ebsh') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('echm') set s__unitWeapID_dmgpt1=0.7 set s=s__unitWeapID_getFromKey('edcm') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('edes') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('edoc') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('edot') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('edry') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('edtm') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('efdr') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('efon') set s__unitWeapID_dmgpt1=0.467 set s=s__unitWeapID_getFromKey('ehip') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('ehpr') set s__unitWeapID_dmgpt1=0.633 set s=s__unitWeapID_getFromKey('emtg') set s__unitWeapID_dmgpt1=0.49 set s=s__unitWeapID_getFromKey('esen') set s__unitWeapID_dmgpt1=0.46 set s=s__unitWeapID_getFromKey('espv') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('even') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ewsp') set s=s__unitWeapID_getFromKey('eaoe') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('eaom') set s__unitWeapID_dmgpt1=0.59 set s=s__unitWeapID_getFromKey('eaow') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('eate') set s=s__unitWeapID_getFromKey('eden') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('edob') set s=s__unitWeapID_getFromKey('edos') set s=s__unitWeapID_getFromKey('egol') set s=s__unitWeapID_getFromKey('emow') set s=s__unitWeapID_getFromKey('eshy') set s=s__unitWeapID_getFromKey('etoa') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('etoe') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('etol') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('etrp') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('Ucrl') set s__unitWeapID_dmgpt1=0.46 set s=s__unitWeapID_getFromKey('Udea') set s__unitWeapID_dmgpt1=0.56 set s=s__unitWeapID_getFromKey('Udre') set s__unitWeapID_dmgpt1=0.55 set s=s__unitWeapID_getFromKey('Ulic') set s__unitWeapID_dmgpt1=0.46 set s=s__unitWeapID_getFromKey('uabo') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('uaco') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('uban') set s__unitWeapID_dmgpt1=0.56 set s=s__unitWeapID_getFromKey('ubsp') set s__unitWeapID_dmgpt1=0.633 set s=s__unitWeapID_getFromKey('ucrm') set s=s__unitWeapID_getFromKey('ucry') set s__unitWeapID_dmgpt1=0.64 set s=s__unitWeapID_getFromKey('ucs1') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ucs2') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ucs3') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ucsB') set s=s__unitWeapID_getFromKey('ucsC') set s=s__unitWeapID_getFromKey('ufro') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('ugar') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ugho') set s__unitWeapID_dmgpt1=0.39 set s=s__unitWeapID_getFromKey('ugrm') set s=s__unitWeapID_getFromKey('uloc') set s__unitWeapID_dmgpt1=0 set s=s__unitWeapID_getFromKey('umtw') set s__unitWeapID_dmgpt1=0.7 set s=s__unitWeapID_getFromKey('unec') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('uobs') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('uplg') set s=s__unitWeapID_getFromKey('ushd') set s=s__unitWeapID_getFromKey('uske') set s__unitWeapID_dmgpt1=0.56 set s=s__unitWeapID_getFromKey('uskm') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('uubs') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('uaod') set s=s__unitWeapID_getFromKey('ubon') set s=s__unitWeapID_getFromKey('ugol') set s=s__unitWeapID_getFromKey('ugrv') set s=s__unitWeapID_getFromKey('unp1') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('unp2') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('unpl') set s=s__unitWeapID_getFromKey('usap') set s=s__unitWeapID_getFromKey('usep') set s=s__unitWeapID_getFromKey('ushp') set s=s__unitWeapID_getFromKey('uslh') set s=s__unitWeapID_getFromKey('utod') set s=s__unitWeapID_getFromKey('utom') set s=s__unitWeapID_getFromKey('uzg1') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('uzg2') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('uzig') set s=s__unitWeapID_getFromKey('Nbrn') set s__unitWeapID_dmgpt1=0.7 set s=s__unitWeapID_getFromKey('Nbst') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nnht') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('npfl') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('ndr1') set s__unitWeapID_dmgpt1=0.56 set s=s__unitWeapID_getFromKey('ndr2') set s__unitWeapID_dmgpt1=0.56 set s=s__unitWeapID_getFromKey('ndr3') set s__unitWeapID_dmgpt1=0.56 set s=s__unitWeapID_getFromKey('ngz1') set s__unitWeapID_dmgpt1=0.63 set s=s__unitWeapID_getFromKey('ngz2') set s__unitWeapID_dmgpt1=0.63 set s=s__unitWeapID_getFromKey('ngz3') set s__unitWeapID_dmgpt1=0.63 set s=s__unitWeapID_getFromKey('ngzc') set s__unitWeapID_dmgpt1=0.63 set s=s__unitWeapID_getFromKey('ngzd') set s__unitWeapID_dmgpt1=0.63 set s=s__unitWeapID_getFromKey('ngza') set s__unitWeapID_dmgpt1=0.63 set s=s__unitWeapID_getFromKey('ngz4') set s__unitWeapID_dmgpt1=0.63 set s=s__unitWeapID_getFromKey('npn1') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('npn2') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('npn3') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('npn4') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('npn5') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('npn6') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('npng') set s=s__unitWeapID_getFromKey('nqb2') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nqb3') set s__unitWeapID_dmgpt1=0.633 set s=s__unitWeapID_getFromKey('nqb4') set s__unitWeapID_dmgpt1=0.633 set s=s__unitWeapID_getFromKey('nqbh') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('nwe1') set s=s__unitWeapID_getFromKey('nwe2') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nwe3') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nadk') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nadr') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nadw') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nahy') set s__unitWeapID_dmgpt1=0.7 set s=s__unitWeapID_getFromKey('nanb') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nanm') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nanc') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nane') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nano') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nanw') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('narg') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nass') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nbal') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nba2') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nban') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nbda') set s__unitWeapID_dmgpt1=0.83 set s=s__unitWeapID_getFromKey('nbdk') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nbdm') set s__unitWeapID_dmgpt1=0.83 set s=s__unitWeapID_getFromKey('nbdo') set s__unitWeapID_dmgpt1=0.83 set s=s__unitWeapID_getFromKey('nbdr') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nbds') set s__unitWeapID_dmgpt1=0.83 set s=s__unitWeapID_getFromKey('nbdw') set s__unitWeapID_dmgpt1=0.83 set s=s__unitWeapID_getFromKey('nbld') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nbnb') set s=s__unitWeapID_getFromKey('nbot') set s=s__unitWeapID_getFromKey('nbrg') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nbwm') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nbzd') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nbzk') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nbzw') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('ncea') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ncen') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('ncer') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('ncfs') set s__unitWeapID_dmgpt1=0.38 set s=s__unitWeapID_getFromKey('ncim') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ncks') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ncnk') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ndqn') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ndqp') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ndqs') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ndqt') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ndqv') set s__unitWeapID_dmgpt1=0.33 set s=s__unitWeapID_getFromKey('ndrv') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('ndtb') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ndth') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ndtp') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ndtr') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ndtt') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ndtw') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nehy') set s__unitWeapID_dmgpt1=0.7 set s=s__unitWeapID_getFromKey('nelb') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('nele') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('nenc') set s__unitWeapID_dmgpt1=0.467 set s=s__unitWeapID_getFromKey('nenf') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nenp') set s__unitWeapID_dmgpt1=0.467 set s=s__unitWeapID_getFromKey('nepl') set s__unitWeapID_dmgpt1=0.467 set s=s__unitWeapID_getFromKey('nerd') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('ners') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nerw') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nfel') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('nfgb') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('nfgo') set s__unitWeapID_dmgpt1=0.26 set s=s__unitWeapID_getFromKey('nfgt') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('nfgu') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('nfod') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nfor') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfot') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nfov') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('nfpc') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfpe') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfpl') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfps') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfpt') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfpu') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfra') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfrb') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfre') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfrg') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfrl') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfrp') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfrs') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfsh') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nfsp') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nftb') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nftk') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nftr') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nftt') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ngdk') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('nggr') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ngh1') set s__unitWeapID_dmgpt1=0.56 set s=s__unitWeapID_getFromKey('ngh2') set s__unitWeapID_dmgpt1=0.56 set s=s__unitWeapID_getFromKey('ngir') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nglm') set s=s__unitWeapID_getFromKey('ngna') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('ngnb') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ngno') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ngns') set s__unitWeapID_dmgpt1=0.4 set s=s__unitWeapID_getFromKey('ngnv') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ngnw') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ngrd') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('ngrk') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('ngrw') set s__unitWeapID_dmgpt1=0.94 set s=s__unitWeapID_getFromKey('ngsp') set s=s__unitWeapID_getFromKey('ngst') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nhar') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nhdc') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nhfp') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nhhr') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nhrh') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nhrq') set s__unitWeapID_dmgpt1=0.35 set s=s__unitWeapID_getFromKey('nhrr') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nhrw') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nhyc') set s__unitWeapID_dmgpt1=0.7 set s=s__unitWeapID_getFromKey('nhyd') set s__unitWeapID_dmgpt1=0.7 set s=s__unitWeapID_getFromKey('nhyh') set s__unitWeapID_dmgpt1=0.7 set s=s__unitWeapID_getFromKey('nina') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('ninc') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('ninf') set s__unitWeapID_dmgpt1=0.26 set s=s__unitWeapID_getFromKey('ninm') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nith') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nitp') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nitr') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nits') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nitt') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nitw') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('njgb') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('njga') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('njg1') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nkob') set s__unitWeapID_dmgpt1=0.38 set s=s__unitWeapID_getFromKey('nkog') set s__unitWeapID_dmgpt1=0.38 set s=s__unitWeapID_getFromKey('nkol') set s__unitWeapID_dmgpt1=0.38 set s=s__unitWeapID_getFromKey('nkot') set s__unitWeapID_dmgpt1=0.38 set s=s__unitWeapID_getFromKey('nlds') set s__unitWeapID_dmgpt1=0.53 set s=s__unitWeapID_getFromKey('nlkl') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nlpd') set s__unitWeapID_dmgpt1=0.66 set s=s__unitWeapID_getFromKey('nlpr') set s__unitWeapID_dmgpt1=0.38 set s=s__unitWeapID_getFromKey('nlps') set s__unitWeapID_dmgpt1=0.38 set s=s__unitWeapID_getFromKey('nlrv') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('nlsn') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nltc') set s__unitWeapID_dmgpt1=0.3 set s=s__unitWeapID_getFromKey('nltl') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nlur') set s=s__unitWeapID_getFromKey('nmam') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nmbg') set s__unitWeapID_dmgpt1=0.6 set s=s__unitWeapID_getFromKey('nmcf') set s__unitWeapID_dmgpt1=0.38 set s=s__unitWeapID_getFromKey('nmdr') set s__unitWeapID_dmgpt1=0.5 set s=s__unitWeapID_getFromKey('nmfs') set s__unitWeapID_dmgpt1=0.66 set s=s__unitWeapID_getFromKey('nmgd') set s__unitWeapID_dmgpt1=0.66 set s=s__unitWeapID_getFromKey('nmgr') set s__unitWeapID_dmgpt1=0.66[/lJASS]

I tell you, it will be a pain in the ass.

But yea, in reality people should not use that many unit types, that they cant initialize starting RGB for all of them. ( So we poor guys who cant write MPQ reading tools, just have to use less unit types )

I say you go and release.

edit. And most of units probably use 255,255,255 colours anyways, dont you think? It should make it easier anyways.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, and I can add that in the doc, and this system doesn't support pre-changed RGB colors from the Object Editor, and I'd suggest them manually change the color of the units in-game instead ? :eek:

Question: Did you just type all that text out, now ?!!!!! XD

And also, as this system uses two libraries, should I post them separatelly, or as one ? :S
 

Viikuna

No Marlo no game.
Reaction score
265
That code is from UnitProperties evasion module library. It just has the damage points of all stock units.

Whether you should release both of those together, Im not sure.

Id probably release them together, so I wouldnt have to make any links from periodic fade library thread to that appereance thread maybe.

edit. Remember that when submitting stuff like this, the test map is what counts. Remember to make some really cool vertex color and scale changing thingies that perfectly demostrate why your system is so cool.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Hmm... Well, atm I have test triggers like these:
Trigger:
  • Test Scale Dec
    • Events
      • Player - Player 1 (Red) types a chat message containing scale de as An exact match
    • Conditions
    • Actions
      • Set TempGroup = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Custom script: call SmoothScaleChange.create( GetEnumUnit(), 2.5, -.5, null )
      • Custom script: call DestroyGroup(udg_TempGroup)


Trigger:
  • Test Scale Inc
    • Events
      • Player - Player 1 (Red) types a chat message containing scale in as An exact match
    • Conditions
    • Actions
      • Set TempGroup = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Custom script: call SmoothScaleChange.create( GetEnumUnit(), 2.5, .5, null )
      • Custom script: call DestroyGroup(udg_TempGroup)


Which all are very dull imho :(

But, you mean like a spell or something ? :eek:

Any suggestions ? :S

EDIT: Wait a minute... I have this spell (Which I believe is the reason why I made this system, can't remember XD) which uses both vertex-color change, and scale change, but it's not nearly finished :(

But, maybe something like it ? :eek:

JASS:
scope SearingDash initializer init // requires KT, TimedHandles, BoundSentinel, KBS, TimerUtils

    globals
        private constant integer ABIL_ID = 'A000' // The rawcode of the ability!
        private constant integer CARGO_ID = 'Abun' // The rawcode of the "Cargo Hold" ability!
        
        private constant string EFFECT_1 = "Environment\\LargeBuildingFire\\LargeBuildingFire2.mdl"
        private constant string ATTACH_POINT = "origin"
        private constant real PERIOD = .1 //Time between effects being created.
        private constant real DAMAGE_PERIOD = 0.03125 // How often the effects deal damage.
        private constant real EFFECT_DURATION = 1.5 // How long each effect lasts.
        
        private constant string DMG_EFFECT = "Abilities\\Spells\\Items\\AIfb\\AIfbSpecialArt.mdl"
        private constant string ATTACH_POINT2 = "chest"
        
        private constant real DURATION = 5. //How long the spell lasts
        
        private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL  // Explains itself i think XD
        private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL  // Same here <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />
        private constant weapontype WEAPON_TYPE = WEAPON_TYPE_WHOKNOWS// And same here <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />
        
        private constant real DMG_FACTOR = 1. // An easy way of changing the damage!
        private constant real RNG_FACTOR = 1. // An easy way of changing the damage range!
        
        private constant real TRANSPARENCY = 45. // In %, how transparent the caster becomes!
        private constant real SCALE = 1.65 // How much bigger the caster becomes when casting this spell. (Has to end with 0 or 5!)
        
        private constant boolean KNOCKBACK = true // Wether it should knockback units or not!
        private constant real DISTANCE = 200 // How far the get &quot;knockbacked&quot;.
        private constant real SPEED = 1 // How long the knockback takes.
        
        private constant boolean EXTRA_MOVEMENT = false // If the caster should have movement-speed above 522.
        private constant real EXTRA_MOVE_SPEED = 7.5 // How far the caster is moves each PERIOD... Increased movement-speed above 522 !
        private constant real MOVE_SPEED = 522. // How fast the caster should move if EXTRA_MOVEMENT = false !
        private constant real MOVE_PERIOD = 0.03125
        
    endglobals

    globals
        private group g = CreateGroup()
        private group gr = CreateGroup()
        
        private integer TempStruct
        
        private filterfunc Filterz
        
        private real tick = 0
    endglobals

    private struct Data
        boolean on
        
        integer lvl

        real speed
        real time = 1
        real origX
        real origY
        real x
        real y
        real angle
        real scale = 1.
        
        player owner
        
        unit caster
    
        static method create takes unit u returns Data
            local Data d = Data.allocate()
            set d.caster = u
            set d.owner = GetOwningPlayer(d.caster)
            set d.speed = GetUnitMoveSpeed(u)
            set d.lvl = GetUnitAbilityLevel(d.caster, ABIL_ID)
            return d
        endmethod
    
        method onDestroy takes nothing returns nothing
            if EXTRA_MOVEMENT == false then
                call SetUnitMoveSpeed(.caster, .speed)
            endif
            call SetUnitPathing(.caster,true)
            call SetUnitVertexColor(.caster,255,255,255,255)
            call SetPlayerAbilityAvailable(.owner, ABIL_ID, true)
            call UnitRemoveAbility(.caster, CARGO_ID)
            set this.on = false
        endmethod
    endstruct
    
    private struct Dam
        Data d
        unit caster
        player owner
        real x
        real y
        integer lv
        real tick
    endstruct

    private function Damage takes nothing returns real
        return I2R(Dam(TempStruct).lv) * DMG_FACTOR * 1.171875
    endfunction

    private function Range takes nothing returns real
        return RNG_FACTOR * 100.
    endfunction

    private function Range_Big takes nothing returns real
        return RNG_FACTOR *150.
    endfunction

    private function Filters takes nothing returns boolean
        return GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitEnemy(GetFilterUnit(), Dam(TempStruct).owner) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false
    endfunction

    private function Filters_Enum takes nothing returns boolean
        return GetWidgetLife(GetEnumUnit()) &gt; 0.405 and IsUnitEnemy(GetEnumUnit(), Dam(TempStruct).owner)
    endfunction

    private function Spell_Check takes nothing returns boolean
        return GetSpellAbilityId() == ABIL_ID
    endfunction

    private function Deal_Damage takes nothing returns nothing
        call UnitDamageTarget(Dam(TempStruct).caster, GetEnumUnit(), Damage(), true, false, ATTACK_TYPE, DAMAGE_TYPE, WEAPON_TYPE)
        call DestroyEffect(AddSpecialEffectTarget(DMG_EFFECT, GetEnumUnit(), ATTACH_POINT2))
    endfunction

private function Damage_Period takes nothing returns boolean
    local Dam dd = KT_GetData()
    local boolean b
    set dd.tick = dd.tick - DAMAGE_PERIOD
    call BJDebugMsg(R2S(dd.tick))
    
    if dd.tick &gt; 0. then
        set TempStruct = dd
        call GroupEnumUnitsInRange(g, dd.x, dd.y, Range(),Filterz)
        
        if FirstOfGroup(g) != null then
            call ForGroup(g,function Deal_Damage)
        endif
        
        set b = false
    else
        set b = true
        call dd.destroy()
    endif
    
    return b
endfunction

private function Descaling takes nothing returns boolean
    local Data d = KT_GetData()
    local boolean b
    
    if d.scale &gt; 1. then
        set d.scale = d.scale - 0.05
        call SetUnitScale(d.caster, d.scale, d.scale, d.scale)
        set b = false
    else
        set b = true
    endif
    
    return b
endfunction

private function Scaling takes nothing returns boolean
    local Data d = KT_GetData()
    local boolean b
    
    if d.scale &lt; SCALE then
        set d.scale = d.scale + 0.05
        call SetUnitScale(d.caster, d.scale, d.scale, d.scale)        
        set b = false
    else
        set b = true
    endif
    
    return b
endfunction

private function Movement takes nothing returns boolean
    local Data d = KT_GetData()
    local Dam dd = TempStruct
    local boolean b
    
    if d.on == true then
        set dd.caster = d.caster
        set dd.x = GetUnitX(d.caster)
        set dd.y = GetUnitY(d.caster)
        set d.angle = GetUnitFacing(d.caster)
        set d.x = d.origX - dd.x
        set d.y = d.origY - dd.y
        
        if (d.x * d.x + d.y * d.y) &gt; 20. and EXTRA_MOVEMENT == true then
            set d.x = dd.x + EXTRA_MOVE_SPEED * Cos(d.angle * 0.0175)
            set d.y = dd.y + EXTRA_MOVE_SPEED * Sin(d.angle * 0.0175)
            call SetUnitX(d.caster,d.x)
            call SetUnitY(d.caster,d.y)
            set d.origX = d.x
            set d.origY = d.y
       endif
       
        set b = false
    else
        set b = true
    endif
    
    return b
endfunction

private function Knockback takes nothing returns nothing
    local unit u = GetEnumUnit()
    local real angle = 57.2958 * Atan2(GetUnitY(u) - GetUnitY(Data(TempStruct).caster), GetUnitX(u) - GetUnitX(Data(TempStruct).caster)) - GetUnitFacing(Data(TempStruct).caster)
    call BJDebugMsg(R2S(angle))
    
    if KBS_IsUnitSliding(u) == false and Filters_Enum() then

        if angle &gt;= 25. then
            set angle = GetUnitFacing(Data(TempStruct).caster) - 25.
            call KBS_BeginCommon(u,DISTANCE,SPEED,angle)
        
        elseif angle &lt;= 335. then
            set angle = GetUnitFacing(Data(TempStruct).caster) + 25.
            call KBS_BeginCommon(u,DISTANCE,SPEED,angle)
        endif
    endif
    
    set u = null
endfunction

private function Periodic takes nothing returns boolean
    local Data d = KT_GetData()
    local Dam dd
    local boolean b
    
    if d.time &lt;= DURATION - PERIOD then
        set d.time = d.time + PERIOD
        set dd = Dam.create()
        set dd.d = d
        set dd.tick = R2I(EFFECT_DURATION / DAMAGE_PERIOD)
        set dd.caster = d.caster
        set dd.owner = d.owner
        set dd.x = GetUnitX(d.caster)
        set dd.y = GetUnitY(d.caster)
        call KT_Add(function Damage_Period, dd, DAMAGE_PERIOD)
        call DestroyEffectTimed(AddSpecialEffect(EFFECT_1,dd.x,dd.y), EFFECT_DURATION)
        set d.angle = GetUnitFacing(d.caster)
        set TempStruct = d
        
        if KNOCKBACK == true then
            set TempStruct = d
            call GroupEnumUnitsInRange(gr, GetUnitX(d.caster), GetUnitY(d.caster), Range_Big(), Filterz)
            call ForGroup(gr, function Knockback)
            call GroupClear(gr)
        endif
        
        set b = false
    else
        call d.destroy()
        
        if SCALE != 1. then 
            call KT_Add(function Descaling, d, MOVE_PERIOD)
        endif
        
        set b = true
    endif
    
    return b
endfunction

private function Spell takes nothing returns nothing
    local Data D = Data.create(GetTriggerUnit())
    call SetUnitPathing(D.caster,false)
    call SetUnitVertexColor(D.caster,255,255,255,R2I(TRANSPARENCY * 2.55))
    call UnitAddAbility(D.caster, CARGO_ID)
    call SetPlayerAbilityAvailable(D.owner, ABIL_ID, false)
    
    if EXTRA_MOVEMENT == false then
        call SetUnitMoveSpeed(D.caster, MOVE_SPEED)
    else
        call KT_Add(function Movement,D, MOVE_PERIOD)
    endif
    
    call KT_Add(function Periodic, D, PERIOD)
    
    if SCALE != 1. then 
        call KT_Add(function Scaling, D, MOVE_PERIOD)
    endif
    
endfunction

private function init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition (function Spell_Check))
    call TriggerAddAction(t, function Spell)
    set Filterz = Filter(function Filters)
endfunction
endscope


(Haven't implemented my systems yet, but I'm thinking of a complete rewrite ? :eek:)


EDIT3: Ok, so it looks like this now...

JASS:
library SmoothUnitMod requires T32, UnitAppearance

///////////////////////////////////////////////////////////////////////////////////////////////////////
//***************************************************************************************************//
//@@//////////////////////////////// *//SmoothUnitModification\\* /////////////////////////////////@@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%            @@//
//@@           %%                                                                    %%            @@//
//@@           %%        /////////     ///          \\\   ///\\\            ///\\\   %%            @@//
//@@           %%      /////    ////   ///          \\\   ///\\\            ///\\\   %%            @@//
//@@           %%     /////            ///          \\\   /// \\\          /// \\\   %%            @@//
//@@           %%    /////             ///          \\\   /// \\\          /// \\\   %%            @@//
//@@           %%     /////            ///          \\\   ///  \\\        ///  \\\   %%            @@//
//@@           %%      /////           ///          \\\   ///  \\\        ///  \\\   %%            @@//
//@@           %%       ////\\\\       ///          \\\   ///   \\\      ///   \\\   %%            @@//
//@@           %%           \\\\\      ////        \\\\   ///   \\\      ///   \\\   %%            @@//
//@@           %%            \\\\\     ////        \\\\   ///    \\\    ///    \\\   %%            @@//
//@@           %%              \\\\    ////        \\\\   ///    \\\    ///    \\\   %%            @@//
//@@           %%            \\\\\      ////      \\\\    ///     \\\  ///     \\\   %%            @@//
//@@           %%   \\\\    \\\\\        ////    \\\\     ///     \\\  ///     \\\   %%            @@//
//@@           %%      \\\\\\\\             ///\\\        ///      \\\///      \\\   %%            @@//
//@@           %%                                                                    %%            @@//
//@@           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%            @@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@                                    Made by , Komaqtion                                        @@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@                                          Purpose:                                             @@//
//@@                                                                                               @@//
//@@             ¤ This is a system, which will give the user the opportunity to easily modify     @@//
//@@               3 main aspects of units: Scale, ARGB color and Time Scale (Animation Speed).    @@//
//@@                                                                                               @@//
//@@                                           Usage:                                              @@//
//@@                                                                                               @@//
//@@             ¤ The function that this system provides the user are:                            @@//
//@@                                                                                               @@//
//@@             function ScaleSimple takes unit Scaler, real Time, real scaleMod                  @@//
//@@             function ScaleEx takes unit Scaler, real Time, real scaleMod, code userFunc       @@//
//@@                                                                                               @@//
//@@               &quot;Scaler&quot; is the unit which is to be scaled.                                     @@//
//@@               &quot;Time&quot; is basically, over how long time will the unit scale...                  @@//
//@@               &quot;scaleMod&quot; is how much the unit&#039;s scale will change, example:                   @@//
//@@               &quot;userFunc&quot; is the callback, if wanted, the system will execute                  @@//
//@@               when the scaling is done.                                                       @@//
//@@               Example:                                                                        @@//
//@@                                                                                               @@//
//@@               call ScaleSimple( GetTriggerUnit(), 2.0, 0.5 )                                  @@//
//@@                                                                                               @@//
//@@               Will scale the unit to +50% over 2 seconds.                                     @@//
//@@               And, also the modification is in decimal form, meaning that 1.0 will            @@//
//@@               double the unit&#039;s size...                                                       @@//
//@@                                                                                               @@//
//@@               The timescale part of this system is basically the same as this, and uses       @@//
//@@               the same amount of &quot;takes&quot;...                                                   @@//
//@@                                                                                               @@//
//@@               The fade part, on the other hand, has more &quot;takes&quot;, simply because it handles   @@//
//@@               the red, green and blue colors too, and not only transparency...                @@//
//@@               An example:                                                                     @@//
//@@                                                                                               @@//
//@@               call FadeEX( GetTriggerUnit(), 2.0, 0.0, -255.0, -255.0, -127.5 )               @@//
//@@                                                                                               @@//
//@@               This little sample will make the unit 50% transparent, and also RED.            @@//
//@@               And all the arguments here ranges from 0.0 - 255.0, meaning that a 50%          @@//
//@@               transparent unit has an alpha value of 127.5...                                 @@//
//@@                                                                                               @@//
//@@               You can also use this system to &quot;get&quot; any of the values you can change with     @@//
//@@               it, using functions like this:                                                  @@//
//@@                                                                                               @@//
//@@               function GetUnitScale takes unit u returns real                                 @@//
//@@                                                                                               @@//
//@@               Which will give you the current scale of the unit...                            @@//
//@@                                                                                               @@//
//@@                                           Note:                                               @@//
//@@                                                                                               @@//
//@@             ¤ This system does not support pre-changed RGB colors from the Object Editor,     @@//
//@@               and I&#039;d suggest you manually change the color of the units in-game instead.     @@//
//@@                                                                                               @@//
//@@                                       Requirements:                                           @@//
//@@                                                                                               @@//
//@@             ¤ A vJASS preprocessor, which is easiest found by downloading JASS Newgen Pack    @@//
//@@               <a href="http://www.thehelper.net/forums/showthread.php?t=73936" class="link link--internal">http://www.thehelper.net/forums/showthread.php?t=73936</a>                          @@//
//@@               You&#039;ll also have to update JASS Helper to the latest version...                 @@//
//@@               And, then you&#039;ll need the system called Timer32 (T32), and also my other        @@//
//@@               system, called &quot;UnitAppearance&quot; <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                              @@//
//@@                                                                                               @@//
//@@                                         Credits:                                              @@//
//@@                                                                                               @@//
//@@             ¤ Viikuna, for helpong me out alot with several bugfixes and tweaking !           @@//
//@@               Jesus4Lyf, for also helping me out alot ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                    @@//
//@@               Azlier, for some help too <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                                    @@//
//@@                                                                                               @@//
//@@               And credits, if you use this that is, is not needed to give me                  @@//
//@@               though it&#039;s always welcome <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink    ;)" loading="lazy" data-shortname=";)" />                                                   @@//
//@@                                                                                               @@//
//@@///////////////////////////////////////////////////////////////////////////////////////////////@@//
//***************************************************************************************************//
///////////////////////////////////////////////////////////////////////////////////////////////////////

    struct SmoothScaleChange
    
        //private code userFunc
        private integer ticks
        
        private real increment
        
        private unit u
        
        private method periodic takes nothing returns boolean
            set this.ticks = this.ticks - 1
        
            call ModifyUnitScale( this.u, this.increment )
            
            debug call BJDebugMsg( R2S( Appearance[ this.u ].scale ) )
            
            if this.ticks &lt;= 0 then
                call this.destroy()
                
                return true
            endif
            
            return false
        endmethod
        
        implement T32
        
        static method create takes unit Scaler, real Time, real scaleMod/*, code userFunc*/ returns thistype
            local thistype this = thistype.allocate()
            
            set this.u = Scaler
            //set this.userFunc = userFunc
            set this.increment = ( ( scaleMod * T32_PERIOD ) / Time )
            set this.ticks = R2I( scaleMod / this.increment ) // How many times the timer must fire...
            
            call this.startPeriodic()
            
            return this
        endmethod
        
    endstruct
    
    function ScaleSimple takes unit Scaler, real Time, real scaleMod returns SmoothScaleChange
        return SmoothScaleChange.create( Scaler, Time, scaleMod/*, null*/ )
    endfunction
    
    function ScaleEx takes unit Scaler, real Time, real scaleMod/*, code userFunc*/ returns SmoothScaleChange
        return SmoothScaleChange.create( Scaler, Time, scaleMod/*, userFunc*/ )
    endfunction
    
    function GetUnitScale takes unit u returns real
        return Appearance[ u ].scale
    endfunction
    
    struct SmoothColorChange
    
        private integer ticks
        
        private real rincrement
        private real gincrement
        private real bincrement
        private real increment
        
        private unit u
        
        private method periodic takes nothing returns boolean
            set this.ticks = this.ticks - 1
        
            call ModifyUnitVertexColor( this.u, R2I( this.rincrement ), R2I( this.gincrement ), R2I( this.bincrement ), R2I( this.increment ) )
            
            debug call BJDebugMsg( R2S( Appearance[this.u].alpha ) )
            
            if this.ticks &lt;= 0 then
                call this.destroy()
                
                return true
            endif
            
            return false
        endmethod
        
        implement T32
        
        static method create takes unit Fader, real Time, real redMod, real greenMod, real blueMod, real alphaMod returns thistype
            local thistype this = thistype.allocate()
            
            set this.u = Fader
            set this.increment = ( ( alphaMod * T32_PERIOD ) / Time )
            set this.rincrement = ( ( redMod * T32_PERIOD ) / Time )
            set this.gincrement = ( ( greenMod * T32_PERIOD ) / Time )
            set this.bincrement = ( ( blueMod * T32_PERIOD ) / Time )
            set this.ticks = R2I( alphaMod / this.increment )
            
            call this.startPeriodic()
            
            return this
        endmethod
        
    endstruct
    
    function FadeSimple takes unit Fader, real Time, real alphaMod returns SmoothColorChange
        return SmoothColorChange.create( Fader, Time, 0., 0., 0., alphaMod )
    endfunction
    
    function FadeEx takes unit Fader, real Time, real redMod, real greenMod, real blueMod, real alphaMod returns SmoothColorChange
        return SmoothColorChange.create( Fader, Time, redMod, greenMod, blueMod, alphaMod )
    endfunction
    
    function GetUnitAlpha takes unit u returns integer
        return Appearance[ u ].alpha
    endfunction

    function GetUnitRedColor takes unit u returns integer
        return Appearance[ u ].red
    endfunction
    
    function GetUnitGreenColor takes unit u returns integer
        return Appearance[ u ].green
    endfunction
    
    function GetUnitBlueColor takes unit u returns integer
        return Appearance[ u ].blue
    endfunction
    
    struct SmoothTSChange
    
        //private code userFunc
        private integer ticks
        
        private real increment
        
        private unit u
        
        private method periodic takes nothing returns boolean
            set this.ticks = this.ticks - 1
        
            call ModifyUnitTimeScale( this.u, this.increment )
            
            debug call BJDebugMsg( R2S( Appearance[ this.u ].timescale ) )
            
            if this.ticks &lt;= 0 then
                call this.destroy()
                
                return true
            endif
            
            return false
        endmethod
        
        implement T32
        
        static method create takes unit Timer, real Time, real timescaleMod/*, code userFunc*/ returns thistype
            local thistype this = thistype.allocate()
            
            set this.u = Timer
            //set this.userFunc = userFunc
            set this.increment = ( ( timescaleMod * T32_PERIOD ) / Time )
            set this.ticks = R2I( timescaleMod / this.increment ) // How many times the timer must fire...
            
            call this.startPeriodic()
            
            return this
        endmethod
        
    endstruct
    
    function TimeScaleChange takes unit Timer, real Time, real timescaleMod returns SmoothTSChange
        return SmoothTSChange.create( Timer, Time, timescaleMod/*, null*/ )
    endfunction
    
    function TimeScaleChangeEx takes unit Timer, real Time, real timescaleMod/*, code userFunc*/ returns SmoothTSChange
        return SmoothTSChange.create( Timer, Time, timescaleMod/*, userFunc*/ )
    endfunction
    
    function GetUnitTimeScale takes unit u returns real
        return Appearance[ u ].timescale
    endfunction

endlibrary


Is the doc ok ? :S

And, I just remembered that I never got an answer to how to add a callback to it :(

Is it possible, and/or is it a useless feature ? :S
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Bump !!! :D

Sorry for that very long last post, but that's basically what I need to submit this, so please try to answer it :D:D:D
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
And, I just remembered that I never got an answer to how to add a callback to it
Use TriggerExecute or TriggerEvaluate. :D
But adding this will slow down the library. Don't add it IMO.

How about adding stop function?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Ok, then... Won't add it :D

And, yeah sure I can add a stop function, but I don't really understand why :S If you want to add 0.5 to a unit's scale, why stop it ? :S

EDIT: Btw, how would I go about doing the "stop" stuff ? :S
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I'd find real scaleMod, real Time more intuitive, but that's just me.

Hehe, well I just started writing it my way, and now all the three has it like that, so probably won't change it :p

You're intending to submit this, right? Lol.

Of course XD :p

Ok, then... I'll submit it now then :D

EDIT: Oh, wait... What about the test map stuff ? :S
As I said, I only have some lame +0.5 scale and such :(

But, anyways... I'll submit it with those for now, and I/you can come up with something later :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top