In response to Hell Ramen
Hell Ramen wrote:
The pixel offsets/loc can mess up the icon_states? :o

No, but if the numbers are coming out backwards on-screen, while the debug messages come out forwards, then that's probably the problem.
In response to Wizkidd0123
But it works for the one's place, just not then tens/hundreads.
In response to Hell Ramen
Ungh, I don't like doing this...but...
Bring
Up
My
Post
In response to Hell Ramen
Sorry, but would you mind posting the snippet in its current state? I'd really rather not search through all these messages to find it, and it would be nice to have it as a reference for a reply :)
In response to Igmolicious
To add to Igmolicous's post, state the current problem in some detail please.
In response to DeathAwaitsU
mob/proc/rupyupdate()
var/O = num2text(src.rupies)
for(var/obj/rupy/number/n1/N in src.client.screen)
N.icon_state = copytext(O,3,4)
if(!N.icon_state)
N.icon_state = "0"
for(var/obj/rupy/number/n2/Q in src.client.screen)
Q.icon_state = copytext(O,2,4)
if(!Q.icon_state)
Q.icon_state = "0"
for(var/obj/rupy/number/n3/P in src.client.screen)
P.icon_state = copytext(O,1,4)
if(!P.icon_state)
P.icon_state = "0"


obj/rupy
layer = MOB_LAYER+2
icon = 'hud.dmi'
icon_state = "rupy"
screen_loc = "4,14:+4"
number
icon = 'numbers.dmi'
icon_state = "0"
n1
screen_loc = "4,14:-10"
n2
screen_loc = "5:-14,14:-10"
n3
screen_loc = "6:-28,14:-10"

mob/var/rupies = 0


It outputs the HUD numbers as
001
002
003
004
005
006
007
008
009
00
01
02
etc.
In response to Hell Ramen
Alrighty, I believe I see part of the problem. With copytext, you're probably just wanting to capture a single character for the icon_state, so for one, use:

mob/proc/rupyupdate()
var/O = num2text(src.rupies)
for(var/obj/rupy/number/n1/N in src.client.screen)
N.icon_state = copytext(O,3,4)
if(!N.icon_state)
N.icon_state = "0"
for(var/obj/rupy/number/n2/Q in src.client.screen)
Q.icon_state = copytext(O,2,3) //Changed.
if(!Q.icon_state)
Q.icon_state = "0"
for(var/obj/rupy/number/n3/P in src.client.screen)
P.icon_state = copytext(O,1,2) //Changed.
if(!P.icon_state)
P.icon_state = "0"
In response to Igmolicious
Now it goes reverse:
001
002
003
004
005
006
007
008
009
001
011
021
etc.

Thanks so far.
In response to Hell Ramen
And what excatly is the problem?
In response to DeathAwaitsU
It's increasing by ones the whole time...
In response to Hell Ramen
Ok, we're gonna do something a bit different for your number parsing. This text string thing is evil.

mob/proc/rupyupdate()
var/num = src.rupies
var
hundreds = 0
tens = 0
ones = 0
if(num>100)
hundreds = ( num - ( num % 100 ) ) / 100
num = num % 100
if(num>10)
tens = ( num - ( num % 10 ) ) / 10
num = num % 10
ones = num
for(var/obj/rupy/number/n1/N in src.client.screen)
N.icon_state = "[hundreds]"
for(var/obj/rupy/number/n2/Q in src.client.screen)
Q.icon_state = "[tens]"
for(var/obj/rupy/number/n3/P in src.client.screen)
P.icon_state = "[ones]"
In response to Igmolicious
_>
Could you please explain that? I don't like code I don't understand. @_@
In response to Hell Ramen
Hell Ramen wrote:
_>
Could you please explain that? I don't like code I don't understand. @_@

Basically, A % B returns the remainder of A/B. Read its DM Ref entry for more info.

The erason he's using var//bum to represent src.rupies is so that he can mess with num all he wants, but not have to completely destroy src.rupies.
In response to Hell Ramen
Yeah, sure. Sorry, normally I try to comment everything, so it's learned from, rather than ripped. Let me say thank you, for being eager to learn things you don't understand, rather than just accepting it, and not question it.

    if(num>100)
//If the number is greater than 100, it's a 3-digit
//number, so we grab the number in the "hundreds" place.

//Ok, if we take our number, and subtract the
//part of it that isn't EVENLY divisable by 100
//num - ( num % 100 ) from it, we get a multiple
//of 100. If we divide THAT by 100, we get a single
//digit number that represents how many hundreds
//we have. (ie. For 100 -> 1, 300 -> 3, etc.)
hundreds = ( num - ( num % 100 ) ) / 100

//Now, we set our number to the portion of our
//number that isn't EVENLY divisable by 100.
//This leaves us with the tens and ones place.
num = num % 100
if(num>10)
//We do something similar here, but with the tens
//place. All said and done, we're left with ones.
tens = ( num - ( num % 10 ) ) / 10
num = num % 10
//Since we're just left with ones, we copy that number.
ones = num
In response to Wizkidd0123
Also, what's x2 for?
In response to Hell Ramen
Typo, since I grabbed it from some of one of my project's code :) My edit fixed it :) Thanks.
In response to Igmolicious
No, thank you. :p

[Edit] I think Wizzie was right, somehow my pixel offsets are screwing it up. o.o It does the same thing (001,002,003,004,005,006,007,008,009,00,01,02,etc.)
Maybe this belongs at the bottom right, but this thread was getting hard to read. Now, your problem is:

obj/rupy
layer = MOB_LAYER+2
icon = 'hud.dmi'
icon_state = "rupy"
screen_loc = "4,14:+4"
number
icon = 'numbers.dmi'
icon_state = "0"
n1
screen_loc = "4,14:-10"
n2
screen_loc = "5:-14,14:-10"
n3
screen_loc = "6:-28,14:-10"


The offsets are screwed up. Now, what we need to do is make them positive. This isn't a coding issue, but a readability/easy comprehension issue:

obj/rupy
layer = MOB_LAYER+2
icon = 'hud.dmi'
icon_state = "rupy"
screen_loc = "4:0,14:4"
number
icon = 'numbers.dmi'
icon_state = "0"
n1
screen_loc = "4:0,13:22"
n2
screen_loc = "4:18,13:22"
n3
screen_loc = "4:36,13:22"


So, now that we've translated it, we know that n1, n2, and n3 are each 18 pixels apart. Now, if it's coming out reversed, why not just reversing it?

obj/rupy
layer = MOB_LAYER+2
icon = 'hud.dmi'
icon_state = "rupy"
screen_loc = "4:0,14:4"
number
icon = 'numbers.dmi'
icon_state = "0"
n1
screen_loc = "4:36,13:22"
n2
screen_loc = "4:18,13:22"
n3
screen_loc = "4:0,13:22"


The Lesson:

Readable code is do-able code.
In response to Wizkidd0123
But, it's only becoming reversed after the ones' place is finished off, and tens' place increases.
In response to Hell Ramen
Hell Ramen wrote:
But, it's only becoming reversed after the ones' place is finished off, and tens' place increases.

Then reverse the tens and hundreds places:
obj/rupy
layer = MOB_LAYER+2
icon = 'hud.dmi'
icon_state = "rupy"
screen_loc = "4:0,14:4"
number
icon = 'numbers.dmi'
icon_state = "0"
n1
screen_loc = "4:0,13:22"
n2
screen_loc = "4:36,13:22"
n3
screen_loc = "4:18,13:22"
Page: 1 2 3