Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
334 stars 59 forks source link

Item entities look wrong when the "model" key is left blank #210

Closed Spike29 closed 3 months ago

Spike29 commented 3 months ago

Hello,

A new key was recently added to several Xonotic item definitions (among other changes): <model key="model" name="model">model to use, leave blank to use the item's regular model</model>

Item entities look wrong in NRC with this change and when the key is left blank: Copie d'écran_20240814_130800 In NR, the the entity box is shown instead, as expected: Copie d'écran_20240814_132347

Is it possible to ignore this key for item entities, at least when it's left blank, and draw the box instead?

The size of the box in our entity definitions is the same as the size of the entity's bbox in the game, so it's very useful to draw it.

Garux commented 3 months ago

Point and miscmodel are separate entity types inside radiant, there is no smooth way to toggle type depending on keyvalue content. Model key presence in entity definition defines miscmodel entity type. This is feature to give ent def creators power to have arbitrarily named entities with adjustable models. From the diff ic that all of these entities have model ingame. You can just set default model value and have correct preview with either default or altered model key. Or if boxes are preferred over ingame appearance, you can change key type to string.

ensiform commented 3 months ago

Seems like a NR specific change you guys made, because since q3radiant days, items have always had to have a model defined or you get the null model iirc.

Spike29 commented 3 months ago

Oh I see, thank you both for the clarification.

In NR (at least with the Xonotic gamepack), no models are displayed for item entities, even when the model key is set. Models are displayed for misc_model entities though, so it could be a bug in NR.

I've changed the key type to string and that seems to do the trick, thanks! The items now look like boxes in NRC, but the model key is still respected in-game.

Since Xonotic mappers are used to items looking like boxes in Radiant, this is probably the best thing to do for now. I'll update our entity definitions with this trick.

Garux commented 3 months ago

If you declare model key default, this will be box in NR and full fashioned preview in NRC :)

Spike29 commented 3 months ago

Yes, I've thought about it, but the default models in question are probably to be found in the xonotic-data pk3dir, which is one of our forbidden paths.

I'm not sure why this path is forbidden and I'd rather not touch it for now :D

ensiform commented 3 months ago

Yes, I've thought about it, but the default models in question are probably to be found in the xonotic-data pk3dir, which is one of our forbidden paths.

I'm not sure why this path is forbidden and I'd rather not touch it for now :D

Curious why you would have the base game assets excluded from your mapping sdk though. It's kinda important for rendering things like that.

Spike29 commented 3 months ago

Curious why you would have the base game assets excluded from your mapping sdk though. It's kinda important for rendering things like that.

Probably because data files are subject to change, and our armor models were renamed at some point. The main mapping assets are located in xonotic-maps.pk3dir, which isn't one of the forbidden paths.

Xonotic is an old project but hasn't hit a stable version yet so this is to be expected I guess.

And we would need to edit our models first so they look correct in Radiant: Copie_d_écran_20240814_204108