JernejL / samp-map-editor

Sa-mp map editor
31 stars 17 forks source link

Enhancement: Ability to load without default objects. #1

Closed Crayder closed 9 years ago

Crayder commented 9 years ago

Since the new ability to remove ALL objects using -1 as the object model in RemoveBuildingForPlayer, I figured this is quite needed for the map editor.

JernejL commented 9 years ago

Go forth and implement it & make a pull request.

Crayder commented 9 years ago

Oh I tried Delphi, Delphi and I are not very friendly...

JernejL commented 9 years ago

I'd still call this a case of lazyness. The source is there, delphi 7 is pretty easy to obtain and simple language to learn. There are also a ton of tutorials online.

Crayder commented 9 years ago

I didn't say I wasn't going to try, but I already know it won't be much. I was thinking of like adding another checkbox, like the 'load textures' checkbox. It would cancel the streaming of native object, only streaming the custom map. I have no idea where to start but I will look into it later.

JernejL commented 9 years ago

What is the purpose of that option? it would even further confuse people..

Crayder commented 9 years ago

For some people it would be very useful. For example, my current project that covers all of SA. I was stuck mapping in the air, above Mt.Chiliad. Now I can drop it to ground level with the new 'modelid -1' feature. The only problem with dropping it now is that I can't map it unless I remove every object (which is like a 3 minute process) manually. Yet there comes another problem with removing all objects manually, exporting the map. I export my map directly to my servers files, and the file is scanned for object lines to create the map. If I export the code with all of the map removed it will corrupt my map.

Since the 'modelid -1' thing was added, it would make this a lot easier to just add a way to hide all of the objects (or just never stream them) in the editor. If they are only not streamed then the code for removing them will not be exported.

EDIT: &btw, there are a few missing things in the github source. TTrackbar_32, TDNK_edit, TSynEdit, TSynMemo, TThreadedTimer, and there was one more (something to do with a checkbox).

I downloaded the SynEdit pack and the threaded timer that you linked adri1 to on the forums, but I'm still new to Delphi (and pascal XD). I have not a clue where to put the threadtimer file and I don't know what I need from the SynEdit pack.

Ok, now I have the SynEdit package installed (All SynEdit errors are gone).

I thought I knew how to install components, but when I installed the ones from the components folder (which I also moved the threaded time file to) I ended up with a new error, "Error reading ThreadedTimer3.priority". (EDIT: I guess I fixed it, but I don't know how...)

Now that I'm past that, it seems vectorgeometry.dcu is missing.

Getting this to even work is a lot more complicated than I expected...

JernejL commented 9 years ago

We can go and introduce something like viewport layers then.. like gta map, custom map, gta interiors, etc..

Crayder commented 9 years ago

Yeah that's perfect, have you already started the layer for interiors? I see a checkbox for this in the source, but there isn't a checkbox for it in the program (it's not shown anywhere).

Also, the CULL zone viewer is also already a layer for this.

JernejL commented 9 years ago

Crayder: please.. i don't want to babysit you but the components ARE commited in source, just create a package and add + compile + install units: https://github.com/JernejL/samp-map-editor/commit/1412d5a5b6c9ae7e786acdcd1861adc4b729080a

You WILL need to learn some basics about delphi (installing components, handling hidden components) so please try to find some tutorials.

vectorgeometry unit is from glscene.. http://glscene.sourceforge.net/wikka/HomePage

Crayder commented 9 years ago

Oh perhaps I should've mentioned, I have already fixed the components issue. I thought I already mentioned that I installed GLScene but it doesn't seem I have. I did have some problems with it though, the GLScene function names did not match the names used in the map editor's source.

My remaining problem was something to do with running the compiler on Windows XP. Running it in W7 is fine. I have been learning bits and pieces, Delphi is quite simple really. It seems you've got the wrong idea of me, XD.

JernejL commented 9 years ago

Waiting for your -1 removebuilding patch for 2 months now - sorry but if none is provided i will close this issue.

Crayder commented 9 years ago

I forgot about this completely. You can go ahead and close it. If I ever decide to pick it up again I'll make a pull request.

Crayder commented 8 years ago

Ok, so I can't this anywhere: TDNK_designpanel

Error creating form: Class TDNK_designpanel not found.
JernejL commented 8 years ago

see: https://github.com/JernejL/samp-map-editor/commit/1cd4ae7757f5839561d9b1d8b2c5851fbda52098

Crayder commented 8 years ago

I'd say the easiest way would be to change https://github.com/JernejL/samp-map-editor/blob/6dc0bab2d89c9cc09f6869364043bcd8a0719b03/u_edit.pas#L6816 from

if id <> idei then

to

if (id <> idei) and (idei <> -1) then

But, the exported code from that would be a huge list of all of the removed objects in the given radius.

EDIT:

There are more missing components... DNK_RoundSlider and DNK_Panel

JernejL commented 8 years ago

Commited more missing components.

I guess you should optimize the exported list somehow, maybe log it in a special manner when it's imported and therefore export it properly aswell, mark the -1 deleted objects as special so it wouldn't export hundreds of lines.

Crayder commented 8 years ago

Ok, I'll see if I can think of anything.