HALP with ScriptGL ChatHUD - splitting long lines

This is the development community to discuss tribes mod coding or to ask questions.

Moderator: Moderators

1 Sun Apr 07, 2013 10:36 pm

So, i use a scriptGL ChatHUD, the problem is that it doesn't wrap long lines so that any string wider than the hud gets cut off. i want it to split long lines up into two and show them both

Image

http://pastebin.com/WVZpaJiY

^^^^^^^^^^^ here is the script in question, yay pastebin

i fiddled a bit with the input field to try to get it to split and it does, but that's just for the draw, it doesn't actually change the line sent/seen in chat.

but for the chat display, i guess i need to make it so that when the line is longer than X, then split the string into two values and add those 2 values to the array instead of just one

i can figure out a few ways of splitting a string up, but where im stuck is - how/where do i tell it to add two different values to the array instead of the normal %msg ?

Can anyone halp?
Groove
Ensign
Ensign
 
Posts: 52

2 Mon Apr 08, 2013 6:53 am

$vChatHud::Lines++;
$vChatHud::Lines[$vChatHUD::Lines, cl] = %clName;
$vChatHud::Lines[$vChatHUD::Lines, msg] = %msg-part1;
$vChatHud::Lines[$vChatHUD::Lines, type] = %type;
$vChatHud::Lines[$vChatHUD::Lines, count] = 1;
$vChatHud::Lines[$vChatHUD::Lines, time] = %now;
$vChatHud::Lines++;
$vChatHud::Lines[$vChatHUD::Lines, cl] = %clName;
$vChatHud::Lines[$vChatHUD::Lines, msg] = %msg-part2;
$vChatHud::Lines[$vChatHUD::Lines, type] = %type;
$vChatHud::Lines[$vChatHUD::Lines, count] = 1;
$vChatHud::Lines[$vChatHUD::Lines, time] = %now;
$vChatHud::LastMessage[%clName] = $vChatHUD::Lines;
bugs_
1st Lieutenant
1st Lieutenant
 
Posts: 303

3 Mon Apr 08, 2013 12:58 pm

^gfg
User avatar
Anubis
=A cantora floribella=
 
Posts: 6896

4 Mon Apr 08, 2013 11:09 pm

heh shoot i figured out exactly that, last night not long after posting this

doh i should have replied

now just gotta find a good way to split up the string and find spaces between words etc :P

thx bug
Groove
Ensign
Ensign
 
Posts: 52


Return to Coder's Hangout

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron