proc/PrintText(text, x_pos, y_pos, client/C, spacing, line_height = 1, color = "white", image_list = null)
I am using an icon with icon_states for every letter, number, and special characters. Printing text on screen via object.
JoinQueue()
world << "[src] JoinQueue called"
if(!(src in player_queue))
player_queue += src
UpdateQueueDisplay()
src << "You have joined the game queue."
world << "[src.name] has joined the game queue."
// Play sound
switch(length(player_queue))
if(1)
world << p1_join_sound
if(2)
world << p2_join_sound
if(3)
world << p3_join_sound
if(4)
world << p4_join_sound
if(length(player_queue) >= 1)
if(countdown_active || countdown_started)
// Reset countdown if it's already started
return
countdown_started = TRUE
spawn() StartCountdown()
UpdateQueueDisplay()
LeaveQueue()
world << "[src] LeaveQueue called"
if(src in player_queue)
player_queue -= src
src << "You have left the game queue."
world << "[src.name] has left the game queue."
if(length(player_queue) < 1 && countdown_active)
countdown_active = FALSE
countdown_started = FALSE
world << "Not enough players. Countdown cancelled."
ClearCountdownText()
if(length(player_queue) == 0)
ClearQueueDisplay()
else
UpdateQueueDisplay()
UpdateQueueDisplay()
world << "Updating Queue Display"
// Remove the previous display if it exists
RemoveText(queue_text_images)
queue_text_images = list()
// Position for the queue display
var/x_pos = 4
var/y_pos = 13
// Print the header
for(var/client/C in world)
world << "Printing header for client [C]"
PrintText("PLAYERS IN QUEUE:", x_pos, y_pos, src.client, spacing = 0.5, line_height = 2, color = "white", image_list = queue_text_images)
y_pos -= 2 // Move down for the next line
// Print each player name in the queue
for(var/mob/player/P in player_queue)
world << "Printing player [P.name] in queue"
PrintText(P.name, 6.2, y_pos, src.client, spacing = 0.5, line_height = 2, color = "yellow", image_list = queue_text_images)
y_pos -= 2
ClearQueueDisplay()
world << "Clearing Queue Display"
RemoveText(queue_text_images)
queue_text_images = list()
StartCountdown()
countdown_active = TRUE
countdown_started = FALSE
ClearCountdownText()
var/x_pos = 6
var/y_pos = 8
for(var/i = 10 to 1 step -1)
if(!countdown_active)
world << "Countdown cancelled."
ClearCountdownText()
return
for(var/client/C in world)
RemoveText(countdown_images)
countdown_images = list()
PrintText("[i]", x_pos, y_pos, C, spacing = 0.5, line_height = 2, color = "red", image_list = countdown_images)
world << "Game starts in [i] seconds."
for(var/mob/player/P in player_queue)
P.client << clock
sleep(10)
if(countdown_active)
for(var/client/C in world)
RemoveText(countdown_images)
countdown_images = list()
world << "Game started."
sleep(5)
ClearCountdownText()
StartGame()
countdown_active = FALSE
Problem description:
I'm sure I've butchered the code while revamping as this will no longer print on the screen for my player queue or countdown proc. I switched over from Maptext. Attached is an image of how it was working... Funny enough, I can manually print by using PrintText() in the Login() code. Any clues what I am missing?
My recommendation would be to put some debugging output in or before your PrintText() call to see what arguments it's getting. If it works in some cases but not others, then it's likely being called with the wrong info.