EventScripts-Emulator
EventScripts-Emulator copied to clipboard
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
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
The change I'm referring to is one: https://github.com/Ayuto/EventScripts-Emulator/commit/3f326be4d285292359c088787c0073eab5605a85
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
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
--------------------------------------------------------
I'm unable to reproduce the issue with the following test code:
block load
{
es_setinfo x 444
es_delayed 1 es_msg without es command: 123 server_var(x)
es_delayed 1 es es_msg with es command: 123 server_var(x)
}
Output:
es_load estest1
[EventScripts] Loaded estest1
without es command : 123 444
with es command : 123 444
Manually entering it in the server console:
es_delayed 1 es_msg without es command: 123 server_var(x)
without es command : 123 444
es_delayed 1 es es_msg with es command: 123 server_var(x)
with es command : 123 444
Please try to give a minimalistic example that reproduces the issue.
Yes, naturally you wont have any issues or bugs testing our these commands as they are already built-in EventScripts commands.
The issue that I reported is about custom commands t hat are not already built-in to the EventScripts Emulator, but the commands are Source-Python commands and does work with the emulator as long as you just don't use es_delayed
event player_spawn
{
es_delayed 1 wcs_setfx speed event_var(userid) = 2.5 0
}
Under normal circumstances prior to the implemented change, or when using the change above, then this will cause the player to run at a 250% speed. But after the implemented change and with the current code the emulator is using it will not execute anything behind the es_delayed 1 in the example code. It'll only execute it if we add an "es" after the delayed value and before the next command.