Snippet CastText

Nerfpl

New Member
Reaction score
53
Cast Text

As future traning in JASS i created simple "spell"
I know its usless for maps basicly but... but nothing, i like it, it was fun to make.

Descryption: Create Text from bunch of dummy units. Text can be modified by simply typing other thing.

It works as "system" so you should put it in map Custom script place, and then just call it with function like in example.
Currently only based on dummy unit, because i didnt want to play with MUI. (now it is MUI because unit lifetime)

To use in GUI:
Custom Script:call CreatePixelText(TEXT, LOCATION, LIFETIME, DENSITY, SCALE, UNIT (RAWCODE))
better example in map
CastText.jpg

CODE: (for your own risk)
JASS:
///////////////////////////////////////////////////////////
// Simple Cast text function                                        
// Author: <a href="mailto:[email protected]">[email protected]</a>                                        
//                                                                
// -Only CAPITAL letters at the moment                           
// -Also few symbols dont work. &quot;\&quot; &quot;&quot;&quot; &quot;&#039;&quot; &quot;$&quot;                 
// -Each scale and density give basicly diffrent effect
// loc i location to start from. upper right corner of text box
// life is lifetime of text                                 
// den is Density(spacing)                                   
// scale is scale of used unit. (should go up with density) 
// integer dummy should be in raw code like &#039;e000&#039;         
////////////////////////////////////////////////////////////


