My leveleditor thread

Blitz3D Forums/Blitz3D Beginners Area/My leveleditor thread

Guy Fawkes(Posted 2012) [#1]
Hi all. I've decided to make a level editor thread for ALL my questions.


Ok, so I'm having a problem with my Import_File() function now... ><


When I try to import an object, it does NOT save the import object to the level.dat. it only saves the 20 created objects...


Also, when I try to import, after importing, for SOME reason, i CANNOT move my camera without first holding ctrl and pressing s, which saves level.dat...


Controls:


Hold Ctrl + S to save (u wont get any confirmation, it will just not crash, which means it works)


Hold Ctrl + I to Import an object (B3D ONLY for now)


Hold Ctrl + O to Open the level .dat file


Hold W\A\S\D OR the arrowkeys to move / turn around


Here's the code:


Functions.bb:





Editor.bb:





Any help is greatly appreciated! :)


Thanks! :)

Last edited 2012


Rob the Great(Posted 2012) [#2]

When I try to import an object, it does NOT save the import object to the level.dat. it only saves the 20 created objects...


I'm going to look over the code now, but I'm sure the reason why is that you are not creating a new object when you import a .b3d file. Remember, you have to call "c.Obj = New Obj" every time you create any new object. If you fail to do so, the new entity will not be added to the list of things to save.

EDIT:
From what I can see, it should be working, but it's hard to debug because I don't have all of the include files and I can't get the program to run. First, are you able to load the .b3d file successfully?

Last edited 2012


Guy Fawkes(Posted 2012) [#3]
O CRAP! MY BAD! I was supposed to take that out... >< Let me fix that


EDIT: Edited. Try it now :)

Last edited 2012


Rob the Great(Posted 2012) [#4]
Still the same problem, but don't worry about it. I've just been manually providing the file name for the animated .b3d file, so I can actually get the program to run.

Umm....I can get the model to import and save properly. At least, I can get the imported model to save according to what you have typed in, but in order to load the saved file, you're ultimately going to have to save a lot more information. You're either going to have to save the file location in the save file and then tell Blitz to load the animated mesh upon opening the file, or you're going to have to come up with your own routine to save each vertex, surface, entity, mesh, ect.


Guy Fawkes(Posted 2012) [#5]
its the same problem, because u forgot to create the includes file "Functions.bb". read the post again plz. i already have a b3d mesh export function that works fine... the problem is its not saving the imported file data to the level.dat like it is for the created objects.

Last edited 2012


Guy Fawkes(Posted 2012) [#6]
Nevermind the above. I got that fixed... Ok... Now... The PROBLEM is, when I go to save more than once, then try to open the level file a second or third time, NOT the 1st time, it deletes all objects on the screen like it should, but does NOT replace them with their saved mesh objects... That is because for SOME REASON, it does not RESAVE the mesh .b3d files... it deletes them. it should ONLY delete the FILES when u SAVE ur level, and the OBJECTS in-game, everytime u LOAD ur level. instead, it only saves each object file once. after u save once, the objects are no more until u reset the program... when u try to open more than once, i THINK there are copies of copies being loaded here, because the program seems to slow down when i try to load a level file more than once...


::CONTROLS::
Hold Ctrl+S to Save Level
Hold Ctrl+O to Open Level
Hold Ctrl+I to Import mesh (CAN be animated)
=============================================
W/A/S/D OR Arrowkeys - Move/Turn camera
::::::::::::::::


Here's the code:


SO.bb:





b3dfile.bb:





LevelEditor.bb:





Any help is GREATLY appreciated! :)


Thanks! :)

Last edited 2012


Guy Fawkes(Posted 2012) [#7]
.

Last edited 2012