ID:2659158
 
(See the best response by FKI.)
I am working on a very simple sign system, in which the sign's desc is brought up in an alert() and displays the text. For whatever reason, some of the alerts cut the text off, others it does not and it doesn't seem like there's any reason for it.

Problem description:
Some of my alert() boxes are cutting off the text, while others are not. I cannot figure out WHY it is happening and it is driving me nuts.
Could you post the code you're using that's not behaving properly? Including an example alert that works in your code alongside the one that doesn't would be very helpful.
obj/Sign
name = ""
density = 1
bound_width = 32
bound_height = 16
icon = 'Sign.dmi'
icon_state = "001"

DblClick()
alert("[src.desc]","Reading Sign")
return

New()
spawn() src.Sign_Overlay()
return

proc/Sign_Overlay()
var/image/sign_overlay = new('Sign.dmi',"001 overlay")
sign_overlay.layer = MOB_LAYER + 1
src.overlays += sign_overlay


The signs are placed on the map, then, I edit each one's description on the map. That's it.

With that being said, I ended up fixing it myself, when I went to go collect the working and non-working descriptions.

When I went to go copy a sign's description, I noticed at the beginning of it was a '/t' and I don't know why. I didn't put it there. I went through, checked all the descriptions, removed the '/t' from any of the descriptions and now they all work. I don't know if this is a bug or what.

Also, in case anyone is asking, no, there's no actual proc() or verb() within my game that is changing the sign's descriptions.



Best response
Trying using a different, custom variable to store the descriptions? I haven't had any issues using desc for descriptions of things, but a simple test is worth the ruling out.

I don't see anything game-breaking about your code, which is the weird part.

Maybe you should test if your system works in a basic test source. You'll know by the results whether or not it's you or the engine. ()
It works just fine now. I don't know where those extra junk text came from but they didn't come back.