function CreatePixelText takes string text, location loc, real life, real den, real scale, integer dummy returns nothing
    local location loc2 = loc
    local integer loop1s = 1
    local integer loop1e = 7
    local integer loop2s
    local integer loop2e
    local location textloc
    local integer x1 = 1
    local integer x2 = StringLength(text)
    local integer i
    local unit array blank
    local integer u1 = 1
    local integer u2 = 49
    loop
        exitwhen x1 &gt; x2
        set loop1s = 1
        set i = 1
            loop
                exitwhen loop1s &gt; loop1e
                set loop2s = 1
                set loop2e = 7
                    loop
                        exitwhen loop2s &gt; loop2e
                        set textloc = Location( GetLocationX(loc2) + loop1s * den, GetLocationY(loc2) - loop2s * den)
                        set blank<i> = CreateUnitAtLoc(Player(15), dummy, textloc, 270.00)
                        call UnitApplyTimedLife(blank<i>, &#039;BTLF&#039;, life)
                        call SetUnitScale(blank<i>, scale,scale,scale)
                        set i = i + 1
                        call RemoveLocation(textloc)
                        set textloc = null
                        //call BJDebugMsg(&quot;loop1s:&quot;+I2S(loop2s))
                        set loop2s = loop2s + 1
                    endloop
                //call BJDebugMsg(&quot;loop1s:&quot;+I2S(loop1s))
                set loop1s = loop1s + 1
            endloop
        //Empty grid to create symbols
        if SubString(text,x1-1,x1)==&quot;A&quot; then
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;B&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[40])
        elseif SubString(text,x1-1,x1)==&quot;C&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;D&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        elseif SubString(text,x1-1,x1)==&quot;E&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;F&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[37])
        elseif SubString(text,x1-1,x1)==&quot;G&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;H&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;I&quot; then
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        elseif SubString(text,x1-1,x1)==&quot;J&quot; then
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        elseif SubString(text,x1-1,x1)==&quot;K&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[34])
        elseif SubString(text,x1-1,x1)==&quot;L&quot; then
        // L looks dumb
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;M&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;N&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;O&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;P&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        elseif SubString(text,x1-1,x1)==&quot;Q&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;R&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;S&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;T&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[37])
        elseif SubString(text,x1-1,x1)==&quot;U&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;W&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;X&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;Y&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[37])
        elseif SubString(text,x1-1,x1)==&quot;Z&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;.&quot; then
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[34])
        elseif SubString(text,x1-1,x1)==&quot;:&quot; then
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[34])
        elseif SubString(text,x1-1,x1)==&quot;&#039;&quot; then
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        elseif SubString(text,x1-1,x1)==&quot; &quot; then
        elseif SubString(text,x1-1,x1)==&quot;/&quot; then
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[37])
        elseif SubString(text,x1-1,x1)==&quot;!&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[13])
        elseif SubString(text,x1-1,x1)==&quot;?&quot; then
        //that sux too becaue its ugly
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        elseif SubString(text,x1-1,x1)==&quot;@&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;#&quot; then
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[40])
        elseif SubString(text,x1-1,x1)==&quot;$&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;%&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;^&quot; then
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[39])
        elseif SubString(text,x1-1,x1)==&quot;&amp;&quot; then
        //Fuck thats hard...
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;*&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;(&quot; then
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[34])
        elseif SubString(text,x1-1,x1)==&quot;)&quot; then
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        elseif SubString(text,x1-1,x1)==&quot;-&quot; then
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[32])
        elseif SubString(text,x1-1,x1)==&quot;_&quot; then
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;+&quot; then
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[32])
        elseif SubString(text,x1-1,x1)==&quot;=&quot; then
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[33])
        elseif SubString(text,x1-1,x1)==&quot;|&quot; then
        // same as &quot;I&quot;
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        elseif SubString(text,x1-1,x1)==&quot;[&quot; then
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[34])
        elseif SubString(text,x1-1,x1)==&quot;]&quot; then
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        elseif SubString(text,x1-1,x1)==&quot;}&quot; then
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[32])
        elseif SubString(text,x1-1,x1)==&quot;{&quot; then
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[34])
        elseif SubString(text,x1-1,x1)==&quot;1&quot; then
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        elseif SubString(text,x1-1,x1)==&quot;2&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;3&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;4&quot; then
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[24])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[26])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[32])
        elseif SubString(text,x1-1,x1)==&quot;5&quot; then
        //same as &quot;S&quot;
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;6&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;7&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[37])
        elseif SubString(text,x1-1,x1)==&quot;8&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[12])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;9&quot; then
        call RemoveUnit(blank[9])
        call RemoveUnit(blank[10])
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[13])
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[25])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[34])
        call RemoveUnit(blank[37])
        call RemoveUnit(blank[38])
        call RemoveUnit(blank[39])
        call RemoveUnit(blank[40])
        call RemoveUnit(blank[41])
        elseif SubString(text,x1-1,x1)==&quot;0&quot; then
        call RemoveUnit(blank[16])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[18])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[20])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[30])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[32])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[34])
        elseif SubString(text,x1-1,x1)==&quot;&lt;&quot; then
        call RemoveUnit(blank[11])
        call RemoveUnit(blank[17])
        call RemoveUnit(blank[19])
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[27])
        elseif SubString(text,x1-1,x1)==&quot;&gt;&quot; then
        call RemoveUnit(blank[23])
        call RemoveUnit(blank[27])
        call RemoveUnit(blank[31])
        call RemoveUnit(blank[33])
        call RemoveUnit(blank[39])
        endif
        // here it will remove last column if symbol is not last, so it give less space and dont put first column at last column
        if x1 &gt;= 1 then
            if x1 != x2 then
                call RemoveUnit(blank[43])
                call RemoveUnit(blank[44])
                call RemoveUnit(blank[45])
                call RemoveUnit(blank[46])
                call RemoveUnit(blank[47])
                call RemoveUnit(blank[48])
                call RemoveUnit(blank[49])
            endif
        endif
        set u1 = 1
        loop
            exitwhen u1 &gt; u2
            set blank[u1] = null
            set u1 = u1 + 1
        endloop
    set loc2 = Location(GetLocationX(loc2) + (den * 6), GetLocationY(loc2))
    //call BJDebugMsg(&quot;loop1s:&quot;+I2S(x1))
    set x1 = x1 + 1
    endloop
    call RemoveLocation(loc2)
    set loc2 = null
endfunction </i></i></i>


If you want edit symbols thats the grid: ( But you should write it on paper)
Code:
1 8  15 22 29 36 43
2 9  16 23 30 37 44
3 10 17 24 31 38 45
4 11 18 25 32 39 46
5 12 19 26 33 40 47
6 13 20 27 34 41 48
7 14 21 28 35 42 49
 

Attachments

  • Cast Text.w3x
    19.7 KB · Views: 189

Flare

