Snippet String2PlayerColoredString

Ok, so looks like this now.
I've added that "If" to only 1 function, should I add it to all which "takes" a player ? :eek:

I also added a slight update to the doc too ;)

JASS:
library PlayerColors initializer Init


///////////////////////////////////////////////////////////////////////////////////////////////////
//                                 *//PlayerColoredString\\*                                     //
//                                 *//Made by , Komaqtion\\*                                      //
//                                                                                               //
//                                                                                               //
//                                        Purpose:                                               //
//                                                                                               //
//             ¤ This snippet is supposed to help people to, with ease, convert                  //
//               a string to use a desired player's own color!                                   //
//                                                                                               //
//                                         Usage:                                                //
//                                                                                               //
//             ¤ To use this snippet, simply type "call PlayerColoredString(playerid, string)"   //
//               where "string" is the string you want to colorize, and "playerid"               //
//               is the player number of the player, whose color you wan to use.                 //
//               Note: This uses JASS' player number range, meaning that                         //
//               Player 1(Red)'s number is 0, and Player 2(Blue)'s number is 1,                  //
//               and so on...                                                                    //
//               You can also get only the players color-string for own usage...                 //
//               This is accomplished by using the function "GetPlayerColorString"               //
//               which takes the player to get the string, or you can also use                   //
//               the GetPlayerColorStringById function, which takes the player's                 //
//               Id, or number instead <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" />                                                        //
//               You can also change the color of texttags using this snippet...                 //
//               The function is called &quot;PlayerColoredTextTag&quot; and takes integer alpha           //
//               which is transparency, player p, the playercolor you which to use, and          //
//               texttag tag which is the texttag you which to change the color of !             //
//               You can also use the function &quot;GetPlayerByColor&quot; which takes a string (color)   //
//               and returns the player which has that specific color. You can even type         //
//               &quot;ReD&quot; or &quot;REd&quot; or even &quot;..,,  R, e.., d&quot; and it&#039;ll return Player(0) or          //
//               player red in all three cases. And, you can also get the player&#039;s color         //
//               this way.                                                                       //
//                                                                                               //
//               WARNING: If you put an invalid player as an argument, in any of the functions,  //
//               it WILL return Player( 0 ), or Player &quot;Red&quot; !                                   //
//                                                                                               //
//                                                                                               //
//                                    Requirements:                                              //
//                                                                                               //
//             ¤ This snippet&#039;s only requirement is vJASS compilement, which is                  //
//               easiest achieved by downloading JASS Newgen Pack, at                            //
//               <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...                 //
//                                                                                               //
//                                                                                               //
//                                        Credits:                                               //
//                                                                                               //
//             ¤ Azlier, 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" />                                    //
//               Quraji, for helping me add the &quot;GetPlayerByColor&quot; function ! <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=";)" />                                                   //
//                                                                                               //
///////////////////////////////////////////////////////////////////////////////////////////////////


    globals
        private integer array Red
        private integer array Green
        private integer array Blue
        private integer array RedString
        private integer array GreenString
        private integer array BlueString
        private string array PlayerColor
        private string array PlayerColorString
        private string array PlayerColorWord
        private string array PlayerColorWordString
        
        private constant string EndString = &quot;|r&quot;
    endglobals
    
    function PlayerColoredString takes integer playerId, string s returns string
        return PlayerColor[playerId] + s + EndString
    endfunction
    
    function PlayerColoredTextTag takes integer alpha, player p, texttag tag returns nothing
        if p == null then
            debug call BJDebugMsg( &quot;An invalid player was used!&quot; ) 
            return
        endif
        call SetTextTagColor( tag, Red[GetPlayerId( p )], Green[GetPlayerId( p )], Blue[GetPlayerId( p )], alpha )
    endfunction
    
    function PlayerColoredTextTagById takes integer alpha, integer playerId, texttag tag returns nothing
        call SetTextTagColor( tag, Red[playerId], Green[playerId], Blue[playerId], alpha )
    endfunction
    
    function GetPlayerColorString takes player p returns string
        return PlayerColor[GetPlayerId( p )]
    endfunction
    
    function GetPlayerColorStringById takes integer playerId returns string
        return PlayerColor[playerId]
    endfunction
    
    function CompressString takes string compstring returns string
        local integer w = StringLength( compstring )
        local integer i = 0
        local string s = &quot;&quot;
        
        loop
        
                if not( SubString( compstring, i, i + 1 ) == &quot; &quot; or SubString( compstring, i, i + 1 ) == &quot;.&quot; or SubString( compstring, i, i + 1 ) == &quot;,&quot; ) then
                    set s = s + SubString( compstring, i, i + 1 )
                endif
                
            set i = i + 1
            
        exitwhen i &gt; w
        endloop
        
        return s
    endfunction
    
    function GetPlayerByColor takes string color returns player
        local string s = StringCase( color, false )
        local integer i = 0
        
        set s = CompressString( s )
        
        loop 
        
            if s == PlayerColorWordString<i> then
                return Player( i )
            elseif s == PlayerColorWordString[13] then
                return Player( 8 )
            elseif s == PlayerColorWordString[14] or s == PlayerColorWordString[15] then
                return Player( 2 )
            endif
            
            set i = i + 1
            
        exitwhen ( i &gt;= 13 )
        endloop
        
        return null
    endfunction
    
    function GetPlayerColorByColor takes string color returns string
        local string s = StringCase( color, false )
        local integer i = 0
        
        set s = CompressString( s )
        
        loop 
        
            if s == PlayerColorWordString<i> then
                return PlayerColor<i>
            endif
            
            set i = i + 1
            exitwhen ( i &gt;= 13 )
        endloop
        
        if s == PlayerColorWordString[13] then
            return PlayerColor[8]
        elseif s == PlayerColorWordString[14] or s == PlayerColorWordString[15] then
            return PlayerColor[2]
        endif
        
        return &quot;&quot;
    endfunction
    
    private function OnColorChange takes player whichplayer, playercolor color returns nothing
        local integer id = GetPlayerId( whichplayer )
        local integer pc = GetHandleId( color )

        set PlayerColor[id] = PlayerColorString[pc]
        set Red[id] = RedString[pc]
        set Green[id] = GreenString[pc]
        set Blue[id] = BlueString[pc]
        set PlayerColorWord[id] = PlayerColorWordString[pc]
    endfunction
    
    hook SetPlayerColor OnColorChange
    
    private function Init takes nothing returns nothing
        local integer i = 12
        local integer i2
    
        set PlayerColorString[0] = &quot;|c00ff0202&quot;
        set RedString[0] = 0xff
        set GreenString[0] = 0x02
        set BlueString[0] = 0x02
        set PlayerColorWordString[0] = &quot;red&quot;
        set PlayerColorString[1] = &quot;|c000041ff&quot;
        set RedString[1] = 0x00
        set GreenString[1] = 0x41
        set BlueString[1] = 0xff
        set PlayerColorWordString[1] = &quot;blue&quot;
        set PlayerColorString[2] = &quot;|c001be5b8&quot;
        set RedString[2] = 0x1b
        set GreenString[2] = 0xe5
        set BlueString[2] = 0xb8
        set PlayerColorWordString[2] = &quot;teal&quot;
        set PlayerColorString[3] = &quot;|c00530080&quot;
        set RedString[3] = 0x53
        set GreenString[3] = 0x00
        set BlueString[3] = 0x80
        set PlayerColorWordString[3] = &quot;purple&quot;
        set PlayerColorString[4] = &quot;|c00fffc00&quot;
        set RedString[4] = 0xff
        set GreenString[4] = 0xfc
        set BlueString[4] = 0x00
        set PlayerColorWordString[4] = &quot;yellow&quot;
        set PlayerColorString[5] = &quot;|c00fe890d&quot;
        set RedString[5] = 0xfe
        set GreenString[5] = 0x89
        set BlueString[5] = 0x0d
        set PlayerColorWordString[5] = &quot;orange&quot;
        set PlayerColorString[6] = &quot;|c001fbf00&quot;
        set RedString[6] = 0x1f
        set GreenString[6] = 0xbf
        set BlueString[6] = 0x00
        set PlayerColorWordString[6] = &quot;green&quot;
        set PlayerColorString[7] = &quot;|c00e45aaf&quot;
        set RedString[7] = 0xe4
        set GreenString[7] = 0x5a
        set BlueString[7] = 0xaf
        set PlayerColorWordString[7] = &quot;pink&quot;
        set PlayerColorString[8] = &quot;|c00949596&quot;
        set RedString[8] = 0x94
        set GreenString[8] = 0x95
        set BlueString[8] = 0x96
        set PlayerColorWordString[8] = &quot;grey&quot;
        set PlayerColorString[9] = &quot;|c007dbef1&quot;
        set RedString[9] = 0x7d
        set GreenString[9] = 0xbe
        set BlueString[9] = 0xf1
        set PlayerColorWordString[9] = &quot;lightblue&quot;
        set PlayerColorString[10] = &quot;|c000f6145&quot;
        set RedString[10] = 0x0f
        set GreenString[10] = 0x61
        set BlueString[10] = 0x45
        set PlayerColorWordString[10] = &quot;darkgreen&quot;
        set PlayerColorString[11] = &quot;|c004d2903&quot;
        set RedString[11] = 0x4d
        set GreenString[11] = 0x29
        set BlueString[11] = 0x03
        set PlayerColorWordString[11] = &quot;brown&quot;

        set PlayerColorString[12] = &quot;|c001f1f1f&quot;
        set RedString[12] = 0x1f
        set GreenString[12] = 0x1f
        set BlueString[12] = 0x1f
        set PlayerColorWordString[12] = &quot;darkgrey&quot;
        
        set PlayerColorWordString[13] = &quot;gray&quot;
        set PlayerColorWordString[14] = &quot;aqua&quot;
        set PlayerColorWordString[15] = &quot;cyan&quot;
    
        loop
            exitwhen i &lt; 0
            set i2 = GetHandleId( GetPlayerColor( Player( i ) ) )
            set PlayerColor<i> = PlayerColorString[i2]
            set Red<i> = RedString[i2]
            set Green<i> = GreenString[i2]
            set Blue<i> = BlueString[i2]
            set PlayerColorWord<i> = PlayerColorWordString<i>
            set i = i - 1
        endloop
        
    endfunction
    
