-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TF2 VScript Mega Issue! #4481
Comments
Holy hell, amazing! Really looking forward to how this will end up looking like, sounds really promising! |
Finally, Bad Apple in Team Fortress 2 |
Finally, we can have actual NPCs in TF2, not just skeletons, murrrasssmus and headless horseman. |
|
Linux dedicated server crashes on startup:
Dedicated server instance appears to be missing (Aside: Do consider having a dedicated issue-tracking repository for this to keep things organized.) |
Should be fixed in the next update. |
Trying to access netprops, and I'm unable to. I'm also brand spankin new to vscript (started when I heard about this) so here's what I have
The part |
@Yakibomb Hello! It looks like something was wrong with registering the singleton instance for netprops in that build. It will be fixed in the next update |
@Joshua-Ashton Awesome!! That's fabulous. Also seems like these aren't working ( spits out [Accessed null instance] )
|
You can't pass a string to a function using RunScriptCode input. This problem was present in other games with VScript too. https://github.com/mapbase-source/source-sdk-2013/wiki/VScript-in-Mapbase#new-utilities |
It seems that game event callbacks can be registered, but are never actually ran by the engine. Tested on Windows in both a listen server and a dedicated server.
This works as expected in L4D2 but in TF2 does nothing (calling |
Convars has the same [Accessed null instance] problem as well. |
I'm noticing that the functions
|
|
Quick FYI about a long-standing Squirrel VM bug we fixed with L4D2 on April 14th, just to make sure it's gone in TF2: For over a decade, this very rare and impossible to reproduce bug caused complete VScript failures that led to events, finales, and Mutations to suddenly not work until the map was reloaded. As players run more and more VScripts in TF2, keep this bug in mind, since it was our team's biggest nightmare post-TLS. (Not to be confused with race condition issues that often yielded a similar result, which we've fixed by adjusting the order script runs.) |
Yep, I fixed this when I fixed net props. It will also be fixed in the next update.
Are you calling these functions on an actual entity or the class type. Seems like the latter which would give this behaviour.
Thanks, I will check it out. |
nice |
Is entity_activator_context necessary now that we have vscript? #3681 |
@Joshua-Ashton hey do you guys has this fixed right? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Could logic_eventlistener's Fetch Event Data functionality be backported aswell? 11/7/2022 Edit: It appears that the Fetch Event Data functionality does in fact exist in the latest version of the vscript-test branch. However, it doesn't appear in the FGD by default. |
Functions that stun and scare players (like on trigger_stun, for example) would be handy to have on the CTFPlayerShared class |
There's a script function called __CollectEventCallbacks which allows you to define OnGameEvent_x in any script scope and replicate the behavior of logic_eventlistener including fetching event data, and you can even define multiple events to listen to in one scope. |
Two small things I'll be bringing attention to:
This is based off the one from Left 4 Dead 2's list of vscript functions.
The following demonstrates this: ::labrat <- Entities.CreateByClassname("point_script_template")
::labrat.ValidateScriptScope()
local scope = ::labrat.GetScriptScope()
scope["dummythinker"] <- function()
{
return 1.0
}
AddThinkToEnt(::labrat, "dummythinker")
// ++ Print ++
// -----------
printl("SCRIPT ID: "+::labrat.GetScriptId())
printl("{")
__DumpScope(1, scope)
printl("}") The output would be something like this:
Would be appreciated if these were addressed. |
As a TF2 mapper, I'm not very familiar with VScript but will it be possible to remove existing attributes from weapons? Or give players weapons with completely custom stats, not just additional attributes. |
Linux dedicated server is still failing to start, |
It depends on whether Valve wants TF2 mappers to make inconsistent weapon behavior with the rest of the game on a specific map. It would be incredibly great for custom maps as a whole, but there's eventually gonna be that one mapper who completely changes every weapons' stats and tries to submit it to a seasonal map roster. And with how Wutville got in... |
There appears to currently be no way to respawn a player using vscript. Would you mind exposing ForceRespawn() or ForceRegenerateAndRespawn() to VScript? |
Ah, I meant calling it via entity. This was fixed in the most recent update. Thank you! |
Can confirm this, also occurs with __CollectEventCallbacks, the non-wrapper function for purely game events only as opposed to both script and game events with __CollectGameEventCallbacks |
Another HUD-related feature request. The ability to force Vanilla HUD on the client. A lot of players use Custom HUDs, and certain gamemodes might change the HUD so much, the best option would be to force the Vanilla HUD for that particular map. While HUD customization is important for many, there's a point at which one would prefer to play with Vanilla HUD on that particular map, instead of having their Custom HUD overlap with the gamemode's new HUD elements. |
Is there currently a way to grab somebody's steam name? honestly I wouldn't mind if it wasn't possible, just the implementation of Vscript itself is already God-sent. |
@MrSaturnGaming2002
There is no dedicated function, but you can grab a player's nickname through the Here is an example that prints the nickname of all players on the server to the console: local ply = null
while( ply = Entities.FindByClassname( ply, "player" ) )
{
local name = NetProps.GetPropString( ply, "m_szNetname" )
// Do stuff with the name…
printl( name )
} |
That actually works, I'm impressed. |
If possible, could some MVM populator stuff be made available? Pop files seem to be a very powerful tool but the only access to it Vscript has appears to be limited to the netprops for the enemies shown on the MVM hud, the name of the popfile, and standard CBaseEntity data for some populator related point entities. While in theory these limitations could be worked around by writing a pop file reader in vscript, that would be limited by FileToString()'s 16KB limit on files, which many base game pop files already go well over, not to mention the sheer work involved in trying to recreate a pop file reader when the game already has one. |
Feature request: A usecase example: triggers created from within vscript can only be rectangular, but a filter could allow to filter the players within a sphere. |
mini feature request: Edit: |
@Joshua-Ashton Is there a way to set the value of the underlying attribute classes directly without having to go through an attribute? (Eg like set_weapon_mode for example) If there isn't, would love if the ability to do so was added, since that would circumvent the troubles of defining custom attributes and all |
Saw in the Squirrel documentation (https://developer.electricimp.com/squirrel/squirrelcrib#program-control) that foreach is a thing but i can't find the function that gets me the player list. Do i have to use "Iterating Through Players" as noted in (https://developer.valvesoftware.com/wiki/TF2_VScript_Examples)?
|
[Important BUG] It seems like |
Bumping this thread solely for this one request: Please, add Currently Killfeed is covering my custom screen overlay and |
Feature request: if the respawn time goes above a certain number (perhaps, 500 seconds) it should get replaced with "Respawning is not available". |
Wanted to make Arena's Victory Panel appear mid-round. While you can make Normal Victory Panel appear mid-round by firing a |
Feature request: would like to see Alternatively/in addition would like to see a spawnflag for |
Feature request - I am not sure how feasible this is given the codebase, but being able to generate (and hook off of) entirely custom game events would be invaluable. Not only would this help code coordination across a map, but it would give an easy avenue for sourcemod plugins and vscript to interact with eachother. As far as I am currently aware, only existing game events can be created. |
Feature request. If custom VGUI support will be added, I can imagine people wanting to replace the class and team selection screens. There is no way to disable these menus and/or detect when a player wants to open a menu. |
mp_restartgame and mp_restartgame_immediate are vscript whitelisted cvars, while mp_restartround is not This cvar has a few differences compared to restartgame, notably it interacts with team_round_timer differently, and displays text on everyone's screen saying when the round will restart. |
Feature request: The ability to add |
Apologies, a file in a custom folder was taking priority without me realizing. |
RefillAmmo/RegenerateAmmo function, behaves identically to Regenerate() except does not refill health. Alternatively add a bool argument to Regenerate() to toggle this functionality. |
Bug: Using To be more specific, when you either use this command manually in the console or fire it from VScript code while waiting and seeing the timer go down, |
It'd be nice to be able to set |
The delay params on |
On a listen server with SourceTV enabled (tv_enable 1), there are various bugs with VScript global functions and console commands: Bug 1 (UTIL_GetListenServerHost):
Bug 2 (UTIL_IsCommandIssuedByServerAdmin):
The reason SendToConsole() is broken is because it relies on UTIL_GetListenServerHost(), which returns the player at a hard-coded entity index of 1. When SourceTV is enabled however, the STV bot will have ent index of 1, and the player 2. As a result, SendToConsole() has no effect on the actual player. Note: there are also console commands that use UTIL_GetListenServerHost() such as ent_fire or soundscape_flush which break with STV on the server. VScript console commands (script, script_execute, etc) are broken because of UTIL_IsCommandIssuedByServerAdmin() which returns false if the issuing client is > 1. Of course, currently this will always be false when SourceTV is on the server. Other console commands such as tf_bot_add or tf_bot_kick are also broken for the same reason. I would love to see these bugs addressed in a TF2 update 🙏 but in the meantime, if anyone finds it helpful here's a SourceMod plugin that detours these two functions as a fix: https://github.com/kstf2/stv-listen-server-fix |
|
Posting a laundry list of stuff here just so it's somewhere more permanent.
The bot_generator entity offers a few functions that would be nice to have access to for MvM:
I've been told these may be out of scope/will not happen but I will post them here anyway:
|
Hello! Today we are launching a beta branch of TF2 that has support for VScript in the
vscript_test
branch.This is a big issue to collate feedback from Mappers/Server Hosts for the TF2 implementation.
Instead of filing individual issues or feature requests, please post anything related to it in here. Thanks!
The text was updated successfully, but these errors were encountered: