[ScriptGL] Bottom Print

User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [ScriptGL] Bottom Print

Post by DaJ4ck3L »

ohhh and now it's missing this function.

HString::getLongSubStr

argh!!!

Code: Select all

   // stringdim kills FPS so i'm trying to only run it once if string changes
   if ($GREMOTE::sglmsgwidth == 0 && String::len($GREMOTE::themsg) > 0 ) {
       glSetFont( $GREMOTE::font, $GREMOTE::sizefont, 0, 9 );
       $GREMOTE::sglmsgwidth = ScriptGL::StringDim( ScriptGL::StripColorTags($GREMOTE::themsg) ); //missing function ScriptGL::StripColorTags
       }
   
   %x = %PGx / 2 - $GREMOTE::sglmsgwidth / 2 ;
im wondering if this will fix the centering issue once i get that $GREMOTE::sglmsgwidth fixed.
Image
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: [ScriptGL] Bottom Print

Post by Groove »

H.Support

(but i'd just put the whole hudmover folder in ur scriptGL folder)
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: [ScriptGL] Bottom Print

Post by Groove »

should look something like this

Image
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [ScriptGL] Bottom Print

Post by DaJ4ck3L »

ahhhh, no, it never looked anything like that from the start. probably the missing functions.

i just checked H.ScriptGLSupport.acs.cs and the HString::getLongSubStr function isn't in there.
Attachments
bporig.jpg
Image
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: [ScriptGL] Bottom Print

Post by Groove »

hrm i guess this should probably be in that .zip too

H.Support.acs.cs

Code: Select all

// misc support functions for HPack
// part of Hpack version 0.3 by Han Nehi

// You have to pass the length of the %search and %replace strings
function HString::Replace(%string, %search, %replace, %search_len, %replace_len)
{
	%s = 0;
	while((%i = String::findSubStr(HString::getLongSubStr(%string, %s, 9999), %search)) != -1)
	{
		%string = HString::getLongSubStr(%string, 0, %i+%s) @ %replace @ HString::getLongSubStr(%string, %i+%s+%search_len, 9999);
		%s += %i + %replace_len;
	}
	return %string;
}

// same as String::getSubStr, except without the 255 char limit
function HString::getLongSubStr(%string, %start, %len)
{
	if( %len <= 255 )
		return String::getSubStr(%string, %start, %len);
		
	%s = 0;
	while( String::getSubStr(%string, %start + %s, 1) != "" )
	{
		if( %len > 255 )
			%l = 255;
		else
			%l = %len;
		%ret = %ret @ String::getSubStr(%string, %start + %s, %l);
		%s += 255;
		%len -= 255;
	}
	return %ret;
}

// example: Hecho("var 1 is", %var1, "var 2 is", %var2);
function HEcho(%t0, %v0, %t1, %v1, %t2, %v2, %t3, %v3, %t4, %v4, %t5, %v5, %t6, %v6, %t7, %v7, %t8, %v8, %t9, %v9 )
{
	%c = -1;
	while( %t[%c++] != "" )
		%txt = %txt @ " " @ %t[%c] @ ": '" @ %v[%c] @ "', ";
	echo( HString::getLongSubStr(%txt, 0, 1023) );
}

// modified from Andrew's config options\init.cs
function HBindKey( %key, %action, %breakaction )
{
	%key[0] = getword(%key, 0);
	%key[1] = getword(%key, 1);
	
	if (%key[1] != "")
		%key = "\"" @ %key[0] @ "\", \"" @ %key[1] @ "\"";
	else
		%key = "\"" @ %key[0] @ "\"";

	if( %action == "" )
		%action = "$null='';";
	if( %breakaction == "" )
		%breakaction = "$null='';";
				
	%bind = "bindCommand(keyboard0, make, " @ %key @ ", TO, \"" @ %action @ "\");";
	eval( %bind );
	%bind = "bindCommand(keyboard0, break, " @ %key @ ", TO, \"" @ %breakaction @ "\");";
	eval( %bind );
}
sorry, most of my scripts these days are all kinda tied together thats why i haven't given one out in a while
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: [ScriptGL] Bottom Print

Post by Groove »

should be moar like dis :)
Attachments
br_join.jpg
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [ScriptGL] Bottom Print

Post by DaJ4ck3L »

YEA THAT WORKED PERFECT. YOU'RE THE MAN!!!!

oops caps lock, but ill leave it. :)

ps, if you have any other scriptgl goodies i take them. think im going to play around with it a bit more. that ScriptGL::StringDim function is exactly what i was looking for lol. now that it it's returning the proper value it looks much better.

lol and u caught me right on the connect. that sky looks ugly btw!!! :lol:
Image
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: [ScriptGL] Bottom Print

Post by Groove »

yeah be careful with ScriptGL::StringDim, it seriously rapes FPS

i had it updating every draw and it would take me down from 1000fps to 60, thats why i had to add that check in so it only did it if the message changes

took me forever to figure out which command was the culprit

also i think it gives wonky results for height - i used to get 0 for the height if i threw a bunch of requests at it

for scriptGL stuff, i'd say poke around T2013v2.zip, that was the latest scriptGL config i released and that's where i pulled gremote from

even stupid little things like the spinning cube animation in vcreditsgui can teach u a few tricks, and vGroove you can see how i do the sliders/buttons/toggles/mouse interaction

vhudmover itself has some scriptGL stuff too, han nehi had sorta a different style of doing stuff than my scripts do but i had to rewrite some of it to work with 1.40, he also has button and checkbox stuff done differently than mine

if you do look at vhudmover and feel like tinkering, see if you can get it to resize the Minimap with right click like the rest of the vhuds - that was one of the things that used to work in 1.3 that i never fixed and i know ur good w/code ;)
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: [ScriptGL] Bottom Print

Post by Groove »



preview of that config

do youtube tags not work ? what am i doing wrong rawr
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [ScriptGL] Bottom Print

Post by DaJ4ck3L »

have to take the s out of https://

ohhh yea that's pretty cool. not sure why i havent messed with sgl sooner. :lol:
Image
Post Reply