endlibrary</i></i></i></i></i></i></i></i></i>
 
Ok, so if none will object, may this get reviewed ? :eek:

Or is there anything you'd want me to add still ? :p
 
Ok, thanks :D

JASS:
library PlayerColors initializer Init


///////////////////////////////////////////////////////////////////////////////////////////////////
//                                 *//PlayerColoredString\\*                                     //
//                                 *//Made by , Komaqtion\\*                                     //
//                                                                                               //
//                                                                                               //
//                                        Purpose:                                               //
//                                                                                               //
//             ¤ This snippet is supposed to help people to, with ease, convert                  //
//               a string to use a desired player&#039;s own color!                                   //
//                                                                                               //
//                                         Usage:                                                //
//                                                                                               //
//             ¤ To use this snippet, simply type &quot;call PlayerColoredString(playerid, string)&quot;   //
//               where &quot;string&quot; is the string you want to colorize, and &quot;playerid&quot;               //
//               is the player number of the player, whose color you wan to use.                 //
//               Note: This uses JASS&#039; player number range, meaning that                         //
//               Player 1(Red)&#039;s number is 0, and Player 2(Blue)&#039;s number is 1,                  //
//               and so on...                                                                    //
//               You can also get only the players color-string for own usage...                 //
//               This is accomplished by using the function &quot;GetPlayerColorString&quot;               //
//               which takes the player to get the string, or you can also use                   //
//               the GetPlayerColorStringById function, which takes the player&#039;s                 //
//               Id, or number instead <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" />                                                        //
//               You can also change the color of texttags using this snippet...                 //
//               The function is called &quot;PlayerColoredTextTag&quot; and takes integer alpha           //
//               which is transparency, player p, the playercolor you which to use, and          //
//               texttag tag which is the texttag you which to change the color of !             //
//               You can also use the function &quot;GetPlayerByColor&quot; which takes a string (color)   //
//               and returns the player which has that specific color. You can even type         //
//               &quot;ReD&quot; or &quot;REd&quot; or even &quot;..,,  R, e.., d&quot; and it&#039;ll return Player(0) or          //
//               player red in all three cases. And, you can also get the player&#039;s color         //
//               this way.                                                                       //
//                                                                                               //
//               WARNING: If you put an invalid player as an argument, in any of the functions,  //
//               it WILL return Player( 0 ), or Player &quot;Red&quot; !                                   //
//                                                                                               //
//                                                                                               //
//                                    Requirements:                                              //
//                                                                                               //
//             ¤ This snippet&#039;s only requirement is vJASS compilement, which is                  //
//               easiest achieved by downloading JASS Newgen Pack, at                            //
//               <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...                 //
//                                                                                               //
//                                                                                               //
//                                        Credits:                                               //
//                                                                                               //
//             ¤ Azlier, 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" />                                    //
//               Quraji, for helping me add the &quot;GetPlayerByColor&quot; function ! <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=";)" />                                                   //
//                                                                                               //
///////////////////////////////////////////////////////////////////////////////////////////////////


    globals
        private integer array Red
        private integer array Green
        private integer array Blue
        private integer array RedString
        private integer array GreenString
        private integer array BlueString
        private string array PlayerColor
        private string array PlayerColorString
        private string array PlayerColorWord
        private string array PlayerColorWordString
        
        private constant string EndString = &quot;|r&quot;
    endglobals
    
    function PlayerColoredString takes integer playerId, string s returns string
        return PlayerColor[playerId] + s + EndString
    endfunction
    
    function PlayerColoredTextTag takes integer alpha, player p, texttag tag returns nothing
        if p == null then
            debug call BJDebugMsg( &quot;An invalid player was used!&quot; ) 
            return
        endif
        call SetTextTagColor( tag, Red[GetPlayerId( p )], Green[GetPlayerId( p )], Blue[GetPlayerId( p )], alpha )
    endfunction
    
    function PlayerColoredTextTagById takes integer alpha, integer playerId, texttag tag returns nothing
        call SetTextTagColor( tag, Red[playerId], Green[playerId], Blue[playerId], alpha )
    endfunction
    
    function GetPlayerColorString takes player p returns string
        return PlayerColor[GetPlayerId( p )]
    endfunction
    
    function GetPlayerColorStringById takes integer playerId returns string
        return PlayerColor[playerId]
    endfunction
    
    function CompressString takes string compstring returns string
        local integer w = StringLength( compstring )
        local integer i = 0
        local string s = &quot;&quot;
        
        loop
        
                if not( SubString( compstring, i, i + 1 ) == &quot; &quot; or SubString( compstring, i, i + 1 ) == &quot;.&quot; or SubString( compstring, i, i + 1 ) == &quot;,&quot; ) then
                    set s = s + SubString( compstring, i, i + 1 )
                endif
                
            set i = i + 1
            
        exitwhen i &gt; w
        endloop
        
        return s
    endfunction
    
    function GetPlayerByColor takes string s returns player
        local integer i = 0
        
        set s = StringCase( s, false )
        set s = CompressString( s )
        
        loop 
        
            if s == PlayerColorWordString<i> then
                return Player( i )
            elseif s == PlayerColorWordString[13] then
                return Player( 8 )
            elseif s == PlayerColorWordString[14] or s == PlayerColorWordString[15] then
                return Player( 2 )
            endif
            
            set i = i + 1
            
        exitwhen ( i &gt;= 13 )
        endloop
        
        return null
    endfunction
    
    function GetPlayerColorByColor takes string color returns string
        local string s = StringCase( color, false )
        local integer i = 0
        
        set s = CompressString( s )
        
        loop 
        
            if s == PlayerColorWordString<i> then
                return PlayerColor<i>
            endif
            
            set i = i + 1
            exitwhen ( i &gt;= 13 )
        endloop
        
        if s == PlayerColorWordString[13] then
            return PlayerColor[8]
        elseif s == PlayerColorWordString[14] or s == PlayerColorWordString[15] then
            return PlayerColor[2]
        endif
        
        return &quot;&quot;
    endfunction
    
    private function OnColorChange takes player whichplayer, playercolor color returns nothing
        local integer id = GetPlayerId( whichplayer )
        local integer pc = GetHandleId( color )

        set PlayerColor[id] = PlayerColorString[pc]
        set Red[id] = RedString[pc]
        set Green[id] = GreenString[pc]
        set Blue[id] = BlueString[pc]
        set PlayerColorWord[id] = PlayerColorWordString[pc]
    endfunction
    
    hook SetPlayerColor OnColorChange
    
    private function Init takes nothing returns nothing
        local integer i = 12
        local integer i2
    
        set PlayerColorString[0] = &quot;|c00ff0202&quot;
        set RedString[0] = 0xff
        set GreenString[0] = 0x02
        set BlueString[0] = 0x02
        set PlayerColorWordString[0] = &quot;red&quot;
        set PlayerColorString[1] = &quot;|c000041ff&quot;
        set RedString[1] = 0x00
        set GreenString[1] = 0x41
        set BlueString[1] = 0xff
        set PlayerColorWordString[1] = &quot;blue&quot;
        set PlayerColorString[2] = &quot;|c001be5b8&quot;
        set RedString[2] = 0x1b
        set GreenString[2] = 0xe5
        set BlueString[2] = 0xb8
        set PlayerColorWordString[2] = &quot;teal&quot;
        set PlayerColorString[3] = &quot;|c00530080&quot;
        set RedString[3] = 0x53
        set GreenString[3] = 0x00
        set BlueString[3] = 0x80
        set PlayerColorWordString[3] = &quot;purple&quot;
        set PlayerColorString[4] = &quot;|c00fffc00&quot;
        set RedString[4] = 0xff
        set GreenString[4] = 0xfc
        set BlueString[4] = 0x00
        set PlayerColorWordString[4] = &quot;yellow&quot;
        set PlayerColorString[5] = &quot;|c00fe890d&quot;
        set RedString[5] = 0xfe
        set GreenString[5] = 0x89
        set BlueString[5] = 0x0d
        set PlayerColorWordString[5] = &quot;orange&quot;
        set PlayerColorString[6] = &quot;|c001fbf00&quot;
        set RedString[6] = 0x1f
        set GreenString[6] = 0xbf
        set BlueString[6] = 0x00
        set PlayerColorWordString[6] = &quot;green&quot;
        set PlayerColorString[7] = &quot;|c00e45aaf&quot;
        set RedString[7] = 0xe4
        set GreenString[7] = 0x5a
        set BlueString[7] = 0xaf
        set PlayerColorWordString[7] = &quot;pink&quot;
        set PlayerColorString[8] = &quot;|c00949596&quot;
        set RedString[8] = 0x94
        set GreenString[8] = 0x95
        set BlueString[8] = 0x96
        set PlayerColorWordString[8] = &quot;grey&quot;
        set PlayerColorString[9] = &quot;|c007dbef1&quot;
        set RedString[9] = 0x7d
        set GreenString[9] = 0xbe
        set BlueString[9] = 0xf1
        set PlayerColorWordString[9] = &quot;lightblue&quot;
        set PlayerColorString[10] = &quot;|c000f6145&quot;
        set RedString[10] = 0x0f
        set GreenString[10] = 0x61
        set BlueString[10] = 0x45
        set PlayerColorWordString[10] = &quot;darkgreen&quot;
        set PlayerColorString[11] = &quot;|c004d2903&quot;
        set RedString[11] = 0x4d
        set GreenString[11] = 0x29
        set BlueString[11] = 0x03
        set PlayerColorWordString[11] = &quot;brown&quot;

        set PlayerColorString[12] = &quot;|c001f1f1f&quot;
        set RedString[12] = 0x1f
        set GreenString[12] = 0x1f
        set BlueString[12] = 0x1f
        set PlayerColorWordString[12] = &quot;darkgrey&quot;
        
        set PlayerColorWordString[13] = &quot;gray&quot;
        set PlayerColorWordString[14] = &quot;aqua&quot;
        set PlayerColorWordString[15] = &quot;cyan&quot;
    
        loop
            exitwhen i &lt; 0
            set i2 = GetHandleId( GetPlayerColor( Player( i ) ) )
            set PlayerColor<i> = PlayerColorString[i2]
            set Red<i> = RedString[i2]
            set Green<i> = GreenString[i2]
            set Blue<i> = BlueString[i2]
            set PlayerColorWord<i> = PlayerColorWordString<i>
            set i = i - 1
        endloop
        
    endfunction
    
