Git Product home page Git Product logo

eventscripts-emulator's People

Contributors

ayuto avatar cookstar avatar manifestmanah avatar nosferatujoe avatar thapwned avatar xiazee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eventscripts-emulator's Issues

CS:GO Popup exception

Using this code in CS:GO:

event player_say
{
    es popup create test_popup
    es popup addline test_popup "This is a test"
    es popup addline test_popup "->1. Test"
    es popup addline test_popup "->2. Test"
    es popup addline test_popup "0. Exit"
    es popup send test_popup event_var(userid)
}

Results in this exception:

[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 543, in recache
    self.cache[userlang] = self.i_recache(userlang)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 599, in i_recache
    mode=msglib.VguiMode.MENU)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\msglib.py", line 26, in __init__
    self.kv['title'] = title
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\keyvalues.py", line 154, in __setitem__
    es.keypsetstring(self._id_, str(name), str(value))
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es_C.py", line 2080, in keypsetstring
    raise TypeError
TypeError

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "..\addons\source-python\plugins\es_emulator\logic.py", line 103, in __call__
    es.addons.callBlock(self.block_name)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es.py", line 356, in callBlock
    self.Blocks[blockname]()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\popup\popup.py", line 169, in consolecmd
    p.send(playerlib.getUseridList(users),prio)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 256, in send
    user.handleQueue()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 1419, in handleQueue
    menudisplay = qpopup.checkCache(self.userid)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 635, in checkCache
    self.recache(userid)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 548, in recache
    for user in users:

TypeError: 'int' object is not iterable

es_give not able to give both hpk2000 & usp_silencer

If you have the usp_silencer equipped in the csgo loadout it'll not be possible to give yourself an hpk2000, same thing the other way around. This is probably a CSGO thingy that is not fixable but yet I can drop a deagle AND a revolver, which is the same principle?

I just tested the same thing with m4a1 & m4a1_silencer, works fine. The issue only seems to occur with the usp_silencer & hkp2000

es_delayed and es_soon with TypedServerCommand

It appears es_delayed and es_soon does not work nicely with a TypedServerCommand that accepts a sub-command.
Using the following test code:

from commands.typed import TypedServerCommand

@TypedServerCommand('worky')
def worky_command(command_info, *args:str):
    print('yay', *args)

@TypedServerCommand(['noworky', 'arg'])
def noworky_command(command_info, *args:str):
    print('yay', args)

I get the following result (first is just the command, second is together with es_delayed, and finally es_soon):

worky
yay
worky args
yay args
noworky arg
yay ()
noworky arg args
yay ('args',)

es_delayed 0.1 worky
yay worky
es_delayed 0.1 worky args
yay worky args
es_delayed 0.1 noworky arg
Sub command "noworky" not found.
es_delayed 0.1 noworky arg args
Sub command "noworky" not found.

es_soon worky
yay
es_soon worky args
yay
es_soon noworky arg
A sub-command is required:
  noworky arg [*args:str]
es_soon noworky arg args
A sub-command is required:
  noworky arg [*args:str]

sp info returns (test is the test code above):

IMPORTANT: Please copy the full output.
--------------------------------------------------------
Checksum      : 8bb86a7c1ac4d8043a00a3b8f3a7a404
Date          : 2019-07-30 21:00:02.537542
OS            : Windows-8.1-6.3.9600-SP0
Game          : css
SP version    : 691
Github commit : 4d827210579479b15ac622e04ebd6cbde6143594
Server plugins:
   00: Source.Python, (C) 2012-2019, Source.Python Team.
SP plugins:
   00: es_emulator, https://github.com/Ayuto/EventScripts-Emulator
   01: test
--------------------------------------------------------

prop_dynamic_create [Spawns error model]

When using the command prop_dynamic_create to spawn a prop it will always result in a huge error model being spawned no matter if you are using the .mdl at the end or not and no matter which model path you are trying to use.

Code used to test this:

block prop_dynamic_create
{
	es_prop_dynamic_create event_var(userid) models/props/de_nuke/cinderblock_stack.mdl
	es_msg This should spawn a prop_dynamic entity
}

block prop_dynamic_create
{
	es_prop_dynamic_create event_var(userid) models/props/de_nuke/cinderblock_stack
	es_msg This should spawn a prop_dynamic entity
}

Playerset model bug

When you use the playerset model command it will set the player model to the intended model, so this part works flawlessly.

But if you later wish to change the player's model then using the command again the model will not be changed, and the same goes if you use it on any other player in the game. The first model that is being applied to someone on the server will be the model that is added to everyone the playerset model command is used on afterwards.

An example would be that I apply a barrel model to player1 and thereafter I apply a zombie model to player2.
Player 1 will now look like a zombie and player two will also look like a zombie, although he was supposed to look like a zombie and the path would refer to the zombie model.

Code used for testing:

block model_barrel
{
	es playerset model event_var(userid) props_c17/oildrum001
	es_msg this is supposed to be a barrel model
}

block model_actual_zombie
{
	es playerset model event_var(userid) models/player/zombie
	es_msg this is supposed to be a zombie model
}

block model_pigeon
{
	es playerset model event_var(userid) pigeon
	es_msg this is supposed to be a pigeon model
}

Exception list

2021-02-09 14:08:18 - sp	-	DEBUG	Setting up the "sp" command...
2021-02-09 14:08:18 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/packages/site-packages/mutagen/id3/_specs.py', line 666: DeprecationWarning
    invalid escape sequence \s

