Ulysses

Ulysses Stuff => Ulysses Release Archives => Releases => Releases for ULX v1.* => Topic started by: Golden-Death on November 28, 2005, 04:12:26 PM

Title: Text Floating Plugin
Post by: Golden-Death on November 28, 2005, 04:12:26 PM
Finally the DNS cache cleard, so I present you...

Overhead Text Plugin

This script has two versions, one for people who don't want to touch the script in any form, and one for people who don't want to clog up their ulx_helps with menu cvars.

Version One:
Code: [Select]
RED = 255
GREEN = 0
BLUE = 255
ALPHA = 100


--------------------------------------------------------------------
--                      Do Not Edit Below                          ---
--------------------------------------------------------------------




function gd_floattext( userid, args, argv, argc )
local target = getUser( userid, argv[ 1 ] )
if target == nil then
return
end



  _GModText_Start( "Default" );
  _GModText_SetColor( RED,GREEN,BLUE,ALPHA );
  _GModText_SetTime( 999, 0, 0.5 ); --How long it stays, and the fading times
  _GModText_SetEntityOffset( vector3( 0, 0, 40 ) ); --Messages appear 35 Units above Players
  _GModText_SetEntity( target ); --Entity/Player the message will follow
  _GModText_SetText( gd_msg ); --Set the message
  _GModText_Send( 0, 50+userid );



 



end





ULX_CONCOMMAND( "ulx_floatmsg", gd_floattext, ACCESS_CVAR, "Begin float text on user _ Plugin by Golden-Death", 1, "!float" )
ULX_CONVAR( "gd_msg", "This is my floating text!", ACCESS_CVAR, " Message to float" )

If you choose this script, you may set the RED - GREEN - BLUE - ALPHA to different values, as seen in the script above.
Code: [Select]
RED = 255
GREEN = 0
BLUE = 255
ALPHA = 100
This version has 1 CVAR:
gd_msg -sets the message

Copy the code and put it anywhere in a ULX file is exec'ed.
(Ex: copy and paste to bottom of gmod9/lua/ulx/fun.lua)


Version 2
Code: [Select]
--------------------------------------------------------------------
--             Do Not Edit Below: Use the cvars to set            --
--------------------------------------------------------------------




function gd_floattext( userid, args, argv, argc )
local target = getUser( userid, argv[ 1 ] )
if target == nil then
return
end



  _GModText_Start( "Default" );
  _GModText_SetColor( gd_red,gd_green,gd_blue,gd_alpha );
  _GModText_SetTime( 999, 0, 0.5 ); --How long it stays, and the fading times
  _GModText_SetEntityOffset( vector3( 0, 0, 40 ) ); --Messages appear 35 Units above Players
  _GModText_SetEntity( target ); --Entity/Player the message will follow
  _GModText_SetText( gd_msg ); --Set the message
  _GModText_Send( 0, 50+userid );



 



end





ULX_CONCOMMAND( "ulx_floatmsg", gd_floattext, ACCESS_CVAR, "Begin float text on user _ Plugin by Golden-Death", 1, "!float" )
ULX_CONVAR( "gd_msg", "This is my floating text!", ACCESS_CVAR, " Message to float" )
ULX_CONVAR( "gd_red", "0", ACCESS_CVAR, " Floating text - Red Value" )
ULX_CONVAR( "gd_green", "0", ACCESS_CVAR, " Floating text - Green Value" )
ULX_CONVAR( "gd_blue", "0", ACCESS_CVAR, " Floating text - Blue Value" )
ULX_CONVAR( "gd_alpha", "255", ACCESS_CVAR, " Floating text - Transparency Value" )

If you choose this one, you won't have to ever touch the script. Simply install and use CVARs to set the color and alpha
This version has 5 CVARS:
gd_red - sets amount of red
gd_green - sets amount of green
gd_blue - sets amount of blue
gd_alpha - sets amount of transparency
gd_msg - sets the message

Copy the code and put it anywhere in a ULX file is exec'ed.
(Ex: copy and paste to bottom of gmod9/lua/ulx/fun.lua)