endlibrary</i></i></i></i></i></i></i></i></i>
 
I'm probably stupid, but...


Why not just use a String Array?
 
Theres no need for the hook. playercolor is a "pseudohandle".
Theres no need for the CompressString function (what the hell does that thing have to do with coloring a string according to a players color?).
Alpha doesnt work for texttags.
ById versions are stupid.
And so is the GetPlayerByColor function.
 
Theres no need for the hook. playercolor is a "pseudohandle".

Well, this system doesn't use the default playercolors (And the colors here aren't the variable type "playercolor", but a string...).
This system uses the current color of the player you want, so that's why the hook is there ;)

Theres no need for the CompressString function (what the hell does that thing have to do with coloring a string according to a players color?).

Yes, there's a need for it, since if (For some wierd reason) you'd type "RE d", instead of plain "red", the system wouldn't work.
It's just for "Noob-safety" :p

Alpha doesnt work for texttags.

Really ? :S
Well, it doesn't really matter...

ById versions are stupid.

No it isn't !

And so is the GetPlayerByColor function.

And yet again, no !...
It's easier to type in the color you want, than to look up which player has that color, and then type that player instead...
It's just for versatility :D

Also, might this get reviewed sometime ? :S
 
I also found the ability to get the player from the color to have only one use.

I hate that "b L u spacespace e" becomes "blue". I would just spit in the user's face and ignore his request.