Stops copies me!
Reaction score
662
Can't see this being the most useful thing to people, but it does look pretty cool :p

JASS:
local location loc2 = loc

Just use loc, instead of declaring another variable that points to it?

JASS:
call RemoveLocation(loc)

What if someone still needs to use the taken location after calling the function? Parameters that are capable of being destroyed shouldn't be destroyed by the function. If it leaks, the end-user should set it in a variable, use it, and destroy it later when they no longer have use of the location e.g.
JASS:
local location l = Location (100, 50)
call CreatePixelText (&quot;hello&quot;, l, ...)
//And now...
call CreateUnitAtLoc (whichPlayer, unitId, l, bj_UNIT_FACING)

The CreateUnitAtLoc line will screw up, since you've destroyed the location we were going to use

ALso, an explanation of what each parameter does would be great - where is loc with respect to the text displayed, what exactly does den do, and so on. Most people won't bother reading through the script (or won't be able to), so how are they expected to know how each parameter affects the function


Also, thread tag has been changed to [Snippet]
 

Nerfpl

New Member
Reaction score
53
ok added notes and fixed loc thingy :)

btw i know its not useful
its because i thought when it takes loc it create own local. so string shouldnt be nulled too then
 

quraji

zap
Reaction score
144
Seems to work fine..
LOLBOOBS.jpg


Although the code itself is scary..there are other ways to do this :p

>its because i thought when it takes loc it create own local. so string shouldnt be nulled too then

Yes you have your own variable but it points to the same location. When you RemoveLocation(loc) you aren't removing loc..you're removing the location pointed to by loc. Don't destroy function arguments, the user may need them.
 

Nerfpl

New Member
Reaction score
53
code looks scarry when the IFs start :)
but i thought alot and i found this most easy to edit symbols after all.
 

Exide

I am amazingly focused right now!
Reaction score
448
This is really nice. ^^

You should create a trigger to invert the text, though. (Now it's a square of dots with missing dots to show text. I want it to be dots to form the text, and missing dots around.)
Sort of like if you have a paper and paint it almost all black, except for the part where the words are, which you leave white. -Do it the other way around. :p
 

Romek

Super Moderator
Reaction score
964
Could you fix the indentation please? It's quite ugly, and is quote confusing to read.

Also, you can use the StringCase(string, true) function to make 'string' capital.
For example:
JASS:
set s = StringCase(&quot;HeLlO WoRlD&quot;, true)

Will make s == "HELLO WORLD"

Can be used to remove the "Only caps limitation. At least until you implement small letters. :))

Oh, and I should mention that "RemoveUnit()" can actually cause bugs.
A real shame for a snippet like this that uses it a lot.

Use call ShowUnit(u, false); call KillUnit(u) instead.
 

Nerfpl

New Member
Reaction score
53
Im glad you like it. I will update when i get sick of my RPG creating ^^

Also added Grid under image if any1 want to edit symbols lol gl
 

Romek

Super Moderator
Reaction score
964
> Which ones?
I heard it can cause handle stack corruption.
Actually, I've heard it many times from many people.
 

Romek

Super Moderator
Reaction score
964
> It'll be extremely hard to corrupt the stack without casting from integer to handle.
But we don't know whether the map this will be implemented into will do exactly that.

Some maps still use Ancient Handle Vars.
 

Tom Jones

N/A
Reaction score
437
> It'll be extremely hard to corrupt the stack without casting from integer to handle.
But we don't know whether the map this will be implemented into will do exactly that.

Some maps still use Ancient Handle Vars.
I agree, but that's not the issue at hand here. If you "miscast" a integer to a handle, it doesn't really matter what function you use to destroy that handle with:
JASS:
function H2I takes handle h returns integer
    return h
    return 0
endfunction

function I2Vfx takes integer i returns effect
    return i
    return null
endfunction

function Test takes nothing returns nothing
    local timer t = CreateTimer()
    local effect vfx = I2Vfx(H2I(t))
    
    call DestroyEffect(vfx)
    call DestroyTimer(t)
    set t = null
    set vfx = null
endfunction
It saves just fine, but it's oh so wrong.

*Edit*
My point is, we can't account for user stupidity.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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