HALP with ScriptGL ChatHUD - splitting long lines

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

Moderator: Moderators

Post Reply
Groove
Ensign
Ensign
Posts: 52
Joined: Tue Feb 12, 2013 11:26 pm

HALP with ScriptGL ChatHUD - splitting long lines

Post by Groove » 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?

bugs_
1st Lieutenant
1st Lieutenant
Posts: 303
Joined: Wed Sep 20, 2006 3:05 pm

Re: HALP with ScriptGL ChatHUD - splitting long lines

Post by bugs_ » 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;

User avatar
Anubis
=A cantora floribella=
Posts: 6896
Joined: Wed Nov 30, 2005 3:02 pm
Location: Portugal
Contact:

Re: HALP with ScriptGL ChatHUD - splitting long lines

Post by Anubis » Mon Apr 08, 2013 12:58 pm

^gfg

Groove
Ensign
Ensign
Posts: 52
Joined: Tue Feb 12, 2013 11:26 pm

Re: HALP with ScriptGL ChatHUD - splitting long lines

Post by Groove » 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

Post Reply