>Theres no need for the hook. playercolor is a "pseudohandle".

I don't see what that has to do with anything.
 
I also found the ability to get the player from the color to have only one use.

I hate that "b L u spacespace e" becomes "blue". I would just spit in the user's face and ignore his request.

Well, I'd rather not :p
I'd like to make it as easy for the user as possible to use it, and if that includes cleaning up a retarded user's text, then sure XD
 
I wouldn't 'spit in the user's face', but I have to agree that kind of input should not be accepted. To make sure the user does this correctly you should use a set of constants. That way it's clear what color is used and there will be a syntax error if it is incorrect.
 
See, pseudohandles can easily be converted into integers fitting into an array. The fact that someone here already mentioned in on the first page obviously had no effect, so ill just do it again.

ById versions are stupid. Are users able to do it without them? Yes, they are.

GetPlayerByColor is outside the scope of this library. Keep to what you promise to do, and do it well.

Also, CompressString should be private at least, but id rather remove it completely. Also, you know this is only a library, and top level code should be where it belongs (ie. at the top)?
 
>See, pseudohandles can easily be converted into integers fitting into an array. The fact that someone here already mentioned in on the first page obviously had no effect, so ill just do it again.

What he has is an optimisation. The hook was an idea that developed in this thread, off memory (after page 1).