(http://img55.imageshack.us/img55/163/gmconstruct00360hh.th.jpg) (http://img55.imageshack.us/my.php?image=gmconstruct00360hh.jpg)
(http://img340.imageshack.us/img340/2637/gmconstruct00378zs.th.jpg) (http://img340.imageshack.us/my.php?image=gmconstruct00378zs.jpg)

Title: Re: text floating plugin
Post by: Mank on November 29, 2005, 09:02:53 AM
Nice one, instead of making lots of small scripts how about you make one interesting one like your glow plugin!
Title: Re: text floating plugin
Post by: Golden-Death on November 29, 2005, 03:46:41 PM
the problem is finding ideas  ;)
Title: Re: text floating plugin
Post by: Megiddo on November 29, 2005, 04:55:15 PM
the problem is finding ideas  ;)

Hehe... no kidding. Programmers aren't creative, they just think of ways to implement other's ideas.
Title: Re: text floating plugin
Post by: Golden-Death on November 29, 2005, 08:49:16 PM
Im plenty imaginative, id have wonderful ideas if lua could implement flame throwing jetpacks with lasers that sprout flowers out of cs_italy bananas on implode.
Title: Re: text floating plugin
Post by: jesus on November 30, 2005, 05:57:17 AM
Sorry to be a but could you maybe zip this up and make it downloadable?
I'm not sure how to lake a .lua file... ;D
Title: Re: text floating plugin
Post by: Golden-Death on November 30, 2005, 03:32:20 PM
open notepad

copy the stuff above into it

click save as

browse to gmod9/lua

in the dropdown box, select 'All Files'

Name the file as textfloat.lua

save
Title: Re: text floating plugin
Post by: Megiddo on November 30, 2005, 03:34:52 PM
http://www.upload2.net/download2/Ee7qSX5ANoK3X0r/txt_plug.lua.html

Or use that
Title: Re: text floating plugin
Post by: Golden-Death on December 03, 2005, 07:33:02 PM
Now hosted on Blue Fire: http://www.goldendeath.byethost11.com/
Title: Re: text floating plugin
Post by: neoshock2k on January 19, 2006, 02:40:00 AM
yo dragon ur post up there about the jetpack.

I see no reason why u couldnt do that in hammer, and some lua, then simply vmfloader it or compile it for gmod+

just use an invisible pod, somtething that looks like a jetpack (vmfloader supports brushes now)

add the right entities, thrusters, logic etc

and i can load it up any time by the click of a button.

As for the bananas you would need to place a banana image in sprites, then use a laser setits width and bingo!

Hope that gets u creating :D

Title: Re: text floating plugin
Post by: Golden-Death on January 19, 2006, 01:06:55 PM
ahaha, i would but im too busy atm :(
Title: Re: text floating plugin
Post by: Griff on February 04, 2006, 05:27:28 AM
erm. i cant get the floating text to work and am a bit confused about the commands needed to make it work. i have saved the file as textfloatuncvar.lua and added the line _OpenScript( "textfloatuncvar.lua" ) to ulx_init.lua but nothing works... can anyone explain?
Title: Re: text floating plugin
Post by: Golden-Death on February 04, 2006, 08:07:03 AM
erm. i cant get the floating text to work and am a bit confused about the commands needed to make it work. i have saved the file as textfloatuncvar.lua and added the line _OpenScript( "textfloatuncvar.lua" ) to ulx_init.lua but nothing works... can anyone explain?

I havnt used it in a while, but if you are using the uncvar version, it should work like this if installed correctly
Ingame in console, type the following:
sv_cheats 1
thirdperson
gd_msg test
ulx_floatmsg "your player name here"
Title: Re: text floating plugin
Post by: Griff on February 05, 2006, 03:41:07 AM
ok, ive done all that but when i say ulx_floatmsg "[**RvB**]Griff" it just says it cant find player name. (i copied and pasted it correctly from console) so i know the name is spelt correctly... any ideas?
Title: Re: text floating plugin
Post by: Golden-Death on February 05, 2006, 07:30:39 AM
Might be a problem wiht your name, try changing your name to bob and seeing if it works.
Title: Re: text floating plugin
Post by: Griff on February 05, 2006, 08:00:38 AM
nope :( sadly it still doesnt work :(:(:(
Title: Re: text floating plugin
Post by: Megiddo on February 10, 2006, 02:13:45 PM
Please update this plugin to use ULX v1.1's new module system