English CS2D Bug Reports

1,898 replies
Goto Page
To the start Previous 1 2 ... 94 95 Next To the start
05.05.21 10:08:37 pm
Up
DC
Admin
Offline Off
@user ttoni: It's a bug. It wasn't possible earlier to change the resolution while being on a server. That's why that case isn't covered in scripting.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
05.05.21 10:14:56 pm
Up
SQ
Moderator
Offline Off
@user DC: It should be working...

There is clientsetting hook for event when player changes settings.
https://www.cs2d.com/help.php?hookcat=all&hook=clientsetting#hook

This is managed in n232_clientsettings.

I've just checked, client hook is properly executed.
For some reason player() variables are not updated though.
edited 3×, last 05.05.21 10:33:05 pm
09.05.21 04:03:02 pm
Up
Mami Tomoe
User
Offline Off
In the server logs, when a player says "rank" this is the output:
Code:
1
2
[14:00:32] Player *DEAD*
: rank


Which is not ideal, and should be fairly easy to fix.


Edit:
This is undocumented, but definitly should be.
The dedicated server apparently counts as a player (with ID 0), and when the server shuts down, it calls the leave hook with player ID 0, and reason 4 (server shutdown).

Here's the log:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
CS2D 1.0.1.1 Logfile - 10 May 2021, 12:42:50

[12:42:50] #######################################################
[12:42:50] Unreal Software's CS2D Dedicated Server
[12:42:50] > visit www.CS2D.com for info and updates <
[12:42:50] Game Version: 1.0.1.1
[12:42:50] Server Build for 1.0.1.1: 1.0
[12:42:50] System Time: 10 May 2021 - 12:42:50
[12:42:50] Operating System: Microsoft Windows
[12:42:50] #######################################################
[12:42:50] UDP socket initialized using port 36963
[12:42:50] U.S.G.N.: Your game version is up to date!
[12:42:50] Starting server...
[12:42:50] load map '!!'
[12:42:50] ----- Server started -----
[12:42:50] parsing Lua server script (mp_luaserver = 'server.lua')
[12:42:50] Lua: Adding function 'leave_hook' to hook 'leave'
[12:42:50] U.S.G.N.: Sending serverlist ADD-request...
[12:42:51] U.S.G.N.: Server added to serverlist
[12:42:59] recv join attempt... (0.0.0.0:00000)
[12:42:59] Mami Tomoe clientdata: WIN {abcdefghijklmnopqrstuvwxyzabcdefghijklm}
[12:43:00] recv join attempt... (0.0.0.0:00000)
[12:43:00] Mami Tomoe clientdata: WIN {abcdefghijklmnopqrstuvwxyzabcdefghijklm}
[12:43:00] U.S.G.N.: Mami Tomoe (0.0.0.0) joining with U.S.G.N. ID #99153 - verifying...
[12:43:01] U.S.G.N.: 0.0.0.0 is using U.S.G.N. ID #99153
[12:43:01] Mami Tomoe is using IP 0.0.0.0:00000, U.S.G.N. ID #99153 and no Steam
[12:43:17] Parse RCon (0.0.0.0:00000): quit
[12:43:17] Player #0 is leaving (code: 4).


And the script I used:
Code:
1
2
3
4
5
function leave_hook(p, reason)
     print('Player #' .. tostring(p) .. ' is leaving (code: ' .. tostring(reason) .. ').')
end

addhook('leave', 'leave_hook')


I had no other code running, I'm sure anyone can replicate this.

Steps:
• Start a dedicated server running that Lua script.
• Join the server and using Remote Control, parse cs2d cmd quit.
• Check your latest log file.

> Note:
This also means player IDs don't get called using reason 4 (server shutdown).
They just time out with "Connection Problems", instead of being notified the server was shutting down.
Logs of players not being notified of server shutdown:
Code:
1
2
3
4
5
6
[12:49:18] Parse RCon (0.0.0.0:00000): bot_add_t
[12:49:18] Parse RCon (0.0.0.0:00000): bot_add_ct
[12:49:18] Parse RCon (0.0.0.0:00000): bot_add_t
[12:49:18] Parse RCon (0.0.0.0:00000): bot_add_ct
[12:49:23] Parse RCon (0.0.0.0:00000): quit
[12:49:23] Player #0 is leaving (code: 4).

