Samapico Posted January 20, 2006 Report Posted January 20, 2006 oooh, updates ... my version is 1.0.0.11 hmm i'm having trouble getting to the file actually... if anyone manages to download it, attach it in a post please then I'll go update my attachment in the One stop shop Quote
Drake7707 Posted January 29, 2006 Author Report Posted January 29, 2006 as those links doesn't work either, i decided to put the whole folder of all files from dcme onto my webspace of my college. you can find everything here: http://www.student.kuleuven.ac.be/~s0158884/DCME/ i believe the srcbackup_beforeselectiononarray.rar is the last backup that i made before screwing things around the oldversion folder was the version before i made the multiple maps at once. All versions are on there if someone still needs them Quote
Bajan Posted January 30, 2006 Report Posted January 30, 2006 send me all versions and i'll be sure to add them to SSDL for historical archiving Quote
Samapico Posted January 30, 2006 Report Posted January 30, 2006 the version I posted on SSDL is v1.01 I think Quote
Bajan Posted January 31, 2006 Report Posted January 31, 2006 ah, didn't mention the version when adding, i'll update Quote
Samapico Posted February 1, 2006 Report Posted February 1, 2006 i'm editing DCME a bit.. adding some stuff... fun... trying to get shift/ctrl-drag functions in there... will post when done vb sure is fun however, i'm editing from the source code in that 'new version' folder, which is v1.01 i think... so I don't know what was new with the other versions, but it will not have it And I noticed that the source code includes wall-tiles... not completly done, but it was being worked on I guess Quote
Drake7707 Posted February 1, 2006 Author Report Posted February 1, 2006 the new version folder is my workspace, its a little different from the latest version (as it was attached in this thread) because i wanted to change the selection and copy-paste and add walltiles, but that wasn't finished, so if you really want the source code of the latest version i posted here, you'll have to use the srcbackup_beforeselectiononarray.rar as it is a backup of the source code before tinkering with the selection and stuff (in case i screw up ^^, which btw happened a few times before >.>) And balan, the latest version is DCMEv106.zip ... well i believe it is (its been 3 months already you know ) Quote
Bajan Posted February 1, 2006 Report Posted February 1, 2006 only found out about DCME a week ago, nobody keeps me informed and i'm the only one who updates SSDL hah Quote
Samapico Posted February 1, 2006 Report Posted February 1, 2006 lol... good thing I posted it on ssdl I guess then Quote
Drake7707 Posted February 1, 2006 Author Report Posted February 1, 2006 DCME isn't that good as a map editor as it often seems not responding because of the large calculations it has to do, example select a huge portion of the map and move it, or copy it to the clipboard, and wham, your waiting for 5 minutes or longer. the copy-paste thing is because i create a string of the data and concatenating everytime, which vb translates as: create a new string, copy the oldstring + the new part. This generates a large overhead of copying to new memory. A better solution is to put the data as bytes on the clipboard, and reading it back from it. That will solve that slowdown, but as i had little time to work on (or did something else) i didn't change it anymore. If i would recreate DCME from scratch the structure would be quite different from as it is now, as it is little OOP and well.... cluttered and non-do!@#$%^&*entated :/ (always screwing up that last point there in all my written programs ) Besides bajan, didn't know you were the only webmaster so i couldn't tell you Quote
Bajan Posted February 2, 2006 Report Posted February 2, 2006 people submitting requests to host files on SSDL won't have there files put up immediatly, i need to actually notice the submit and add the file =/ Its alot easier when people actually tell me. Quote
Samapico Posted February 3, 2006 Report Posted February 3, 2006 i'll take note and DCME still owns SSME on many points wee... can now use shift to create straight lines, squares or circles....using of ctrl to 'use initial point as center' doesnt work that well tho... cant get rid of that offset..... bleh... *gets back to it* !@#$%^&* thing... I have homework to do Quote
Drake7707 Posted February 3, 2006 Author Report Posted February 3, 2006 lol maybe i'll try to change some things too Quote
Samapico Posted February 3, 2006 Report Posted February 3, 2006 OK... here we go... I'll release what I got so far... What any map editor should have: Shift-click creates straight or 45 degrees lines with Line and Multiline tools Shift-click creates squares with 'rectangle' tool and circles with 'ellipse' tool Ctrl-click defines initial point as line/rectangle/circle's center Added 'From:' and 'Distance:' labels indicating coordinates when dragging a toolMinor tweaks: Lines showing map's center on radar Button to count the number of tiles in the map similar to those selected as primary and secondary tiles Added button for 'Replace / switch tiles' , sometimes faster than going up in the menu Tells you how many tiles you have replaced or switched when using the 'Replace / switch tiles' tool Made it create a new map by default on startup New maps appear maximized by default, with grid activatedThat's about it... planning to do: 90degrees selection rotation... Quote
Samapico Posted February 5, 2006 Report Posted February 5, 2006 lol I suck... my rotation is wiping half of the selection after rotating... weird... stupid bug giving me a headache... but when I find the solution i'll probably smash my head on the wall cause it was such a stupid mistake... oh well... shift works to make a square selection too now Quote
Drake7707 Posted February 5, 2006 Author Report Posted February 5, 2006 you probably are overwriting your next source tiles of the previous rotation to the destination tile. the easiest way is to create a new selection, thus a new array (with the size of the source selection), then use that one as the destinationlike this pseudo code:dim j as integer dim i as integer dim destselect() as integer redim destselect(selection width, selection height) for j = 0 to selection height for i = 0 to selection width 'example for rotating 90° right ' the function for rotating 90° is defined as: f: (x,y) ---> (max - y,-x) destselect(max j, i) = sel(i,j) next next but this will only work for when width = height on second thought: forget what i said, 90° rotation is easy to implement: just flip & mirror it correctly, as these functions are already implemented, you can use those, (but to speed up a bit, combine the 2 in the source code instead of calling the functions, as they will generate an overhead they both share Another problem you have with tile counting is that you have overflows, integers aren't big enoug, use longs Also that count will never work as you usedIf Not loadedmaps(activemap) Then Exit Sub If Maps(activemap).sel.selalreadymoved Then MsgBox "You can't replace a selection that has already been moved" Exit Sub End If frmMain.tilesetleft = Maps(activemap).tilesetleft frmMain.tilesetright = Maps(activemap).tilesetright Call frmMain.CountTiles frmMain is not a map that is open, it is just the form. you have to use maps(activemap) instead of frmMain ! Quote
Samapico Posted February 5, 2006 Report Posted February 5, 2006 flipping can only be used for 180 degrees rotation... 90 degrees rotation is a bit different... I based myself on the flip / mirror codes, but changed stuff... .... lol I think I got it lol... ez... works GOOOD ... problem was I kept a part of code from the 'mirror' function (i thought i had changed it... oh well)... For i = seltilestartx To Int(seltileendx - ((seltileendx - seltilestartx) / 2))bleh lol... for rotation I need to scan the whole selection.. not just half of it oh yeh the count.... I thought I had it working... just tried it and it doesnt work as you say ... will fix fixed Quote
Drake7707 Posted February 5, 2006 Author Report Posted February 5, 2006 This is the correct code for count tilesSub CountTiles() Dim i As Integer Dim j As Integer Dim n As Long Dim m As Long Dim general As Long Dim special As Long n = 0 m = 0 frmGeneral.Label6.Caption = tilesetleft & " " & tilesetright For j = 0 To 1023 For i = 0 To 1023 If tile(i, j) = 0 Then ' do nothing to prevent overhead of istilespecial ElseIf tile(i, j) = tilesetleft Then n = n + 1 ElseIf tile(i, j) = tilesetright Then m = m + 1 ElseIf Not isTileSpecial(Me, i, j) Then general = general + 1 ElseIf tile(i, j) = 216 Or tile(i, j) = 217 Or tile(i, j) = 219 Or _ tile(i, j) = 220 Then special = special + 1 End If Next Next MsgBox n & " Left tiles (red)" & vbCrLf & _ m & " Right tiles (yellow)" & vbNewLine & _ general & " Tiles used in map" & vbNewLine & _ special & " Special tiles (such as wormhole)", vbOKOnly, "Tiles counted" End Sub Private Sub cmdCountTiles_Click() If Not loadedmaps(activemap) Then Exit Sub If Maps(activemap).sel.selalreadymoved Then MsgBox "You can't replace a selection that has already been moved" Exit Sub End If Call Maps(activemap).CountTiles End Sub Also you might want to add filled rectangle and filled ellipse drawing, as i didn't do that Quote
Samapico Posted February 5, 2006 Report Posted February 5, 2006 I'm witnessing weird behaviour in the lower-right end of the map... Drawing tools have some kind of offset... and the selection's offset correction works weird... rectangle draws at middle of tiles and such ô.o nice idea to add generic / special tiles in the count... Quote
Drake7707 Posted February 5, 2006 Author Report Posted February 5, 2006 i know about the offset, it's the problem of the icons. When you click with your mouse pointer, it will give you the left top of the icon of the mouse, the problem is that, when you use the cross for rectangles, the cross points in the middle, having a minor offset compared to the left top of that icon. I tried fixing that by adding that offset, but then it screws up another tool with another icon, and after i while i thought i had it good, but it seems the right bottom is still messed up. And as i was tired of trying it to be correct, i forgot what kind of changes i made, and didn't want to start all over again. I kinda forgot it afterwards as it is correctly in the middle :s As for the selection rectangle, you don't know what i've been through to get it correctly working .. *sigh*, at least it uses an int() on the offset of the selection rectangle to fix the added offset when you release your mouse, so it's not really a problem btw, you should update the copy/paste of the selection, as generating that string takes too much time when you select large areas. I don't know how to put an array on the clipboard so i asked it here Keep up the good work with the tweaks Quote
Samapico Posted February 5, 2006 Report Posted February 5, 2006 toolbar icons toggling is weird.. i added the 2 icons for filled rect / ellipse... they get selected, but the other tool selected before stays selected... i don't see where I can fix that Quote
Drake7707 Posted February 6, 2006 Author Report Posted February 6, 2006 Ok i made some changes and added a thingy to play with I'll only release the source code, as this is just a reference for Samapico to change in his version of the source I'll quickly list my changes done: - There is a problem in the replace window: when you press X the frmgeneral won't be enabled again, and you'll be stuckAdd this in the form :Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) cmdCancel_Click End Sub - I've added Text To Map, which allows you to type in your text, and it will convert it to a selection on the map with the left tile selected as tile usedThis is too much to add, so look into the source code for it, i'll quickly list all methods i made - the entire frmTextToMap form - the ExecuteTextToMap in the frmgeneral form - the TexTToMap in the ClipB class moduleDCME will handle the array given by the frmTextToMap as input from the clipboard, as this was the easiest way to implement. (instead of gettting text from the clipboard, the texttomap has as parameter the generated array, which is then copied to the clip array in ClipB, when that is done, everything happens identical as if it were pasted) As a side note, i used DCME_sam1_with_soure.zip as the source code where i made these changes in. (i also changed the count tiles already). And as another side note, you might want to add the TextToMap in the menu, rather than having a button floating there (but like i said, it's not really for public release, just as reference) Edit: !@#$%^&*it it took longer to type this than for you to reply Edit2: you need to put the style of the toolbar buttons to "2- ButtonGroup" Edit 3: it was stupid to not treat the selection as a layer for the map, and it starts to get back at me now, e.g paste or generate something with text to map, then zoom out or in, poof, gone or misplaced. With a selection layer it was much easier to change the actual data of the selection, or create a new selection, now you have to play with pieces of the tile array, keep the references clean, and it's still less flexible than with a selection layer. However, to change the entire selection is quite some work, and although it's not impossible, mayor changes would be necessary to keep the program working as many things rely on the current implementation of the selection (this was just as a side note too ) Edit4: fixed some ... erhm ... errors in the code that i wrote, no big dealDCME_sam1_with_source_Drake7707edit2.zip Quote
Samapico Posted February 6, 2006 Report Posted February 6, 2006 ok... can now fill rectangles... with option to fill fully or not... that is, if there is already an existing tile, should it overwrite it or not... so you can draw huge rectangles without losing existing tiles (laying fly-under tiles for example) but how the !@#$%^&* can I do that with the Ellipse??? triggering a bucket fill in its center wouldnt work... and im not sure to understand fully that math equation to calculate where to draw lines in the ellipse need to fix rotation by fixing special objects' new positions depending on their size too... arr ok... this is what i have, included your text to map things... nice bleh I don't even know how to add stuff in those menus... lol edit: bleh... didnt attach the right files at first..... fixed edit2: trying to get the special-tiles working on rotation... gives an error when it tries to set objects back on map... (when Sub setObject calls SearchAndDestroyObject) see selection.cls Quote
Drake7707 Posted February 6, 2006 Author Report Posted February 6, 2006 but how the !@#$%^&* can I do that with the Ellipse??? triggering a bucket fill in its center wouldnt work... and im not sure to understand fully that math equation to calculate where to draw lines in the ellipse well i hope you knew, gonna ask it on visual basic forum again :/ need to fix rotation by fixing special objects' new positions depending on their size too... arr rotating special tiles that are larger than 1x1 are not that easy to rotate, check out flip and mirror carefully.The problem resides in that the special tiles are stored like this:220 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 The actual number is always left top of the region of the wormhole lets say. If you rotate that, it won't be on the left top anymore, so you have to check, when you encounter a 220, you mustn't rotate it like the rest. ok... this is what i have, included your text to map things... nice Wasn't really that hard bleh I don't even know how to add stuff in those menus... lolyou have a menu editor available in visual basic, i believe it was CTRL+E when you select a form edit: bleh... didnt attach the right files at first..... fixed edit2: trying to get the special-tiles working on rotation... gives an error when it tries to set objects back on map... (when Sub setObject calls SearchAndDestroyObject) see selection.clsi'll see if i can fix it Edit: i think you attached the wrong source... no ? Quote
Samapico Posted February 6, 2006 Report Posted February 6, 2006 there ...... cleaned up my folders now... shouldnt happen anymore lol edit: GOD!@#$%^&* ..... still some files are wrong... lmao...edit2: ok ok ok... found the good files in the recycle bin... don't ask me how I confuse all my files like that... bleh... im not touching my DCME folder again... using a totally new folder, far away from the others... lol Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.