>GetPlayerByColor is outside the scope of this library. Keep to what you promise to do, and do it well.

>Also, CompressString should be private at least, but id rather remove it completely.

I agree with these. Unless the library was renamed "Player Colour Strings" or something, then the first is acceptable. *Shrugs*

ById doesn't hurt. I mean, it seems kind of silly to have code that inlines to [LJASS]Array[GetPlayerId(Player(n))][/LJASS] and the ById counters that.
 
Well, so now after a long time, you want me to remove many of the features that you so desperately wanted me to include ?!

This just seems like a waste of time, to me sadle...

Ok, so what is it that you want me to remove exactly, and what should I keep, and is there something you want me to add ? :S
 
http://www.wc3c.net/showthread.php?t=101692
Watch how he does everything this library tries to do (even though hes using pre 1.24 code, which can be replaced easily).

Also, there are very few instances where ById versions would NOT be called with a parameter that looks like this: GetPlayerId(p).

Also, speed doesnt matter for a library like this (which makes the whole optimisation pointless because it only bloats the library and makes it harder to understand).
 
Don't know if someone mention this before, but...
Azlier, for helpong me out alot with several bugfixes and tweaking !

Need to change that to 'helping'.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    Or even third party. Like if you don't have an original one in a functional condition, you cannot play this game properly. Like yeah the keyboard mods exist, but I think those are BARELY functional
  • Varine Varine:
    And since almost all of my programming experience is with defunct shit now, I figure my best place is helping preserve legacy stuff. Which I don't know how to do necessarily, but I need some kind of a hobby and figuring out how older things worked is the only shit that really interests me. Well soldering and restoration is fun too, but no one is bringing me new stuff to fix and restore, so it's mostly old shit, and I LOVE OG Xbox so much. I want to make sure it can function as long as possible, until someone can effectively emulate it at least. I have like 15 I was going to fix over the winter and didn't get to.
    +1
  • Varine Varine:
    I also have a couple OG gameboys, but idk if I can do that without like, manufacturing new parts that no one makes anymore and I can't do that right now
  • tom_mai78101 tom_mai78101:
    Currently in the middle of getting the probate process going. We're doing the informal probate process.
    +3
  • Varine Varine:
    A probate is usually done with a will, yes? If so I am sorry for your loss
    +1
  • The Helper The Helper:
    Yeah Tom, me too sorry for your loss buddy my mom told me she finds out her olds friend died from Google searching them. She had not talked to one of her old friends in a year and found out she died from Google. Also another one in the same session. RIP all of them my sincere condolences Tom
    +1
  • Varine Varine:
    We have some elderly guests that regularly come hang out at the bar at the end of the night, and every once in a while we don't see someone for a few weeks and then someone shows up with their obituary.
  • Varine Varine:
    We usually let them do their memorials there in the morning if they want to and I'll make them some snacks and drinks. There was one guy named Tom that came in like every night and would sit by himself and get a bunch of soup and a glass of wine. idk why but he LOVED our fucking soup, like he would order a fucking quart of it at a time and would always get so sad when we stop doing it for the summer.
    +1
  • Varine Varine:
    But he also loved our calamari, which is another thing I hate but it sells super well so I can't change it. There was one day he came in and was asking me how to make it, because he tried to at home once in the off season when we stop running it and he really wanted it lol
  • Varine Varine:
    I think he's one of the only people I've made recipes for for free because he really wanted a broccoli cheddar, and it was like dude I don't have a recipe, it's just whatever I have, but here, this is how you do it
  • Varine Varine:
    I don't think he ever figured out how to do the calamari in a pan though, like idk how to do that either. He was afraid of the at home deep fryers though and it's like yeah, that's fair, I am too
  • Varine Varine:
    He was just such a sweet old man, we had two servers pregnant and they held a baby shower together, he was soooooo fucking excited to get to see a baby. Unfortunately he died a month or so before they were born
  • The Helper The Helper:
    So I decided to Google some people that I had not seen or heard from in a while and sure enough one of my old best friends, we had a falling out years ago but whatever, find out he died of Pancreatic Cancer in January. I have also lost a few of my closer acquaintances from growing up the last year. Getting old - people die - I kinda thought it was going to be this way a few years ago....
    +2
  • The Helper The Helper:
    Forum running super slow again
  • Ghan Ghan:
    Not really clear from the stats as to what is causing the slowness.
  • Ghan Ghan:
    We get a lot of guest traffic so it may just be the load is getting too high and not from any particular source.
  • Ghan Ghan:
    Looks like the server is maxed out on CPU.
  • Ghan Ghan:
    Oh it looks like a lot of the traffic is Silkroad Forums. That domain isn't protected by Cloudflare.
  • Ghan Ghan:
    But the old Silkroad site is still on its own server. I just had a test site set up on this server for it.
  • Ghan Ghan:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top