2021-02-09 14:08:18 - sp	-	DEBUG	Hooking function: type=PRE, addr=4093241264, conv=CDECL, args=(_memory.DataType.POINTER, _memory.DataType.INT, _memory.DataType.INT, _memory.DataType.BOOL), rtype=BOOL, callback=<function _pre_set_client_listening at 0xedd13fa4>
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientDisconnect.__init__<<function _on_client_disconnect at 0xedc3cdf4>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientDisconnect.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	Hooking function: type=PRE, addr=4092131616, conv=CDECL, args=(_memory.DataType.POINTER, _memory.DataType.POINTER, _memory.DataType.STRING), rtype=VOID, callback=<function _pre_client_command at 0xedaaedf4>
2021-02-09 14:08:18 - sp	-	DEBUG	OnLevelEnd.__init__<<function _level_end at 0xedab1fa4>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnLevelEnd.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	Setting up auth...
2021-02-09 14:08:18 - sp	-	DEBUG	Setting up user settings...
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientDisconnect.__init__<<function on_player_disconnect at 0xede00224>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientDisconnect.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	Repeat.__init__: <<function _radio_refresh at 0xede0b02c>> <()> <{}>
2021-02-09 14:08:18 - sp	-	DEBUG	Repeat.__init__: <<function _esc_refresh at 0xede0b074>> <()> <{}>
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientDisconnect.__init__<<function on_player_disconnect at 0xede0b14c>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientDisconnect.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	Setting up entities listener...
2021-02-09 14:08:18 - sp	-	DEBUG	Setting up versioning...
2021-02-09 14:08:18 - sp	-	DEBUG	Pre-loading libsqlite3.so.0...
2021-02-09 14:08:18 - sp	-	MESSAGE	[SP] Loading plugin 'adaptive_radar'...
2021-02-09 14:08:18 - sp	-	DEBUG	OnNetworkedEntityCreated.__init__<<function on_networked_entity_created at 0xee83b854>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnNetworkedEntityCreated.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	Hooking function: type=PRE, addr=4092132160, conv=CDECL, args=(_memory.DataType.POINTER, _memory.DataType.POINTER, _memory.DataType.INT, _memory.DataType.POINTER), rtype=VOID, callback=<function _pre_send_user_message at 0xee717bfc>
2021-02-09 14:08:18 - sp	-	MESSAGE	[SP] Successfully loaded plugin 'adaptive_radar'.
2021-02-09 14:08:18 - sp	-	MESSAGE	[SP] Loading plugin 'es_emulator'...
2021-02-09 14:08:18 - sp	-	DEBUG	OnLevelInit.__init__<<function on_level_init at 0xecf0841c>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnLevelInit.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	OnNetworkidValidated.__init__<<function on_network_id_validated at 0xecf08464>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnNetworkidValidated.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientSettingsChanged.__init__<<function on_client_settings_changed at 0xecf084ac>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientSettingsChanged.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	OnQueryCvarValueFinished.__init__<<function on_query_cvar_value_finished at 0xecf084f4>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnQueryCvarValueFinished.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	OnTick.__init__<<function on_tick at 0xecf0853c>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnTick.__init__ - Registering
2021-02-09 14:08:18 - sp	-	DEBUG	OnLevelInit._unload_instance - Unregistering <<function on_level_init at 0xecf0841c>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnNetworkidValidated._unload_instance - Unregistering <<function on_network_id_validated at 0xecf08464>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnClientSettingsChanged._unload_instance - Unregistering <<function on_client_settings_changed at 0xecf084ac>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnQueryCvarValueFinished._unload_instance - Unregistering <<function on_query_cvar_value_finished at 0xecf084f4>>
2021-02-09 14:08:18 - sp	-	DEBUG	OnTick._unload_instance - Unregistering <<function on_tick at 0xecf0853c>>
2021-02-09 14:08:18 - sp	-	EXCEPTION	
[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/plugins/command.py", line 164, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "../addons/source-python/packages/source-python/plugins/manager.py", line 207, in load
    plugin._load()
  File "../addons/source-python/packages/source-python/plugins/instance.py", line 76, in _load
    self.module.load()
  File "../addons/source-python/plugins/es_emulator/es_emulator.py", line 42, in load
    from . import cmds
  File "../addons/source-python/plugins/es_emulator/cmds.py", line 24, in <module>
    from .logic import cfg_scripts
  File "../addons/source-python/plugins/es_emulator/logic.py", line 423, in <module>
    default_event_registration()
  File "../addons/source-python/plugins/es_emulator/logic.py", line 188, in default_event_registration
    if not register_for_event_file('../hl2/resource/gameevents.res'):
  File "../addons/source-python/plugins/es_emulator/logic.py", line 223, in register_for_event_file
    events = KeyValues.load_from_file(file_name)

ValueError: Failed to load from file.


2021-02-09 14:08:18 - sp	-	MESSAGE	[SP] Plugin 'es_emulator' was unable to be loaded.

Hit Group - Knife attacks returning 0

As I was working on a new character of my own, I believe I might've stumbled upon a bug.
The script that I am working on is supposed to deal additional damage to the victim if a certain hitgroup is hit, the character in this case can only wield knives.

As I was creating the skill I noticed that the event_var(hitgroup) always return the value 0, if the weapon used to inflict the damage is a knife. Below is a code to replicate this.

event player_hurt
{
	es_msg This is hitgroup: event_var(hitgroup)
}

I am using the newest version of the Emulator.
Are there any chance of a fix for this? This working would have a huge impact on what I am trying to create :-)

es playerset model event_var(userid) doesn't work properly

Whenever assigning a model you will not be able to overwrite it with another model unless you restart the server.

So if I assign a spiderman model to a player, I can't change it to a zombie model, unless the server restarts. In that case the last assigned model will load properly onto the player.

Problems with Es_delayeds execution of commands

