HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AttachVars and texttag

06-29-2007, 03:09 PM#1
Fire-Dragon-DoL
In the documentation of CasterSystem.j is written that you cannot attach any attachVar to a texttag....

is possible the opposite?I mean...is possible to attach a texttag to a unit?should i use AttachObject?

thanks for reading :)

EDIT: I've created this script,however it looks like i can't attacha texttag...any way to do it?:/

Collapse JASS:
function ON_SpellCast_Actions takes nothing returns nothing//SFH
    //Crea la barra con un floating text sulla testa dell'unità
    //Consenti lo stop del cast con ESC (anche su più unità)
    //Effettua il cast, checkando se channeling o cose simili
    //Esegue la funzione dello spell
    //Testare se OBJECT può contenere Texttag per creare la cast bar sulla testa dell'unità
    local texttag myCastbar = CreateTextTag()
    local force gp = EmptyForce()
    local string s = "l l l l l l l l l l"
    call ForceAddPlayer(gp,GetOwningPlayer(GetSpellAbilityUnit()))
    call ShowTextTagForceBJ(false,myCastbar,GetPlayersAll())
    call SetTextTagText(myCastbar,s,TextTagSize2Height(10.00))    
    call SetTextTagPosUnit(myCastbar,GetSpellAbilityUnit(),0.00)
    call SetTextTagColor(myCastbar,255,255,255,255)
    call SetTextTagVelocityBJ(myCastbar,0,0)
    call SetTextTagPermanent(myCastbar,true)
    call ShowTextTagForceBJ(true,myCastbar,gp)
    call AttachObject(GetSpellAbilityUnit(),"Cast_Bar",myCastbar)
    call PolledWait(2.00)    
    //call SetTextTagText(GetAttachedObject(GetSpellAbilityUnit(),"Cast_Bar"),"test string",TextTagSize2Height(10.00))
    call AttachObject(GetSpellAbilityUnit(),"Cast_Bar",null)
    set myCastbar = null
    set gp = null
    set s = null
endfunction
06-29-2007, 03:40 PM#2
Vexorian
what makes you think you can't? What looks like it can't attach texttag?
06-29-2007, 11:03 PM#3
Fire-Dragon-DoL
Quote:
Originally Posted by Vexorian
what makes you think you can't? What looks like it can't attach texttag?

'cos you haven't created the function AttachTexttags...however i'm trying with Object...i'll see if it works

EDIT: ok it works with them (it tooks me over one hour to make it works because i had a bugged version of attach vars-.- WTF!)

EDIT 2:An easy question: i would like to implement only the AttachVars(and tables and attacharrayvars) in my map and not the whole cast system...i've copied the script inside the trigger CSCache and CSSafety and nothing more...i hope i didn't copy something that i don't want :O)....is possible to dowload something "standalone" without the whole castersystem?

and another thing...where can i find some good special-effects function? (only special effects with parameters, nothing more!)...those are the only things that i need for my map...because the remaining things are going to be scripted by me...but special-effects are boring (a lot of math) to script and i'm not too expert to re-create attachvars alone :)
06-30-2007, 12:48 AM#4
Vexorian
you are most likely using a very old version of the caster system map, in the new ones you can simply copy CSCache 's trigger to a map
06-30-2007, 10:58 AM#5
Fire-Dragon-DoL
Quote:
Originally Posted by Vexorian
you are most likely using a very old version of the caster system map, in the new ones you can simply copy CSCache 's trigger to a map

yeah you are right, infact i've downloaded the latest yesterday night and my trigger works :O

however...should i copy CSSafety too?(There is a trigger called with this name in your map), if i understand what it does, it helps to refresh gamecache for attachvars...am i wrong?
06-30-2007, 02:02 PM#6
Vexorian
Quote:
it helps to refresh gamecache for attachvars...am i wrong?
Yes, you are wrong.
06-30-2007, 02:53 PM#7
Ammorth
CSSafety is composed of a timer stack which can be used to prevent the need to null timers, which can cause handle corruption.
06-30-2007, 03:33 PM#8
Fire-Dragon-DoL
Quote:
Originally Posted by Ammorth
CSSafety is composed of a timer stack which can be used to prevent the need to null timers, which can cause handle corruption.

ah! ok so i'll use it also if it's not necessary for gamechace...


thanks for everything!

are there any tutorial to learn how it works the gamecache? i hate using something that i don't understand