I added a few bots, and was present on the server, and neither of us disconnected automatically.
This works fine (most of the times) through the listen server!

Does player ID 0 mean "everyone"?
If so, that's a weird way to do it.
edited 2×, last 10.05.21 11:51:35 am
fish
10.05.21 12:57:37 pm
Up
mrc
User
Offline Off
user DC has written:
Blurry sprays are a known issue. From my experience it can always happen. Even without any transfers or server mods. I still don't know why it happens sometimes.


thats because the resolution, the only resolution that sprays looks normal is 850x480 and the olders with 4:3 aspect ratio.
CS2DBR @ Comunidade Brasileira de CS2D | https://www.cs2dbr.com
10.05.21 08:23:45 pm
Up
Cure Pikachu
User
Offline Off
user mrc has written:
thats because the resolution, the only resolution that sprays looks normal is 850x480 and the olders with 4:3 aspect ratio.

I could have swore I had that problem even at those resolutions. Only way I "fixed" it with my sprays is give the bits that are meant to be transparent only like 98% black instead of fully black.
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
10.05.21 08:37:38 pm
Up
DC
Admin
Offline Off
I'm also pretty sure that the spray logo problem already existed when there was only the good old 640x480 resolution.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
24.05.21 12:07:31 am
Up
Mami Tomoe
User
Offline Off
STEAM bans don't work properly.

Here's why and how:

When the server STEAM bans a player, it will save them as a STEAM ban internally (similar to temp bans):
IMG:https://cdn.discordapp.com/attachments/733262868778319942/846146153673654272/unknown.png


When the server changes map, the STEAM ban will remain in the cache, but a U.S.G.N. ban (that uses the STEAM ID) will be appended:
IMG:https://cdn.discordapp.com/attachments/733262868778319942/846146616238669824/unknown.png


But when the server closes, and starts again, the STEAM ban will not be loaded, because both bans will now become one and overwrite each other, leading to just having the U.S.G.N. ban:
IMG:https://cdn.discordapp.com/attachments/733262868778319942/846145493956296704/unknown.png


I'm not sure when or how this part happens, but at some point the ban number will overflow and corrupt (as STEAM IDs are of the type
ulong
but U.S.G.N. IDs are of the type
uint
).

I hope this will be fixed, otherwise banning STEAM players permanently will not be possible (without the help of Lua scripts).


EDIT:
It appears that CS2D allows a round to end while a round is initialising, it looks like this:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- round going on as normal

[17:46:31] [!] Round is ending

[17:46:36] * Auto Teambalance *
[17:46:36] [>] ERROR changed team from Terrorist to Counter Terrorist
[17:46:36] [>] Player 3 died to <Custom Kill> on 643|339

[17:46:36] [!] Round is ending
[17:46:36] [!] Round is initialising
[17:46:36] [!] Round started

-- players chatting

[17:46:41] [!] Round is initialising
[17:46:41] [!] Round started


Can be somewhat simulated using this:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function startround_prespawn_hook(_)
     print'startround_prespawn'
     parse('endround')
end

function startround_hook(_)
     print'startround'
end

function endround_hook(_)
     print'endround'
end


addhook('startround_prespawn', 'startround_prespawn_hook')
addhook('startround', 'startround_hook')
addhook('endround', 'endround_hook')


I don't think you should be able to call cs2d cmd endround before the cs2d lua hook startround hook was called.
edited 1×, last 24.05.21 06:10:13 pm
fish
24.05.21 08:05:48 pm
Up
DC
Admin
Offline Off
Regarding steam bans: Uh that sounds bad. Will take a look.

Regarding the other thing:
CS2D in general has basically zero protections against bad/stupid scripts which break things in horrible ways. I won't start adding safeguards because that would be a huge and never ending task. It's up to the script developer to take some care while writing scripts and to prevent stuff from being executed at the wrong time.

