Forum

> > CS2D > General > CS2D Bug Reports
Forums overviewCS2D overviewGeneral overviewLog in to reply

English CS2D Bug Reports

2,057 replies
Page
To the start Previous 1 280 81 82102 103 Next To the start

old Re: CS2D Bug Reports

DC
Admin Off Offline

Quote
@user Mami Tomoe: I need to be able to reproduce this scenario otherwise I can't tell if my changes help or not. How do you get the value you're displaying there?

Also, hint:
Whenever executing CS2D commands with parse do NOT add quotes unless they are needed. Those quotes in your code don't add any value and make reading and parsing more difficult.

The following should work as well and is better. If it doesn't work you probably only need quotes around "fire".
1
parse('effect fire '..px..' '..py..' 2 28 255 255 255')

old Re: CS2D Bug Reports

Mami Tomoe
User Off Offline

Quote
1
2
3
4
5
collectgarbage()
addhook('always','RPG.alwaysHook')
function RPG.alwaysHook()
	msg(math.floor(collectgarbage('count')))
end

@user DC:

old Re: CS2D Bug Reports

Mami Tomoe
User Off Offline

Quote
Loops that last beyond the amount of time the hook has to run will cause a leak.

Anything that will make the second hook's function take longer than a second to finish will leak more RAM, scales with hook and amount of times it happens.

This happens for ALL hooks but is only noticeable in timed ones.

move and movetile are also affected (scale with players' movement speed).

EDIT:
Weird workaround (doesn't completely fix it but I think it helps):

1
2
3
4
5
6
7
8
9
10
11
12
local exampleHookFinished = true
addhook('example', 'exampleHook')
function exampleHook()
	if not exampleHookFinished then
		return
	end
	exampleHookFinished = false

	--CODE HERE

	exampleHookFinished = true
end

This SHOULDN'T allow the hook to be called unless it has finished it's last call, not good for time related activities but decent for things that don't have to be perfect such as monster movement.

Still, there has to be a better way of doing this.


How about adding a paremeter to the
addhook
function that will ask whether to call the hook even if it hadn't finished it's last call?
edited 2×, last 17.03.19 10:23:49 pm

old Re: CS2D Bug Reports

DC
Admin Off Offline

Quote
@user Mami Tomoe: That doesn't make any sense to me. CS2D is not multithreaded. Therefore it is technically impossible to call a hook again before it is finished. Any Lua script execution entirely stops CS2Ds core game logic execution until the Lua execution finished.
Hooks with a return value wouldn't work at all otherwise (because CS2D needs the return value to continue).

So your code should never reach the return statement in line 5. Try adding a debug message there to verify if it is reached or not.

Maybe you added the function to the same hook multiple times? Or added it to multiple different hooks? Or are calling the hook function manually from another place?

old Re: CS2D Bug Reports

Mami Tomoe
User Off Offline

Quote
Yes it seems like you're right, then either I've noticed wrong or I dunno what is happening at this point.

All I know is that long multiple loops cause leaks.

If you want to take a look at the script I have Discord

EDIT:
The bug doesn't appear to leak cs2d_dedicated rather only the client is affected.
Might have something to do with images.
edited 2×, last 18.03.19 04:51:54 pm

old Re: CS2D Bug Reports

DC
Admin Off Offline

Quote
I guess someone made a mistake with a server launcher script or something here. No idea who's responsible for the servers. If they aren't gone till tomorrow I'll blacklist the IP.
(this is definitely no CS2D bug)

old Re: CS2D Bug Reports

DC
Admin Off Offline

Quote
That's impossible. The U.S.G.N. doesn't accept multiple different entries for the same IP+port combo. If you try to add more than one server with the same IP+port the existing entry will simply be replaced.
See http://www.unrealsoftware.de/usgn.php?s=cs2d
All ports are different.

old Re: CS2D Bug Reports

Varna97
User Off Offline

Quote
Exactly. Ports cannot be the same. Either my CS2D bugged out or something else is going on.

old Re: CS2D Bug Reports

DC
Admin Off Offline

Quote
@user Hajt: You are right. Flag rendering is indeed broken. Will push a hotfix for Steam Win in a few minutes.

Edit: 1.0.0.8 p2 to address the flag issue is online (Win only! Via Steam, zip or installer)
edited 1×, last 23.03.19 12:34:27 pm

old Re: CS2D Bug Reports

Mami Tomoe
User Off Offline

Quote
Using the spawnprojectile command to throw a weapon will leave the weapon's sprite even after the weapon had finished animating.

That doesn't happen to a NEWGAME client for some reason... Try that on dedicated.

old CS2D crashing

Salat1K
User Off Offline

Quote
The game crashes after startup

> i double-click the game.... game starts loading..... stops loading on "initializing Steam". Then crashes and an error pops up: "FATAL ERROR Error reading application id. Please either write to steam_appid.txt or use the launcher.
> Also after closing the popup a new one appears: "Windows exception EXCEPTION_ACCESS_VIOLATION", and my pc freezes for a sec.
> I am using a windows xp (nonsteam version of the game)
Please fix us
(yes, i already googled something about this problem but it still crashes and freezes)
I hope this get fixed soon

old Re: CS2D Bug Reports

DC
Admin Off Offline

Quote
@user Salat1K: I can't reproduce this issue. I used the zip version to test (http://www.unrealsoftware.de/get.php?get=cs2d_1008_win.zip) and it worked fine. Did you use the setup or the zip version?

Was Steam running while you tried? If yes try again with Steam quit.

Otherwise: How did you start the game? By double clicking CS2D.exe directly? What files are in the same folder as CS2D.exe? Is there a "steamstub.dll" and a "steam_api.dll"?

Also note that Windows XP is not receiving patches any more and using it is a huge security risk. I highly recommend to upgrade to a newer Windows version!

old Re: CS2D Bug Reports

Salat1K
User Off Offline

Quote
@user DC:
> I used the setup version. This morning the game was working absolutely fine, no clue why the game started doing this
> If Steam was running while i tried to open the game ? No, i dont use Steam + i dont have it installed (you actually cant play Steam games on an win xp anymore )
> How did i start the game ? By double clicking CS2D.exe and i also tried it with the Launcher.exe
> Yeah, i know that win xp is old, but i really dont want to upgrade to a newer version (I HATE win 7,8 and 10)
> Do i have "steamstub.dll" and a "steam_api.dll" ? Yes, every single file that is saw this morning is in the CS2D folder.
The game was updated about 22 days ago so i dont think it is a problem with my game version (maybe)

old Re: CS2D Bug Reports

DC
Admin Off Offline

Quote
Okay weird. I'm afraid I can't really fix this as I can't reproduce the problem locally. Try a reboot. If this doesn't help try reinstalling CS2D. Also stop all programs you don't need and which may cause problems with CS2D.

Win XP is nearly 20 years old. If you have a single file on your system that is private/important or if you're entering any important data (like banking, credit card, ...) on it you HAVE to upgrade. Windows XP is not safe and it's very likely that you already have spyware/viruses on your system. I mean.. upgrading isn't really optional at this point. It's just too dangerous to keep using XP (trust me, I'm a software engineer )

old Re: CS2D Bug Reports

Salat1K
User Off Offline

Quote
@user DC:

> I re-downloaded the game (This time i used the zip version)
> This time steam_api.dll is missing. Lol i have no clue what is going on anymore
us Btw sorry if im bothering you with useless junk or spamming the forums but i really like the game and i really want to play it.
(English is not my first language )
edited 1×, last 14.04.19 06:20:00 pm
To the start Previous 1 280 81 82102 103 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview