AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [L4D2] VScript Help (https://forums.alliedmods.net/showthread.php?t=236094)

thresh0ld 02-27-2014 04:33

[L4D2] VScript Help
 
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 02-28-2014 01:11

Re: [L4D2] VScript Help
 
Quote:

Originally Posted by lissaivy (Post 2105082)
it's working....thanks


How were you able to make this work? Did you change something? If so, kindly share your solution please.

jeremyvillanueva 03-02-2021 11:34

Re: [L4D2] VScript Help
 
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,


All times are GMT -4. The time now is 10:57.

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