I mean.. executing endround in a startround hook is just plain nonsense. There are infinite comparable scenarios. I can't block all of them.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
24.05.21 08:43:49 pm
Up
Mami Tomoe
User
Offline Off
@user DC, all you need to do, is add a boolean value that won't let a round end while it's already ending.

This can be caused by more than just bad scripts, it can be caused by big scripts that have a lot of logic and timers.

This is just like you can't end a round after it already ended, the difference is, that safeguard doesn't work on the startround prespawn.
edited 1×, last 30.05.21 09:33:57 pm
fish
24.05.21 09:25:53 pm
Up
DC
Admin
Offline Off
You didn't get my point. It wouldn't be complicated to prevent it in this special case. The thing is that there are maaaany other cases that also allow illegal/pointless operations which potentially break the game. If I start blocking stuff I would have to consequently block all the pointless/bad stuff and try to prevent that erroneous scripts can break the game. That would take forever / it's not a realistic that I would ever finish that task.

Therefore I prefer the "it's the user's fault. please don't do nonsense!"-approach. Problem solved. √
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
30.05.21 08:38:28 pm
Up
Mami Tomoe
User
Offline Off
@user DC: Well, I added a script that won't let my Lua end the round as it's already ending.

It works (to fix the examples I've previously given), but this still happens:
Code:
1
2
3
4
5
6
7
8
[20:29:32] [!] Round is ending
[20:29:33] [>] ......................... changed team from Spectator to Counter Terrorist
[20:29:38] [>] uns.bshkn died to <Custom Kill> on 686|335
[20:29:38] [!] Round is ending
[20:29:38] [!] Round is initialising
[20:29:38] [!] Round started
[20:29:43] [!] Round is initialising
[20:29:43] [!] Round started


It's rare, but it happens.
I don't know what exactly causes it, but it always (?) has the following pattern:
End > End > Init > Start > Init > Start


I don't know if this is related to Lua anymore (which it might be, but I don't know if Lua is to blame, this seems like an internal problem the more I look at it).

In my Lua, there is no way for the cs2d cmd endround command to get called between the cs2d lua hook endround hook and the cs2d lua hook startround hook, because I added a boolean check, and tested it.

Legend:
• Round ending - cs2d lua hook endround
• Round initialising - cs2d lua hook startround_prespawn
• Round started - cs2d lua hook startround

My diagnosis:
It appears that the player dying causes the round to end again while it's already ending.
Checking the tile position it shows that the tile the player died on, is a deadly tile covered by a dynamic wall of a floor type.

