Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
ent_for_block / ent_to_block ? #327789
06/08/10 16:38
06/08/10 16:38
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline OP
Serious User
DJBMASTER  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Hi, I was wondering if it is a sensible idea to suggest a function that can convert a block into an entity.

This would allow block deformation at runtime, for debugging purposes or to create thrid party editors.

This is probably already achievable using 'ent_getmesh' and then a range of D3D functions, but many people, including myself, probably don't have this knowledge; and this is why I think a simple function would be much easier.

I think this is a realistic idea, but i'm happy to hear why it would suck, eg hard to update lightmaps, etc.

Thanks.

Re: ent_for_block / ent_to_block ? [Re: DJBMASTER] #328677
06/14/10 15:18
06/14/10 15:18
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline OP
Serious User
DJBMASTER  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
any feedback?

Thanks.

Re: ent_for_block / ent_to_block ? [Re: DJBMASTER] #328690
06/14/10 17:18
06/14/10 17:18
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
the map compiler does extra stuff with blocks like creating portals for visibility culling ingame. That are the advantages of blocks, everything else can be achieved with models at runtime. Models will even look like the level if you just give them the material for the levelsurfaces.

Re: ent_for_block / ent_to_block ? [Re: Scorpion] #328793
06/15/10 11:46
06/15/10 11:46
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline OP
Serious User
DJBMASTER  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
I see that but I had a specific idea in mind.

I wanted to be able to load a level (containing blocks), convert those blocks to entities, perform some manipulation and finally re-write the .wmb so the block changes are saved.

Re: ent_for_block / ent_to_block ? [Re: DJBMASTER] #328825
06/15/10 15:21
06/15/10 15:21
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
That's indeed difficult. Blocks are meant to stay at the same position, and the renderer uses this to its advantage.

For your purpose, if you want to move or manipulate blocks, better already place entities in the level instead of blocks.

Re: ent_for_block / ent_to_block ? [Re: jcl] #328843
06/15/10 16:01
06/15/10 16:01
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline OP
Serious User
DJBMASTER  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Yes, I would use entities if I were creating the level myself.

The whole reason for this request was so I would be able to support editing blocks in my level editor.

I wanted to load a level, read the blocks, create entities that represent those blocks (same position, vertices, skins), use simple functions like 'ent_setmesh' to change those entities, and finally write the entities back into a .wmb file as blocks (using simple IO).

Re: ent_for_block / ent_to_block ? [Re: DJBMASTER] #328849
06/15/10 16:14
06/15/10 16:14
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ah, I see. But in that case you could move the block by adding an offset to the vertices of its mesh. This is how the WED editor is doing it.

Re: ent_for_block / ent_to_block ? [Re: jcl] #328854
06/15/10 16:46
06/15/10 16:46
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline OP
Serious User
DJBMASTER  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Thanks, I think i'm pretty comfortable with the .wmb format, and can read/write most parts of it, so editing an existing block / writing a new block into a level file isn't a problem.

I'm more concerned with visually representing blocks in my level. Sure I can just use level_load and blocks come, but cannot be manipulated at runtime because as you said, this is hard.

I wanted to 'fake' this by creating entities, with the exact same properties of the blocks (or most properties), and then they can be manipulated however.

The problem is getting the mesh of the block and then setting that mesh to a new entity.

If I can't support blocks in my editor, I suppose it's not the end of the world, its just nice to complete the set.

Last edited by DJBMASTER; 06/15/10 16:48.
Re: ent_for_block / ent_to_block ? [Re: DJBMASTER] #328857
06/15/10 16:55
06/15/10 16:55
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
ent_buffers(ENTITY* ent, var num, var lod, void** ppVerts, void** ppTris, void** ppAttribs);

"Returns the vertex, index, and attribute buffer of the entity mesh.
The buffers can be used to read or manipulate the entity mesh on a lower level than with ent_setvertex."

Further:

"ent - model, terrain, or wmb entity pointer, or level_ent for level blocks."

http://www.conitec.net/beta/ent_buffers.htm





no science involved
Re: ent_for_block / ent_to_block ? [Re: fogman] #328867
06/15/10 17:54
06/15/10 17:54
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
As a less flexible alternative ent_getmesh can also read level blocks. You could then create a model out of this data on the fly and modify it as you need.

But there you'll have to fiddle around a bit with D3D stuff, though.

Page 1 of 2 1 2

Moderated by  aztec, Spirit 

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