I have gotten a few reports of cases from WCS users where certain parts of the skills would not work.
These skills were working for me when I tested them. Today I updated my Emulator to the most recent version and I am now experiencing the same issue as the other users.

It turns out, that using es_delayed followed by a command will cause that command to not be executed.
But if you do es_delayed followed by es and then followed by the command, then the command will be executed.
Although this doesn't seem to apply to certain built-in eventscripts commands, this seems to break a lot of custom commands outside of eventscripts.

This is of course not ideal, but it apparently has been like this for a long time. But it hasn't been as noticeable because in the past it has been this way but only when executing the commands through the server console.
But with the change you made the 10th of April this year, it changed it around so the problem wasn't occurring in the server console anymore, however, it instead started occurring in every script. Meaning that all scripts using es_delayed would need to be changed to es_delayed es instead in order for them to be executed.

The change I'm referring to is one:
3f326be

I have changed my own server's addons/source-python/plugins/es_emulator/eventscripts/esc/cmds/run.py back to what it was prior to the update as seen below:

import gamethread, esc
from gamethread import queue, delayed
from .. import stack
from ..val import sv, FLOAT, VAR
from . import Command
import es

@Command(syntax='<variable>', types=VAR, desc='Just runs a command-string inside of the variable.')
def commandv(argv):
  stack.insertrawline(sv(argv[0]))
  
@Command(argsfrom=2, syntax='<seconds> <commandstring>', types=FLOAT, desc='Will run <commandstring>, after <seconds> seconds.')
def delayed(argv, args):
  gamethread.delayed(argv[0], stack.queueline, (argv[1], argv[2:], args, esc.stack.currentblock, True))

@Command(syntax='<commandstring>', desc='Adds a command to the end of the command queue.')
def soon(argv, args):
  queue(stack.queueline, (argv[0], argv[1:], args, esc.stack.currentblock, True))

@Command(syntax='<file>', desc='Runs an exec file from memory.')
def old_mexec(argv):
  es.old_mexec(*argv)

This does mean that I cannot use es_delayed without adding an additional es to the console when I wish to do some testing that involves delays, but the alternative is that a lot of scripts will break, which will affect every player on the servers.
So, in my opinion, this is definitely the lesser of two evils, and I would recommend changing it back to this as well, at last until a full fix is found, as it is far less damaging.

I am running the newest version of Source-Python, and the Emulator and Warcraft-Source.

--------------------------------------------------------
Checksum      : 3a539eb78239fc93f8f6f382d3c397df
Date          : 2020-08-01 12:18:11.622719
OS            : Linux-4.15.0-88-generic-x86_64-with-debian-stretch-sid
Game          : csgo
SP version    : 699
Github commit : 7e06ce8e445e17425dfcecdad5895473c294fabc
Server plugins:
   00: Source.Python, (C) 2012-2020, Source.Python Team.
   01: Metamod:Source 1.10.7-dev
SP plugins:
   00: es_emulator, https://github.com/Ayuto/EventScripts-Emulator
   01: es_emulator_events
   02: wcs, 2020.07.31-4, https://forums.sourcepython.com/viewtopic.php?f=7&t=1925
   03: commandsx
--------------------------------------------------------

Usermsg error

I receive this error when trying to run:

usermsg.fade(userid, 0, 2, 1, 240, 240, 240, 100)

2017-12-02 10:55:08 - sp	-	EXCEPTION	
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\plugins\es_emulator\logic.py", line 97, in __call__
    es.addons.callBlock(self.block_name)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es.py", line 356, in callBlock
    self.Blocks[blockname]()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds\__init__.py", line 110, in concommand
    stack.queue([line], 'console', priority=True)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\__init__.py", line 32, in queue
    self.run()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\__init__.py", line 120, in run
    self.command(command, argv, args, exp)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\__init__.py", line 189, in command
    command.run(argv, args, exp)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds\__init__.py", line 140, in run
    self.method(**_args)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds\addons.py", line 88, in doblock
    es.doblock(block)
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 171, in wrapper
    return func(c)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es_C.py", line 545, in doblock
    es.addons.callBlock(argv.arg_string)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es.py", line 356, in callBlock
    self.Blocks[blockname]()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\ultimates\ultimates.py", line 72, in wcs_ulti_chain
    usermsg.fade(userid, 0, 2, 1, 240, 240, 240, 100)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\usermsg.py", line 46, in fade
    __sendMessage(users, 'fade')
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\usermsg.py", line 199, in __sendMessage
    if es.exists('userid', userid): es.usermsg('send', name, userid)
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 171, in wrapper
    return func(c)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es_C.py", line 2800, in usermsg
    data.send(argv[3])
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 535, in send
    self._write(buffer, type_name, value)
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 547, in _write
    buffer.write_short(atoi(value))

AttributeError: 'ProtobufMessage' object has no attribute 'write_short'

Cyrillic

i cant load some es scripts with russian charracters
example
es_test.txt

error:
[console] es_load: 'charmap' codec can't decode byte 0x98 in position 11: character maps to undefined

ConCommand called via ES function not being executed fully during certain events. (CSGO)

eventscripts code:

event player_spawn
{
    es  wcs_disable_attack event_var(userid) 0
    es_msg [ESS] disable attack: event_var(userid) (Event Spawn)
}

sourcemod code for registerd ConCommand:

public OnPluginStart()
{
    RegServerCmd("wcs_disable_attack", DisableAttack_CMD);
}

public Action:DisableAttack_CMD(args)
{
    PrintToChatAll("Disable Attack Command Callback.");
    return Plugin_Handled;
}