And the order appears to be as follows:
> ...
> Reset all entities
> (I don't know if anything happens here)
> Move (living) players to spawn position
> ...

While it should probably be something like this:
> Move (living) players to spawn position
> Reset all entities

This is because the player died to the toxic floor that was being removed by the server, due to it resetting the map entities, and that probably caused the round to end, because that player was probably the last in their team.

[UNTESTED, FROM MEMORY:]
A similar thing also happens with the VIP on assassination maps:
> Round ending due to all Ts dying (CT Win is announced)
> VIP dying to anything (T Win announced)
That leads to two round ending calls.

This creates a huge mess in my script, that relies on accurate round ending/starting calls.

All of this can be fixed by a simple boolean check.
But I do recommend changing the order of a round initialisation, so players won't die to dynamic walls getting triggered.


EDIT:

I've already sent this, but you can see it live here (old video, but same effect): Download

You also posted this:
user DC has written:
Execution order when a new round starts:
• auto team balance
• adjust scores (depending on end of previous round)
• free all dynamic objects
• reset the map (clear items, reset entities, clear particles, run trigger start, spawn items/npcs/buildings)
• run cs2d lua hook startround_prespawn
• clear old hostages & spawn new hostages
• spawn players (and run cs2d lua hook spawn for each right after spawning)
• run cs2d lua hook startround
• reset/start bot AI
• optionally trigger an automatic map change if conditions are met

And no, that order isn't perfect. It just grew like that and it worked so that's why there is that order.


Let me focus on the fact that reset the map happens before spawn players (which I'd suppose, also moves the living players).
This WILL lead to players dying while this process is ongoing, and it was just now, proven to cause issues.

I REALLY hope this will be fixed, I REALLY don't want to have to script something to avoid problems from unreliable hooks.


EDIT:
I created a reproduction map, it's quite easy to reproduce the issue and to see what the issue is: Download
And here's the game-play of the map, in case that's all you need: YouTube


EDIT:
I've been thinking of a clever way to fix this, and I think the best way is to separate moving living players from spawning dead players, just have the stage where you move the living players get executed prior to the map resetting.
This and adding a boolean check for the round logic, should make fix this problem quite easily, I'd say.
I tried to do that using Lua, but the round ending does not have a consistent delay time, so I can't manipulate the game into letting me teleport the players, unless I only let players have 3 seconds and have them stand in a black box for another two, which is not very fun.


EDIT:
Unrelated to all of the above:
The
winrow_t
and
winrow_ct
parameters for the cs2d lua cmd game command, will always return 0.
That is, unless I'm missing something.
If that is a bug, I have a request for that feature, the integer should reset on a Game Commencing or Round Restart event.
Also, on the documentation for that command, it says that numbers are returned as strings, but they're not.


EDIT:
I decided to include most of what I previously reported, as I'm fairly certain these were not fixed, so here are the bugs, again:

> It is possible to name yourself as
®
.
Which breaks chat and Lua when attempting to use your name.

> NPCs aren't always set to the right rotation on round start, don't know what's causing this and if it's on the listen server as well.

-- I don't know if this was fixed:
> Fix projectile weapons on dedicated servers, they leave the weapon image behind even when picked and they show above the player.

> The rotation doesn't affect hostages because every round start they get a random rotation, add a tick box that will control whether they should be randomly rotated or not.

> Player names with only one character will NOT show up in the leader board and will instead appear as
???
.

> HUD Text elements still appear above the chat text box.
The chat box should appear on top of the HUD Texts, and possibly fade away any HUD Texts below it by a small amount until the chat box is closed.

> STEAM IDs aren't included in cs2d cmd listplayers.

> Bug with the Mods in CS2D:
When a server sets a priority to two mods for example
Code:
1
2
[X] Mod #1
[X] Mod #2

(X signaling selected)
The host will retain that priority, but any clients joining the server will have the priority reversed.
Therefore, the bottom is the prioritized, rather than the top.

> There's a bug with the MVP calculation and rewarding:
https://youtu.be/HEa50loXJe0
The MVP would be declared for defusing the bomb regardless of whether they did or not, it will be based on their frags for the round.

> cs2d cmd spawnitem won't use the
ammoin
for items that stack (Snowball, Mine, ETC.), while it should.

Either change that, or add a third parameter "count" for stacked items.

cs2d cmd setammo doesn't care about the said above either, this is quite a problem for me, as I want to equip a given amount of grenades(/ETC.).

> When a CS2D listen server shuts down, most of the times, it will send a "server shutting down" signal to all connected players, it's not exactly reliable, but the real issue is that dedicated servers don't do that at all.
A dedicated server will instead "disappear" and everyone would just timeout.

> It appears as though when a player fails at joining the server (for a reason such as a different map), the cs2d lua hook connect and cs2d lua hook join hooks won't be called, but the cs2d lua hook leave will.

> In the server logs, when a player says "rank" this is the output:
Code:
1
2
[14:00:32] Player *DEAD*
: rank


> It's also possible for the above to apply to name changes, and IIRC, player/map voting.
Code:
1
2
[00:00:00] Player changes name to
 Player (AFK)


A long one one. >


EDIT:
I think I found out why assists are sometimes given to the wrong player.
Similar to the way the bomb rewarding works, if the player (assistant) leaves the game, and someone takes their ID, that someone will be eligable for the assist.

EDIT:
IMG:https://cdn.discordapp.com/attachments/434982221405880320/852654765683114014/unknown.png

This sometimes happens when you join servers that use spritesheets.
It has no impact.
edited 17×, last 10.06.21 11:07:26 pm
fish
23.06.21 06:20:59 am
Up
After changing the host on the server, complete bullshit began to occur.

Sometimes you can see an attempt to enter rcon in the logs.

Sometimes something else is in the logs.

Sometimes the round time on the server changes to a negative number. (We just have unlimited time, but sometimes it changes)

And sometimes a player with an incredibly long nickname and an incomprehensible USGN id "joins".

Also sometimes round "restarts" but localy for random player. Btw, all the things that I listed above do not happen to everyone, but to a random player.

P.S. I added all screenshots but this website told me what i cant post links (to screenshots from discord.) so i will remove them...
23.06.21 12:06:53 pm
Up
2Gen
User
Offline Off
@user leramoros:
there are screenshots for this post

this one is funny and super weird
pic1 >

pic2 >

pic3 >

pic4 >
edited 1×, last 23.06.21 06:54:24 pm
27.06.21 11:59:08 am
Up
Mami Tomoe
User
Offline Off
Don't know if it's intended but the mouse coordinates given by the cs2d lua cmd player function will be set as
-1, -1
in if the player hasn't moved their mouse in a while.
I suggest returning the last known coordinates instead, as returning
-1, -1
may cause some scripts to act up, if they weren't designed to counter that.

It would also be possible, as an alternative to that, to document that as a feature.


EDIT:
os.millisecs()
will return a negative value if the server had been up for too long (possibly overflow).
I would suggest capping it at a certain count, and having something like
os.millisecscount()
which would count the amount of times the cap had been reached.

Though, simply resetting back to 0, can also work.
Or, give us the ability to reset the counter back to 0 ourselves with
os.resetmillisecs()
.
edited 1×, last 30.06.21 03:22:41 pm
fish
30.06.21 07:02:29 pm
Up
SQ
Moderator
Offline Off
user Mami Tomoe has written:
Don't know if it's intended but the mouse coordinates given by the cs2d lua cmd player function will be set as
-1, -1
in if the player hasn't moved their mouse in a while.
I suggest returning the last known coordinates instead, as returning
-1, -1
may cause some scripts to act up, if they weren't designed to counter that.

It would also be possible, as an alternative to that, to document that as a feature.

Current system gives more information than your suggestion.
This change would also break more existing scripts (including one of mine)

You can make a wrapper that would return last non negative position.

If I remember correctly, spectator mouse can be disabled - that also returns negative values in Lua.

Current behaviour is not a bug and is documented.


Regarding milliseconds..
You can also write a wrapper for what you are asking as well.
That takes just a few lines.

@user 2Gen: @user leramoros:
Could be caused by clock overflow. I haven't seen anything like this though.
15.07.21 01:51:35 pm
Up
Mami Tomoe
User
Offline Off
Temporary bans are cleared on server shutdown, that is because they're not saved into the
bans.lst
file.

I would suggest to save the temporary bans to the file as well, perhaps add cs2d cmd sv_cache_temp_bans to prevent confusion.
The save should initiate on execution (whenever the entry is added) and on server shutdown (to save however many seconds were left for the ban).

This of course, won't keep track of offline time.
But that is why I suggested cs2d cmd sv_cache_temp_bans.

This would be useful for whoever wants to read more than just permanent bans from the file.


EDIT:
Code:
1
2
3
4
5
6
-- Lua: Adding function 'voice_test' to hook 'voice'
function voice_test(...)
     print('voice called')
     print(...)
end
addhook('voice', 'voice_test')

This script does not seem to work at all.
When I use the voice chat, the hook never gets called.
edited 4×, last 23.07.21 01:46:12 pm
fish
24.07.21 11:11:42 am
Up
DC
Admin
Offline Off
@user Mami Tomoe: are you using the latest version? As far as I remember I did a fix for the voice hook quickly after the release without changing the version number. I never tested that feature though so it's very possible that it's still broken even with the latest version.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
24.07.21 07:56:16 pm
Up
Mami Tomoe
User
Offline Off
@user DC, I just finished re-downloading CS2D, and I tried to use the hook once more.

It does not work for me.
fish
25.07.21 05:17:36 pm
Up
If you change the hud color, then everything will be ok until you will get a bomb (possibly defuse also for CT) or until you have armor or Kevlar armor.

images:
(put links in browser)

Spoiler >

Spoiler >
To the start Previous 1 2 ... 94 95 Next To the start