English Map Editor Bug - 3 Million Coordinates

3 replies
Goto Page
To the start Previous 1 Next To the start
• Hi im the one who created this map for years and i accidentally discovered a bug, or i created it, i didn't posted at bug reports section because i need a solution to delete it, instead of updating a cs2d.
This map

• What did you do why the bug is found ? :
     welp its crazy, really, its a trick for cs2d mappers, whenever i program a triggers entities (Trigger_delay, once, if), i use notepad
     and replace the notes to just copy paste on entities, meanwhile, i didn't mean to do that. i have delay realized when copying
     a note from notepad then just have space from it.

     i copy-pasted to entities, saved the map, the result is wierd.

• What does the bug do ?
     the result of last saved map, deleting half the entites you've created at last save, and the triggers of delay had set to over 50000 seconds
     remade all of them and solved the bug, but there was last thing that hard to delete, i tested the map and it spawned at the nowhere
     and it has a steady rain sprites going on, idk where coordinates of map so i used one thing.

• Why 3 Million coordinates ?
     i used the tile mapper at samples of lua at "sys/lua/samples/tilemapper.lua" good thing i used that to detect coordinates. this is the
     result of coordinates

     look at that, how do i supposed to go there and delete it !?, there's no way of shortcut, and also it does not only CT entity, and T spawn too
     they are only two errored entites i can't seem to delete it, so i posted this and that's why,

> The solution i think is the best, is to jump the camera to exact coordinates of map editor, just like the valve hammer map editor.
second solution is have a key to go through entities one by one by depth, or delete only these entities like delete all CT spawn not just "Ctrl Shift Del"
i feel sorry for the map i did, and i didn't mean to create it, i don't want to re-create the map instead, i wasted all my hardworks, or copy the entity
one by one. please developers help me. i need to finish this map without bugs.


P.S the title was supposed to be map editor problems, it invalid
Its been a year since i last play cs2d

Admin/mod comment:

Moved to Maps/Editor section. /DC
15.11.18 05:10:14 pm
Offline Off
I reported this in thread cs2d CS2D Bug Reports previously, and I made a script that fixes such glitch spawning.

Just like you state in the thread, it happens when you copy-paste any sentence with lines.

I would suggest you use this Line break site however if it is possible, do not put the lengthy Lua script files in it just use the individual script for the map.
Putting scripts in Trigger_If will just make the map file bigger.

Also, this script will fix the issue
     for _,e in pairs(entitylist()) do

          if (entity(e.x,e.y,"typename") == "Info_T" or entity(e.x,e.y,"typename") == "Info_CT" ) then
               if ( e.x > map("xsize") or e.y > map("ysize") ) then
               parse("triggerposition "..e.x.." "..e.y)
               print("\169255255255Found glitched spawn point - "..e.x.."|"..e.y)

The script causes small lag after execution. It took like 0.6 seconds in a map with over 9000 entities.

Don't forget to make it executable in every round, otherwise, it won't disable glitched spawn points!
Lastest upload : file cs2d fix the collecting (0)
15.11.18 05:32:38 pm
Offline Off
Unfortunately copy&pasting line break characters into any editor text field (which is stored as text) will corrupt your map file. Luckily the entities are saved very last in the map file. So loading may still work but all entities after an entity with line break characters in its values will be corrupted (missing/weird values/replaced with "random" other entities at "random" positions).

When you only saved the map ONCE (before it was broken) you can fix the issue with a text or hex editor by removing the wrong new lines (e.g. search for the text you copy&pasted).

If you however loaded the already corrupted map in the editor and saved it AGAIN, data will be reformatted and you will lose information. The only way to rescue parts of the map then is to remove all entities after the first one with corruption.

There are no tools in the editor to jump to certain positions or anything. You can however use a hex editor to manipulate the broken entity positions so they are in sane positions again. This isn't a trivial task though and requires some understanding of data types etc.
The map format is described in all detail here:

This issue will be fixed in CS2D I will simply strip all new line characters from all copy&pasted text to prevent such problems. This will only prevent future corruptions though.
edited 1×, last 15.11.18 05:43:40 pm
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
16.11.18 06:17:47 am
Thanks @user DC: to future implementations at and also to @user Oops321: for solution

This thread will be closed and deleted after released
maybe if other people have encountered this bug and affected on
maps with their hardworks

EDIT : the depth of thousands of entities and oversized that map editor can't handle it, i hope it would won't error on future updates of cs2d.

EDIT2: After all the editing and discovering of how to delete the glitch entity, i used the HxD Editor like @user DC: said and, i tried every day, i spent a week to know how do i delete, while i was using HxD

finally made it, but, the some entities malfunctioned and deleted where the error began.

@user Oops321: seems to be work but some entities still cannot removed
edited 2×, last 21.11.18 03:19:04 am
Its been a year since i last play cs2d
To the start Previous 1 Next To the start