Reproduce the bug by running both of these scripts and executing "mp_restartgame 1" multiple times. If you wait around 20 seconds and execute it again, then it stops calling the callback function and printing the message on player spawn event. After this point you don't have to wait 20 seconds between "mp_restartgame 1" calls, as it will fail to call the function "fully" everytime until the es_reload plugin is ran.

I say it's not "fully executed" because the callback isn't ran. However sourcemods command listener will see the command and all its args executed (via print logger). I'm unsure what's causing it inside of the eventscripts emulator as i haven't had time to look.

WorkAround:
Add spoof to the begining of the command arg string when executing ConCommands via ES.

event player_spawn
{
    es spoof wcs_disable_attack event_var(userid) 0
    es_msg [ESS] disable attack: event_var(userid) (Event Spawn)
}

Sourcemod Plugin:
This plugin will run the command via sourcemod and issue the callback 100% of the time.

#include <sourcemod>
#include <sdktools>

public Plugin myinfo =
{
	name = "EventScripts Emulator Command Push Proxy",
	author = "backwards",
	description = "...",
	version = "1.0",
	url = "http://steamcommunity.com/id/mypassword"
};

public OnAllPluginsLoaded()
{
	RegServerCmd("spoof", Spoof_CMD);
	
	AddCommandListener(Commands_CommandListener);
}

public Action:Commands_CommandListener(client, const String:command[], argc)
{
	if (client < 1)
	{
		decl String:f_sCmdString[256];
		GetCmdArgString(f_sCmdString, sizeof(f_sCmdString));
		
		if(StrEqual("spoof", command, false))
		{
			ReplaceString(f_sCmdString, 256, "spoof ", "", false);
			ServerCommand(f_sCmdString)
			PrintToServer("Spoofer Found Command %s", f_sCmdString);
			return Plugin_Handled;
		}
	}

	return Plugin_Continue;
}

public Action:Spoof_CMD(args)
{
	return Plugin_Continue;
}

events

It seems that the events do not work right now.

Using this:

event player_spawn { es_msg ASDF }

Does not result in anything.

Blocks work fine on the other hand, but the blocks do not expand event_var()s.

Unable to load emulator (SP Update)

For some reason I can't get the emulator to load. I've updated SP using "sp update", after this I tried a full reinstall of SP using this source: http://downloads.sourcepython.com/

Still having the same issue.

