Raised This Month: $12 Target: $400
 3% 

[L4D2] VScript Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thresh0ld
Senior Member
Join Date: Sep 2009
Location: Hell
Old 02-27-2014 , 04:33   [L4D2] VScript Help
Reply With Quote #1

Been trying to make this work but there seems to be an issue on the VScript file.

Basically what I am trying to do is load a vscript from sourcemod to create a simple hud but it keeps throwing an error from the console.

Sourcemod Code:

Code:
public Action:RunVscript(client,args)
{
	new entity = CreateEntityByName("logic_script");
	if( entity != -1 )
	{
		DispatchKeyValue(entity, "vscripts", "vscript_test");
		DispatchSpawn(entity);
		SetVariantString("OnUser1 !self:RunScriptCode::0:-1");
		AcceptEntityInput(entity, "AddOutput");
		SetVariantString("OnUser1 !self:Kill::1:-1");
		AcceptEntityInput(entity, "AddOutput");
		AcceptEntityInput(entity, "FireUser1");
	}
	return Plugin_Handled;
}
Test VScript (vscript_test.nut):

Code:
Msg("Hello 'Console' World.\n");

const HUD_TICKER = 6;
const HUD_FLAG_BLINK = 8;

IncludeScript("scriptedmode")
IncludeScript("sm_utilities")
IncludeScript("sm_spawn")
IncludeScript("sm_resources")

function TestHud( startStr = "" )
{
   TickerHUD <- {}                                  
   Ticker_AddToHud( TickerHUD, startStr )           
   HUDSetLayout( TickerHUD )                        
   Ticker_SetBlink(HUD_FLAG_BLINK)
   Ticker_SetTimeout(15)
   HUDPlace( HUD_TICKER, 0.25, 0.04, 0.5, 0.08 )    
}

TestHud("Hello!");

Error Message from Console:

Code:
Hello 'Console' World.

AN ERROR HAS OCCURED [the index 'STAGE_NONE' does not exist]

CALLSTACK
*FUNCTION [main()] /home/steam/servers/hlds/left4dead2/left4dead2/scripts/vscripts/scriptedmode.nuc line [30]
*FUNCTION [DoIncludeScript()] NATIVE line [-1]
*FUNCTION [IncludeScript()] unnamed line [75]
*FUNCTION [main()] /home/steam/servers/hlds/left4dead2/left4dead2/scripts/vscripts/vscript_test.nut line [7]

LOCALS
[vargv] ARRAY
[this] TABLE
[scope] TABLE
[name] "scriptedmode"
[this] TABLE
[vargv] ARRAY
[this] TABLE
Error running script named scriptedmode

AN ERROR HAS OCCURED [Failed to include script "scriptedmode"]

CALLSTACK
*FUNCTION [IncludeScript()] unnamed line [75]
*FUNCTION [main()] /home/steam/servers/hlds/left4dead2/left4dead2/scripts/vscripts/vscript_test.nut line [7]

LOCALS
[scope] TABLE
[name] "scriptedmode"
[this] TABLE
[vargv] ARRAY
[this] TABLE
Error running script named vscript_test
(4614.18) input <NULL>: logic_script.AddOutput(OnUser1 !self:RunScriptCode::0:-1)
(4614.18) input <NULL>: logic_script.AddOutput(OnUser1 !self:Kill::1:-1)
(4614.18) input <NULL>: logic_script.FireUser1()
(4614.18) output: (logic_script,) -> (!self,Kill,1.0)()
(4614.18) output: (logic_script,) -> (!self,RunScriptCode)()
(4614.21) input : logic_script.RunScriptCode()
 Entity logic_script encountered an error in RunScript()
unhandled input: (OnPlayerJoin) -> (game_player_manager), from (player,); target entity not found
unhandled input: (OnPlayerSpawn) -> (game_player_manager), from (player,); target entity not found
(4615.18) input : logic_script.Kill()
thresh0ld is offline
thresh0ld
Senior Member
Join Date: Sep 2009
Location: Hell
Old 02-28-2014 , 01:11   Re: [L4D2] VScript Help
Reply With Quote #2

Quote:
Originally Posted by lissaivy View Post
it's working....thanks

How were you able to make this work? Did you change something? If so, kindly share your solution please.
thresh0ld is offline
jeremyvillanueva
AlliedModders Donor
Join Date: Jan 2021
Location: dcord:Jeremy333#7632
Old 03-02-2021 , 11:34   Re: [L4D2] VScript Help
Reply With Quote #3

Hi, in order to use hud you could use
VSLib\Utils from rayman
Im sharing my code,
I use coop that includes blendermode from c Dog (http://www.xygamers.com/thread-25602-1-1.html)
It use the HUD on the ::ShowRank <- function()
https://github.com/jeremyvillanuevar/vscripts_custom
Hope it helps,
jeremyvillanueva is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode