Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (degenerate_762), 1,098 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Get BMAP's filename...? #473220
06/21/18 19:34
06/21/18 19:34
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Is it possible to retrieve a BMAP's original filename - somehow?
Recently I've made a post saying that it cannot be done but still, asking does not hurt.
I've written a function (for an in-game editor) that combines multiple entities into one. Now I want to save that entity/ mesh as an MDL. That's working to some degree already (mesh + skin points) but now I'm stuck at the skin. All entities use external files as skin textures.

Maybe via some BMAP.d3dtex(or ptr?) pointer offset (or GetPrivateData maybe...)? Or some other function that I'm not aware of?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Get BMAP's filename...? [Re: Superku] #473225
06/22/18 10:40
06/22/18 10:40
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
No, I believe the original file name is nowhere stored. So you need some other solution, a file list or something like that, for storing the file name.

Re: Get BMAP's filename...? [Re: jcl] #473227
06/22/18 11:24
06/22/18 11:24
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Alright, thanks.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Get BMAP's filename...? [Re: Superku] #473234
06/22/18 18:51
06/22/18 18:51
Joined: Feb 2013
Posts: 122
Maysville, Ga
Evo Offline
Member
Evo  Offline
Member

Joined: Feb 2013
Posts: 122
Maysville, Ga
Quote:

Is it possible to retrieve a BMAP's original filename - somehow?

I'm not sure if this is what you're looking for, but I had a similar problem when developing my 2d game builder and EFX animation editor. To get original file names of external BMAP files, I had to use text_for_dir :
Code:
txt_for_dir(TEXT*name, "*.*");


You'll find a basic example in the manual. Just create a TEXT array for reading the strings. It will read the original names of all files within the selected folder and store it all into a TEXT array. Then you can just loop through the array and define/create/point to whatever is needed. I used this to read from a folder and create auto generated lists for external files in my EFX editor.

Re: Get BMAP's filename...? [Re: Evo] #473237
06/22/18 19:29
06/22/18 19:29
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Yeah thanks, I got something like this already.

The issue is that theoretically I'd have to iterate over all textures, bmap_create them, compare their content with the source skin and return that on match as the source file. That's suboptimal of course, so I guess it won't be fully automatic and require you to select a skin texture manually.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Get BMAP's filename...? [Re: Superku] #473244
06/23/18 15:51
06/23/18 15:51
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I'm not sure if I fully understood what you're up to.

But if it's ingame... can't you just load the models, copy the bitmap buffers, and when exporting, choose and reference your own bitmap names and save them from your buffers?
It will still have you loading and saving bitmaps, which sounds like extra work at first glance. But it gives you more options for ingame bitmap modification on the other hand. My experience is, that bitmap manipulation/instructions are not THAT slow - unless you need it to happen realtime, which does not appear to be the case.

Of course the export folder should be a different one than the import folder in that case.

Re: Get BMAP's filename...? [Re: FBL] #473249
06/24/18 12:48
06/24/18 12:48
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Yeah I could do that but... I don't want to create new bitmaps, the main usage right now is combining entities.
Have a look at the following scenario for example: http://superku.de/entCombine.jpg
I wrote a code to automatically place thousands of leaf entities around the base mesh (as I couldn't get it to look right in Blender after some time). I actually have a video of that from an earlier version: https://i.gyazo.com/aa7ec68b29ba24c413bc58459aa7f7f5.mp4
Another scenario was where I had a bunch of coconuts covering the floor, which I replaced with the click of a button (or 2) by just one entity instead.

Having to input the texture files is a little bothersome to me but oh well.
Btw. I'd probably compare the buffers directly instead of using pixel instructions, *should* work if you grab the right BMAP member.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Get BMAP's filename...? [Re: Superku] #473250
06/24/18 14:00
06/24/18 14:00
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Oooh, i was once writing a general purpose editor. What i did was, read extern skin names from MDL7 files, write those to a metadata file(json) along with model name and content/model browser would use those files(also had thumbnail/preview images and other data about files) to show the list of available models. I think you can use a similar approach, either create those files if you have small amount of models or create them with a little script automatically. And use one of the entity skills/strings to remember which metadata file that entity came from and use that to get skin names.

I also remember converting internal skins to extern. But i remember some of those was not available in mdl7 sdk so i manually did some stuff, which ones were missing i do not remember.


3333333333
Re: Get BMAP's filename...? [Re: Quad] #473251
06/24/18 14:08
06/24/18 14:08
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Oh right, that's a neat idea, I will do that! Thanks!
I couldn't really figure out the mdl7 SDK so I did it manually as well.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Get BMAP's filename...? [Re: Superku] #473288
06/25/18 19:18
06/25/18 19:18
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Ah I see. Ok, then exporting the bitmaps is not so much of a useful choice.

I remember having my problems with MDL7 as well, mainly not understanding the SDK while wanting to write MDL7 files from Lite-C.
I ended up exporting a D3D compatible vertex and triangle dump, together with a texture table, so I could easily create a loader and use the D3D mesh functions... grin

Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1