2021-02-09 14:08:18 - sp	-	EXCEPTION	
[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/plugins/command.py", line 164, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "../addons/source-python/packages/source-python/plugins/manager.py", line 207, in load
    plugin._load()
  File "../addons/source-python/packages/source-python/plugins/instance.py", line 76, in _load
    self.module.load()
  File "../addons/source-python/plugins/es_emulator/es_emulator.py", line 42, in load
    from . import cmds
  File "../addons/source-python/plugins/es_emulator/cmds.py", line 24, in <module>
    from .logic import cfg_scripts
  File "../addons/source-python/plugins/es_emulator/logic.py", line 423, in <module>
    default_event_registration()
  File "../addons/source-python/plugins/es_emulator/logic.py", line 188, in default_event_registration
    if not register_for_event_file('../hl2/resource/gameevents.res'):
  File "../addons/source-python/plugins/es_emulator/logic.py", line 223, in register_for_event_file
    events = KeyValues.load_from_file(file_name)

ValueError: Failed to load from file.


2021-02-09 14:08:18 - sp	-	MESSAGE	[SP] Plugin 'es_emulator' was unable to be loaded.

[EventScripts Emulator] Not Loading On Windows.

I have been assisting a friend of mine in trying to set up a new Warcraft-Source server.
We have successfully installed MetaMod, the newest version of Source-Python, and when we added the most recent version of the Emulator (Downloaded: 13.07-2020) it wasn't able to load.

My friend's server is running the Windows operating system and although he experienced issues I have not experienced the same running it on any of my Linux servers in the past, so it leads me to believe it is a pure Windows related problem.

Below are the errors we received from the server console when attempting to install the Emulator on the Windows server.

[SP] Loading plugin 'es_emulator'...
 
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\plugins\command.py", line 164, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "..\addons\source-python\packages\source-python\plugins\manager.py", line 194, in load
    plugin._load()
  File "..\addons\source-python\packages\source-python\plugins\instance.py", line 74, in _load
    self.module = import_module(self.import_name)
  File "..\addons\source-python\plugins\es_emulator\es_emulator.py", line 6, in <module>
    import muparser
 
ImportError: DLL load failed: The specified module could not be found.
 
 
[SP] Plugin 'es_emulator' was unable to be loaded.

This is the version of Source-Python we are using on the Windows server:

IMPORTANT: Please copy the full output.
--------------------------------------------------------
Checksum      : c677ef51b35a70ce8d7a95bf476c21c1
Date          : 2020-07-14 12:38:43.416087
OS            : Windows-10-10.0.17763
Game          : csgo
SP version    : 698
Github commit : 2c9c421a280e5f7dce861af9bf1f31d8c08ab2c7
Server plugins:
   00: Metamod:Source 1.10.7-dev
   01: Source.Python, (C) 2012-2020, Source.Python Team.
SP plugins:
   00: wcs, 2020.07.03-1, https://forums.sourcepython.com/viewtopic.php?f=7&t=1925
--------------------------------------------------------

es playerset model prop client crash after death

Using es playerset model with a prop causes all player clients to crash on that player's death.
So using this causes client crashes on death: es playerset model USERID models\props_c17\oildrum001.mdl

Segmentation fault crash (+ crashdump)

I've noticed that whenever I run ONLY wcs & emulator, in this order;
sp plugin load es_emulator
sp plugin load wcs

that the server tends to crash 1-2 times a day with a segmentation fault error. I also let wcs run solely to see if it would crash but that did not happen, hence I'm pretty sure that it's an issue in the emulator.

At the moment I'm using the sourcemod's accelerator to obtain a crash dump file for the crashes that happen, so for now it's a waiting game. Whenever I retrieve the crash dump I'll include it into this issue.

After next crash I'll run emulator alone and see if it also crashes after a certain amount of time, that way I can be sure that it's 100% an issue with the emulator.

PS: YES I already disabled sourcemod/metamod to see if this caused the crash, which didn't, so I isolated it to the emulator.

KeyError 'settings' regarding weaponlib update

Error:
[SP] Loading plugin 'wcs'...

[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\plugins\command.py", line 164, in load_plugin
plugin = self.manager.load(plugin_name)
File "..\addons\source-python\packages\source-python\plugins\manager.py", line 207, in load
plugin._load()
File "..\addons\source-python\packages\source-python\plugins\instance.py", line 74, in _load
self.module = import_module(self.import_name)
File "..\addons\source-python\plugins\wcs\wcs.py", line 196, in
from .core.helpers.esc.monkeypatch import cmd_manager # Just to load it
File "..\addons\source-python\plugins\wcs\core\helpers\esc\monkeypatch.py", line 28, in
from .commands import format_message
File "..\addons\source-python\plugins\wcs\core\helpers\esc\commands.py", line 91, in
from playerlib import Player as PLPlayer
File "..\addons\source-python\plugins\es_emulator\eventscripts_libs\python\playerlib.py", line 5, in
import weaponlib
File "..\addons\source-python\plugins\es_emulator\eventscripts_libs\python\weaponlib__init.py", line 230, in
currentgame = getGameWeapons(es.getGameName()) or NoWeaponManager(es.getGameName())
File "..\addons\source-python\plugins\es_emulator\eventscripts_libs\python\weaponlib\init.py", line 212, in getGameWeapons
settings = ini['settings']
File "..\addons\source-python\packages\site-packages\configobj.py", line 554, in getitem
val = dict.getitem
(self, key)

KeyError: 'settings'

[SP] Plugin 'wcs' was unable to be loaded.

This error appears after latest update.

Temp solution provided by @ThaPwned:
if you're still having that issue, you can modify the addons/source-python/plugins/es_emulator/eventscripts/_libs/python/weaponlib/csgo.ini file by changing [properties] to [settings] .

Thanks in advance!

Playerset model [Client side game crash]

When using the playerset model command to change a player's model to something that aren't designed for players to play as, such as a stack of cinderblocks, a barrel, or the likes then when the player dies his game will crash. This is not a server crash, but purely a client side crash, this will with 100% certainty happen to the player who has the model set, but will also happen to everyone else who is looking at or in the direction of the player with the model.

Aside from when the player dies, everything else works just perfect even despit the models used might be missing multiple animation sequences it still causes zero crashes, at least from our testing so far.

I've asked around, and found out that this can be fixed by merely changing the player's model back to it's original one (or any of the default player models) just prior to the player's death occuring.

Model Issue (Supposed to be error)
Model Issue Crow
Model Issues

[es_tell wcs_centertell]Characters cannot be displayed after translation

https://github.com/ManifestManah/Racepack-Standard/blob/master/addons/source-python/plugins/es_emulator/eventscripts/wcs/tools/standard/archmage_proudmoore/es_archmage_proudmoore.txt#L50

es wcs_centertell event_var(userid) event_var(es_attackername) struck you with his earthquake!

change it to

es wcs_centertell event_var(userid) event_var(es_attackername) 震撼了你!

it seems that wcs_centertell / es_centertell /es_tell l Unable to use Chinese Translation

playerset color

Due to es_mathparse not beeing available using playerset color will result in the playermodel to completely vanish. Killing the player while vanished will crash the client (not the server).

es_stopsound

es_stopsound does not seem to do anything. If I currently have a sound playing and I wish for it to stop playing using the es_stopsound it won't stop the sound that is playing.

This is the code I am using in my block:
es_playsound event_var(userid) ambient/atmosphere/city_skypass1.wav 1.0
es_delayed 1.5 es_stopsound ambient/atmosphere/city_skypass1.wav

I have also tried other versions, of the stopsound, inserting userids, adding 1 at the end etcetera, just to be sure the syntax wasn't just changed from the original.
Hopefully this is possible to fix :-)

(The game I tested it on was CS:GO)

es_playsound,es_emitsound

Playing sounds in CS:GO does not work.
I'm not sure about this, but the SourcePython wiki says, that in CS:GO StreamSound class is needed to use sounds.

Source Python Errors

Initializing EventScripts...

[SP] Encountered a Warning:
File '..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds_init_.py', line 77: DeprecationWarning
inspect.getargspec() is deprecated, use inspect.signature() or
inspect.getfullargspec()

Command alias already exists.
[EventScripts] Loaded esc
ES Emulator has been loaded successfully!
[SP] Successfully loaded plugin 'es_emulator'.
Network: IP 192.168.1.111, mode MP, dedicated Yes, ports 27015 SV / 27005 CL

[SP] Encountered a Warning:
File '..\addons\source-python\plugins\es_emulator\eventscripts\esc\parse.py', line 62: DeprecationWarning
generator 'getcommands' raised StopIteration

[corelib/interfaces/register 232] es_foreachval: Unable to retrieve a pointer of this object.
[SP] Loading plugin 'wcs'...

[SP] Encountered a Warning:
File '..\addons\source-python\packages\site-packages\path.py', line 1713: DeprecationWarning
path is deprecated. Use Path instead.

[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[console] es: Syntax: es
[SP] Successfully loaded plugin 'wcs'.

Problems with: es usermsg fade

When I type in the usermsg fade command and apply it to my userid (12) then I encountered an error.

rcon es usermsg fade 12 1 150 50 55 125 55 200

[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/plugins/es_emulator/logic.py", line 103, in __call__
    es.addons.callBlock(self.block_name)
  File "../addons/source-python/plugins/es_emulator/eventscripts/es.py", line 356, in callBlock
    self.Blocks[blockname]()
  File "../addons/source-python/plugins/es_emulator/eventscripts/_libs/python/cmdlib.py", line 172, in callbackServer
    cmd_manager.callback(cmd_manager.server_commands, es.getargv(0))
  File "../addons/source-python/plugins/es_emulator/eventscripts/_libs/python/cmdlib.py", line 111, in callback
    cmdlist[name].execute(self.CMDArgs(es.getargv(x) for x in range(1, es.getargc())))
  File "../addons/source-python/plugins/es_emulator/eventscripts/_libs/python/cmdlib.py", line 206, in execute
    self.callback(args)
  File "../addons/source-python/plugins/es_emulator/eventscripts/corelib/usermsglib/usermsglib.py", line 30, in usermsg_cmd
    usermsg.fade(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8])
  File "../addons/source-python/plugins/es_emulator/eventscripts/_libs/python/usermsg.py", line 54, in fade
    Color(red, green, blue, alpha),

Boost.Python.ArgumentError: Python argument types in
    Color.__init__(Color, str, str, str, str)
did not match C++ signature:
    __init__(_object*, unsigned char r=0, unsigned char g=0, unsigned char b=0, unsigned char a=255)


L 01/24/2018 - 20:10:15: rcon from "62.107.68.109:63208": command "es usermsg fade 12 1 150 50 55 125 55 200"
 Date          : 2018-01-24 19:20:55.598770
 OS            : Linux-4.9.13eorfix-x86_64-with-debian-8.10
 Game          : csgo
 SP version    : 633
 Github commit : d9f2cd6567c0d86303b4cade575af1d0b4af463a
 Server plugins:
    00: Source.Python, (C) 2012-2018, Source.Python Team.
 SP plugins:
    00: es_emulator, https://github.com/Ayuto/EventScripts-Emulator
    01: wcs

CS:S Popup exception

When using this code in Counterstrike Source:

event player_say
{
    es popup create test_popup
    es popup addline test_popup "This is a test"
    es popup addline test_popup "->1. Test"
    es popup addline test_popup "->2. Test"
    es popup addline test_popup "0. Exit"
    es popup send test_popup event_var(userid)
}

The menu shows ingame but I get this exception:

[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\plugins\es_emulator\logic.py", line 318, in on_tick
    es.addons.tick()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es.py", line 291, in tick
    x()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\gamethread.py", line 169, in tick
    _executenode(first)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\gamethread.py", line 151, in _executenode
    function(*a, **kw)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 1550, in refreshPopup
    return self.updatePopup(p)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 1542, in updatePopup
    self.handleQueue()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\popuplib.py", line 1452, in handleQueue
    es.event("setint","popup_display","userid",self.userid)
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 206, in wrapper
    return func(c)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es_C.py", line 907, in event
    _current_event.set_int(value_name, atoi(value))

AttributeError: 'NoneType' object has no attribute 'set_int'

If I try to close the menu, it just reappears when the repeat happens with the exception.

Edit:

If I use es_load popup in CS:GO I get this error in the console:

es_load popup CGameEventManager::AddListener: event 'popup_display' unknown. CGameEventManager::AddListener: event 'popup_select' unknown. [EventScripts] Loaded popup

Mabye that might be the case in CS:S too and the cause for the NoneType in the exception above

error after update

2021-06-12 13:56:43 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\es_emulator\eventscripts\es.py", line 284, in triggerEvent
self.EventListeners[eventname]listener
File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\addon.py", line 33, in call
self.run(priority=True)
File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\addon.py", line 28, in run
stack.queue(self.code, self.name, priority, userargs)
File "..\addons\source-python\plugins\es_emulator\eventscripts\esc_init_.py", line 32, in queue
self.run()
File "..\addons\source-python\plugins\es_emulator\eventscripts\esc_init_.py", line 120, in run
self.command(command, argv, args, exp)
File "..\addons\source-python\plugins\es_emulator\eventscripts\esc_init_.py", line 189, in command
command.run(argv, args, exp)
File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds_init_.py", line 140, in run
self.method(**_args)
File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds\maths.py", line 57, in math
_math_operators[op](val, emulate_datatype_overflow(NUM(val2))))

ZeroDivisionError: division by zero

Cyrilic

Hey. es_emulator es_tell produces hieroglyphics instead of Russian, tried utf8 with bom, no bom
example:
es_tell userid #multi "#lightgreen damage server_var (wcs_dmg)"
on server:
hieroglyphs server_var (wcs_dmg)

Shell does not execute command

I've been trying to execute est_effects via the sourcemod plugin "wcs_effects" https://forums.alliedmods.net/showthread.php?t=139816

This works:

import es
def player_say(ev):
	loc = es.getplayerlocation(ev['userid'])
	loc2 = loc
	es.server.queuecmd("es est_effect 3 #a 0 sprites/tp_beam001.vmt %s %s %s %s %s %s 5 5 10 255 0 0 255" % (loc[0],loc[1],loc[2],loc2[0],loc2[1],loc2[2]+100.0))

This does not:

event player_say
{
	es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 event_var(userid)
	es_getplayerlocation wcs_x2 wcs_y2 wcs_z2 event_var(userid)
	es_math wcs_z2 + 100.0
	es est_effect 3 #a 0 sprites/tp_beam001.vmt server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2) 5 5 10 255 0 0 255
}

It seems that the shell version does have some issues here.

Popup Menu doesn't seem to be working

While working on my own mod that relies on the Eventscript Emulator I ran in to an issue with the popup system.
I already have es_load popup added to my autoexec.cfg and I have tried to create the popup menus in a few different ways. One of the ways I tried was using the example for creating popups that can be found on ES:S website.
(Example code posted below)

block load
{
	popup create TestMenu
	popup addline TestMenu "Choose your drink:"
	popup addline TestMenu "->1. Water"
	popup addline TestMenu "->2. Juice"
	popup addline TestMenu "->3. Milk"
	popup addline TestMenu "->4. Coffee"
	popup addline TestMenu "0. Close"

	popup menuselect TestMenu popupt/chosen
}

event player_say
{
	if (event_var(text) == "!drink") do
	{
		es popup send TestMenu event_var(userid)
	}
}

block chosen
{
	if (server_var(_popup_choice) == 1) then es_tell server_var(_popup_userid) You chose Water!
	if (server_var(_popup_choice) == 2) then es_tell server_var(_popup_userid) You drink Juice!
	if (server_var(_popup_choice) == 3) then es_tell server_var(_popup_userid) Milk is good for you!
	if (server_var(_popup_choice) == 4) then es_tell server_var(_popup_userid) Coffee might ruin your sleep!
	if (server_var(_popup_choice) > 4) do
	{
		if (server_var(_popup_choice) < 10) do
		{
			es_tell server_var(_popup_userid) You should have chosen an option between 1 and 4...
		}
	}
}
 
block unload
{
	popup unsendname TestMenu #all
	popup delete TestMenu
}

When I attempted to test this code I did locate it in the directory eventscripts/popupt, having a file named es_popupt.txt and I loaded the file prior to the testing. The popup menu would not appear, and I received no errors in my server's log file, nor anything in the source.python log directory.

Invalid escape sequence

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/exp/exp.py', line 55: DeprecationWarning
    invalid escape sequence \:

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/exp/exp.py', line 265: DeprecationWarning
    invalid escape sequence \(

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/exp/exp.py', line 265: DeprecationWarning
    invalid escape sequence \)

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \^

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \$

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \*

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \+

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \?

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \.

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \|

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \[

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \]

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \{

2021-02-16 12:10:40 - sp	-	WARNING	
[SP] Encountered a Warning:
  File '../addons/source-python/plugins/es_emulator/eventscripts/corelib/escinject/escinject.py', line 9: DeprecationWarning
    invalid escape sequence \}

es playerget primary and secondary

Hi! I am trying to get the primary or secondary player's weapon. I'm getting errors.

block load
{
    es_xset secondary_variable 0
    es_xset primary_variable 0
}

event player_jump
{
    es playerget primary primary_variable event_var(userid)
	es playerget secondary primary_variable event_var(userid)
    es_msg server_var(primary_variable) is the primary weapon!
	es_msg server_var(secondary_variable) is the secondary weapon!
}

image

Executing too many cheat commands results in client getting kicked

Kick message: #GameUI_Disconnect_TooManyCommands

Temporary workaround:

from cvars import cvar
from commands.server import ServerCommand
from engines.server import queue_command_string

sv_quota_stringcmdspersecond = cvar.find_var('sv_quota_stringcmdspersecond')
if sv_quota_stringcmdspersecond is None:
    raise Exception('Fix is not required for this game.')

old_value = sv_quota_stringcmdspersecond.get_string()

@ServerCommand('ent_fire')
def on_ent_fire(command):
    sv_quota_stringcmdspersecond.set_string('99999')
    queue_command_string(f'sv_quota_stringcmdspersecond {old_value}')

This needs to be improved, because of:

  1. DOS attacks if sv_cheats is enabled
  2. Also needs to be done for the other cheat commands like es.give, es.entcreate, etc.
  3. It's ugly

ES_Emulator crashes CS Source

I'm trying to run this with Warcraft mod and many races. I have checked every other plugin one by one but at end of the day if I disable ES_Emulator game runs fine. But of course, if I disable it then none of the race at warcraft mod works. The game shuts down without any error messages. I can run the game for only a few rounds maximum but sometimes even the game crashes on the first round. I play only with bots. Here is my investigation:

WCS simply doesn't work for me.
I have installed python source, WCS, es emulator, WCS: Essentials, then I installed shopmenu and all available races and put them into races.ini one by one. then Configured autoexec.cfg by this order:

sp plugin load es_emulator
sp plugin load wcs
sp plugin load commandsx
es_load wcs/tools/wcs_essentials
es_load wcs/loaders/itempack_shopmenu
es_load wcs/loaders/racepack_damakex
.....es_load every other race.....

I also put some configuration commands to autoexec.cfg as I play with bots as it says from wcs_essentials readme:

sv_disable_immunity_alpha 1 //Fixes multiple issues with invisibility skills in CS:GO
sv_quota_stringcmdspersecond 200 //Fixes issues where clients would be kicked for issueing too many commands when using extensive ultimates
sv_infinite_ammo 0
sv_ignoregrenaderadio 1
sv_allow_wait_command 1
sv_pure 0
sv_forcepreload 0
rcon mp_respawn_immunitytime 0 //Removes CS:GO's built-in spawnprotection to make respawning more balanced and less exploitable
mp_free_armor 0 //Makes players spawn with 0 armor to make races with armor skills stay relevant
mp_round_restart_delay 5
mp_autokick 0

Everything is working, bots using every random race, using abilities, levelling up. But the major issue that this last only a few rounds and then the game crashes shut down without any error message. I thought the issue is some races so I started to disable races one by one and find out if the game won't crash. I end up disabling every race and the game still crashes after a few rounds. I end up removing everything from autoexec.cfg and left only:

sp plugin load es_emulator
sp plugin load wcs

But the game still crashes after few rounds. So if I remove sp plugin load wcs or sp plugin load es_emulator the game won't crash again. If I put every plugin and race into autoexec.cfg except es_emulator then the game doesn't crash anymore but then none of the race is working because es_emulator is not loaded. But if I load it the game crashes after few rounds. Is this a known issue?

es playerget viewcoord [Spawns Error Model]

The command playerget viewcoord has an issue with it.
If you try to get two set of coordinates to work with as shown below, then instead of fetching the location data it will spawn one big error model in the map where the player stands.

NOTE: This issue does not happen if you only use one line of playerget viewcoord though, but if you use two this happens and it's guranteed.

This was tested on a server only running source-python and the emulator on the game CS:GO.

Code used for testing:

block load
{
	es_xset location_x 0
	es_xset location_y 0
	es_xset location_z 0
	
	es_xset location_x2 0
	es_xset location_y2 0
	es_xset location_z2 0
}

event player_hurt
{
	es playerget viewcoord event_var(attacker) location_x location_y location_z
	es playerget viewcoord event_var(attacker) location_x2 location_y2 location_z2
}

playerget viewcoord error

csgo's weaponlib needs updating

MP5SD is missing from csgo's weaponlib, not sure if there are any other new weapons that they've added.
If I knew how to retrieve all the info, I'd gladly create a PR for you :)

server_var() int conversion

es_xset test_var 10_10_10
es_msg server_var(test_var)

This will message 101010 instead of 10_10_10.
If there are only _ and int numbers it will remove the _

if there is any other string included it will keep the original structure

Edit: It seems that _ is actually part of the integer class,

playerget primary & secondary

When trying to obtain the data stored in the variable using the command playerget primary or playerget secondary then the variable will always return 0.

Running the latest emulator, latest version of source-python and was tested on a server only running source-python and the emulator.

Code used for testing this:

block load
{
	es_xset secondary_variable 0
	es_xset primary_variable 0
}

event player_spawn
{
	es_delayed 1 playerget secondary secondary_variable event_var(userid)
	es_delayed 1 playerget primary primary_variable event_var(userid)
	es_delayed 1.5 es_msg server_var(wcs_z3) is the primary weapon 
	es_delayed 1.5 es_msg server_var(wcs_z4) is the secondary weapon
}

playerget primary   secondary

event_vars switching mid block

Hey,

I noticed behavior that was different to the original EventScripts.
When I deal damage in a player_hurt event to the damaging player the event_vars will mid event
This example shows what I mean

event player_hurt
{

	if (event_var(weapon) != point_hurt) do

	{

		es_msg event_var(attacker)
		es wcs_dealdamage event_var(attacker) event_var(userid) 5
		es_msg event_var(attacker)

	} 

}

When shooting a bot event_var(attacker) will first contain my userid then after doing damage to me by the bot with a point hurt (that is what wcs_dealdamage does) event_var(attacker) will return the bot's userid.

I kinda understand where that problem might be coming from, but the event_vars should not change mid event I think.

Late precache error when using es_fire

Whenever I'm using smokestacks & es_fire commands which includes a .vmt, I get a late precache at map start. The fire.vmt in this case has been added to the download & precache table using a sourcemod plugin.

The .vmt's work fine when using "es est_effect", this only occurs when using the es_fire command.

Code used:

es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 event_var(userid)
	es est_effect 10 #a 0 sprites/lgtning.vmt server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) 80 300 4.5 128 10 0 128 0 255 255 20
    es_xmath wcs_smokestack_counter + 1
	es_give event_var(userid) env_smokestack
	es_format ss_name "my_ss_%1%2" event_var(userid) server_var(wcs_smokestack_counter)
    es_entitysetvalue server_var(eventscripts_lastgive) "targetname" server_var(ss_name)
    es_fire event_var(userid) server_var(ss_name) addoutput "basespread 15"
    es_fire event_var(userid) server_var(ss_name) addoutput "spreadspeed 100"
    es_fire event_var(userid) server_var(ss_name) addoutput "speed 5"
    es_fire event_var(userid) server_var(ss_name) addoutput "rate 200"
    es_fire event_var(userid) server_var(ss_name) addoutput "startsize 15"
    es_fire event_var(userid) server_var(ss_name) addoutput "endsize 25"
    es_fire event_var(userid) server_var(ss_name) addoutput "twist 15"
    es_fire event_var(userid) server_var(ss_name) addoutput "jetlength 900"
	es_fire event_var(userid) server_var(ss_name) addoutput "angles 90 90 90"
    es_fire event_var(userid) server_var(ss_name) addoutput "rendercolor 128 0 255"
    es_fire event_var(userid) server_var(ss_name) addoutput "SmokeMaterial particle/fire.vmt"
	es_fire event_var(userid) server_var(ss_name) turnon
    es_delayed 4.5 es_fire event_var(userid) server_var(ss_name) kill

Console error:
Mar 20 20:24:36: Late precache of particle/fire.vmt

playerset viewcoord

I was testing playerget and playerset viewcoord with this code:

event player_say
{
	if (event_var(text) = "test") do
	{
		es playerget viewcoord event_var(userid) wcs_x1 wcs_y1 wcs_z1
			}
	if (event_var(text) = "test2") do
	{
		es playerset viewcoord event_var(userid) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1)
	}	
}

playerget viewcoord returns the same results as Player.view_coordinates.

But playerset viewcoord does not set it to the location it should.

getting the location

setting the location

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.