Allow prefabs to be used in entities ( for custom weapons, vehicles etc )

i’m not avoiding it?

i’m completely fine with the fact that i don’t really know how templates work in enlisted.

but i know that existing templates works fine for what i unusually end up doing.

which to me, in the topic at hand, doesn’t solve nor answer to my issues.

because i would like to remind that it’s through templates that alot of time is sunked and barely stuff achieved.

maybe it’s a different story for you, and you have my congratulations.

but yeah, doesn’t really help me or others alot.

then don’t interact if you are not willing to be even slighlty helpful.

because so far, you are sounding like " i know, and you don’t. deal with it ".

and i’m not asking for you to share all of your knowledge.

you were the one who told me that entities are actually a solution.

and make things lighter.

now you’re telling me the opposite?

idk sounds like you are here to confuse even more the already delicate topic.

the audacity.

it surely didn’t stopped you to say fuck all nothing to begin with though.

This is a prefab I made using rendinst.

And it does not apply to the turret (turret of the tank).

Because the function of the turret is the work of template/entity. You can’t very well add it to the prefab.

I don’t know how to make you understand this fact.

That is, template is the basis of every entity, and you must define template to really get the new and replicable things you want.

Especially for those parts that can be generated dynamically. For example, entities, or guns that can be spawned or dropped and reused


You asked what and why I have already explained it above.

I hope someone else can give you a better answer that you can understand.

yes.

i am aware of this.

but what i have been discussing the whole thing up until now,

is to use rendinsts as decor only once.

and that node, contains multiple rendinsts that works like the prefab.

if you move the prefab block, all the others attached to it will move along side that said prefab.

why, can’t we have something similar to use in entities.blks.

you haven’t really explained something outside " performance issues "

which it’s somewhat of a fair point.

i just don’t understand why that’s the case.

when once again, you told me that in order to make scenes simpler, you have to use entities.

don’t entities use templates or something?

that’s exactly what i’m trying to do.

yet i can’t because it’s not a thing.

the premise of this suggestion, isn’t it?

Probably only as another files. Like you already have in userPrefabs folder. Or in new file Prefabs.

Currently time prefabs works in editor only as group object. Not as object that creates other objects (or maybe I don’t know something). And yeah. Other objects moves with prefab only in editor while in game objects will not move.

I’m not programmer/developer, but probably this code will be a bit better:

Prefab{
prefab__name:t="myFirstPrefab"

  "objects:list<t>"{
    item:t="game_rendinst"
    item:t="mp40_gun"
    ...
  }

  "objectsTM:list<m>"{
    item:m=[[...][...][...][...]]
    ...
  }
}

Prefab{
prefab__name:t="myAnotherPrefab"

  "objects:list<t>"{
    item:t="game_rendinst_decor"
    item:t="mp40_gun"
    ...
  }

  "objectsTM:list<m>"{
    item:m=[[...][...][...][...]]
    ...
  }
}

And in game this prefab will be as entity. And you can create it for create other objects. It maybe would be cool to see.

About your suggestion.

I think it would be much better if we will got ability to customize object like how we can already do it in game.


With unlimited amount entities and with ability to move and rotate them. But probably it will be much harder to code.

What do you mean? Would be good to give some info. As I know… You can attach anything to any entity.

2 Likes

Yes, that’s the functionality what I described in my first reply in this post. In procedural, technical perspective.

thanks.

that’s precisely what i was trying to say.

and thanks for the better looking code.

well, the idea was to create ( that you can actually see ) based on a chassy that you want, once, so that you don’t have to adjust everytime every single component.

because this can actually be time consuming and you have to do alot of trial and error.

hence, something simplier that works like prefab, but can be used in entities.

would be really apreciated.

that’s actually great and would become the ultimate solution,

but, i’d argue, as you pointed out, kinda too much.

therefore, a small code and features at a time.

so, i tried to use @tommyZZM opel blitz, and wanted to recreate this:

although, when i tried to just to begin with the mounth, unlike tanks, it didn’t worked for me ( despite having changed the tent, and the model following his template

just like the colored armors, didn’t worked either.

not sure if it’s because the templates do not work on normal vehicles or what.

( which… it’s kinda why this suggestion exists in the first place. would make things alot simplier… )

code
///my code

gmc_353_custom{
  _extends:t="gmc_353_b"
  vehicle_seats__exitTime:r=0.66
  vehicle_seats__enterTime:r=3.2
  vehicle__mapIcon:t="map_icon_train"
  user_point__icon:t="map_icon_train"
  team:i=2
  vehicle_seats__autoDetectRestrictToTeam:b=no
  vehicle_seats__restrictToTeam:i=2

  "vehicle_seats__seats:shared:array"{
    "seats:object"{
      name:t="driver"
      locName:t="vehicle_seats/car_driver"
      seatOwnsEntityControl:b=yes
      attachNode:t="char_driver_pivot"
      entranceNode:t="char_driver_landing"
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]
      seatComponent:t="isDriver"
      nextSeat:t="passenger1"
      canPlaceManually:b=yes
      seatEnum:t="left_seat"
    }

    "seats:object"{
      name:t="passenger1"
      locName:t="vehicle_seats/shooter"
      seatOwnsEntityControl:b=no
      attachNode:t="char_passenger_01_pivot"
      entranceNode:t="char_passenger_01_landing"
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]
      seatComponent:t="isPassenger"
      nextSeat:t="passenger2"
      canPlaceManually:b=yes
      seatEnum:t="right_seat"
    }
  }

  "animchar__objTexReplace:object"{
    "gmc_cckw_353_tex_d_tomoe*":t="dirt_tile_floor_tex_d*"
    "gmc_cckw_353_tex_d*":t="dirt_tile_floor_tex_d*"
  }

  "attach_decorators__entities:list<eid>"{
  }

  "attach_decorators__templates:array"{
    "templates:object"{
      // relativeTm:m=[[1.31134e-07, -1.06581e-14, -1] [1.06581e-14, 1, -1.06581e-14] [1, -1.06581e-14, 1.31134e-07] [-1.3, -4.8, 0.0]]
      relativeTm:m=[[1.30205e-07, -1.55893e-08, -1] [0.0656765, 0.964341, -6.48199e-09] [0.997689, -0.0679477, 1.30963e-07] [-1.49, -4.6, -0.08]]
      template:t="stz_prop+still_obstacle"
      nodeName:t="emtr_fire_engine"
    }
  }

  "disableDMParts:list<t>"{
    // item:t="commander"
    // item:t="driver"
    // item:t="cls_body_01"
    // item:t="cls_body_02"
    // item:t="cls_body_03"
    // item:t="cls_body_04"
    // item:t="cls_body_06"
    // item:t="cls_body_07"
    // item:t="cls_body_08"
    // item:t="engine"
    // item:t="body"
    // item:t="transmission"
  }
}

stz_prop{
  _extends:t="rendinst"
  _extends:t="replicating"
  _extends:t="base_vehicle_decor"
  _extends:t="phys_sleepable"
  ri_extra__name:t="tractor_stz_5_assembly_b"
  phys__isAsleep:b=yes
  grid_obj__gridType:t="interactable"

  "ri_extra__overrideHitPoints:i"{
    value:i=999999
    _info:t="ri_hit_points"
  }
}

/// His code:

big_action_opel_blitz_kfz_305_tent{
  _extends:t="rendinst"
  _extends:t="replicating"
  _extends:t="base_vehicle_decor"
  _extends:t="phys_sleepable"
  ri_extra__name:t="opel_blitz_kfz_305_tent"
  phys__isAsleep:b=yes

  "ri_extra__overrideHitPoints:i"{
    value:i=999999
    _info:t="ri_hit_points"
  }
}

big_action_opel_blitz_kfz_305_tent_resupply_base_team2{
  _extends:t="big_action_opel_blitz_kfz_305_tent"
  _extends:t="resource_box_base"
  _extends:t="fortification_builder_info"
  _extends:t="resupply_for_ground_vehicle_zone"
  ri_extra__name:t="opel_blitz_kfz_305_tent"
  animchar__res:t="grenade_f1_char"
  collres__res:t="grenade_f1_collision"
  grid_obj__gridType:t="interactable"
  grid_obj__fixedTmScale:r=-1.0
  animchar_render__enabled:b=no
  animchar__updatable:b=no
  
  building_menu__image:t="map_icon_train"
  builder_info__team:i=2
  team:i=2
  resupply_zone__team:i=2
  buildingRadius:r=3.2
  useful_box__maxUseCount:i=9999999
  useful_box__hintFull:t="Resupply Base;Vehicle+Engineer"

  _group{
    _tags:t="ui"
    hud_icon__image:t="building_ammo_box"
    hud_icon__offsetY:r=1.6
    hud_icon__maxDistance:r=23.0
    hud_icon__opacityRangeX:p2=0.5, 0.8
    hud_icon__opacityRangeY:p2=0.5, 0.8
    hud_icon__opacityCenterMinMult:r=1.0
  }

  "build_attach__riexHandle:u64"{
    value:i64=-1
    _tags:t="server"
  }

  "building__isBroken:b"{
    value:b=no
    _tags:t="server"
  }
}

big_action_opel_blitz_kfz_305_resupply_team2{
  _extends:t="opel_blitz_kfz_305"
  vehicle_seats__exitTime:r=0.66
  vehicle_seats__enterTime:r=3.2
  vehicle__mapIcon:t="map_icon_train"
  user_point__icon:t="map_icon_train"
  team:i=2
  vehicle_seats__autoDetectRestrictToTeam:b=no
  vehicle_seats__restrictToTeam:i=2

  "vehicle_seats__seats:shared:array"{
    "seats:object"{
      name:t="driver"
      locName:t="vehicle_seats/car_driver"
      seatOwnsEntityControl:b=yes
      attachNode:t="char_driver_pivot"
      entranceNode:t="char_driver_landing"
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]
      seatComponent:t="isDriver"
      nextSeat:t="passenger1"
      canPlaceManually:b=yes
      seatEnum:t="left_seat"
    }

    "seats:object"{
      name:t="passenger1"
      locName:t="vehicle_seats/shooter"
      seatOwnsEntityControl:b=no
      attachNode:t="char_passenger_01_pivot"
      entranceNode:t="char_passenger_01_landing"
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]
      seatComponent:t="isPassenger"
      nextSeat:t="passenger2"
      canPlaceManually:b=yes
      seatEnum:t="right_seat"
    }
  }

  "attach_decorators__entities:list<eid>"{
  }

  "attach_decorators__templates:array"{
    "templates:object"{
      // relativeTm:m=[[1.31134e-07, -1.06581e-14, -1] [1.06581e-14, 1, -1.06581e-14] [1, -1.06581e-14, 1.31134e-07] [-1.3, -4.8, 0.0]]
      relativeTm:m=[[1.30205e-07, -1.55893e-08, -1] [0.0656765, 0.964341, -6.48199e-09] [0.997689, -0.0679477, 1.30963e-07] [-1.49, -4.6, -0.08]]
      template:t="big_action_opel_blitz_kfz_305_tent_resupply_base_team2+still_obstacle"
      nodeName:t="emtr_fire_engine"
    }
  }

  "disableDMParts:list<t>"{
    // item:t="commander"
    // item:t="driver"
    // item:t="cls_body_01"
    // item:t="cls_body_02"
    // item:t="cls_body_03"
    // item:t="cls_body_04"
    // item:t="cls_body_06"
    // item:t="cls_body_07"
    // item:t="cls_body_08"
    // item:t="engine"
    // item:t="body"
    // item:t="transmission"
  }
}


1 Like

this attribute not yet be synchronized to the client.

I think it’s a purely client-side operating property. Therefore, it is reasonable to synchronize without wasting the server’s bandwidth traffic.

Once the developer can pre-sync entities.blk this approach would be the best solution for cosmetic attachments (but it won’t work for interactive logical objects such as flames and pickable guns etc.)

Here is another property that can be synchronized via the server.

train__attachments:array from armored vehicle


"train__attachments:array"{ 

    "aa_cannon:object"{

      template:t="moving_car_artillerie_flak_wagen_flak38_cannon"

      "components:object"{

        train_attachment__node:t="bone_flak38_aa"

        train_attachment__attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, -0.5, 0.0]]

      }

    }

    "artillerie_turret:object"{

      template:t="wagen_artillerie_turret"

      "components:object"{

        train_attachment__node:t="bone_turret"

        train_attachment__attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]

      }

    }

  }

But it has other problems. The bound items cannot be destroy at the same time.

Ortherwise, Currently we don’t have a good way of creating additional sticky items for vehicles


Another entity type that can be explicitly attached to a mobile vehicle is the soldier mobile rally point.

via respawn_on_sodier__respawnBaseTemplate.


Because this attribute does not exist in the client’s vehicle entity, then it will not take effect even if it is added in scene.blk in multiplayer games.

An entity is based on its template. If its template does not have ABC attribute, then you cannot add ABC attribute from the entity instance.

Another way is that you can try to use the train_panzerzug_bp_44_lokomotiv entity to attach the attach_decorators__entities attribute to your vehicle.

Or use train__attachments above

fairly sure in any editor attaching items to others is the ( or to the very least… should be ) easiest thing to do.

not in enlisted for some reason…

it works somewhat reliably on tanks.

not common vehicles for some reason though

not before we’ll have some sort of prefab for entities.

because not me, nor Vik_07 and nobody else should do that for 20/50 rendinsts to do each time for each and singular item.

hence, an entity that saves others things attached to it with the same universal 0 YZX should be a thing to help and make things easier for everyone.

as much a burden it’s on me for having and wanting a custom made vehicle, i shouldn’t pay the price of time for it.

hence, i would like if devs could import something similar to prefabs onto a template or whatever.

1 Like

The game have a visual interface to produce such content.

It is the function of adding decorations to vehicles in the game.

But this may require developers to add this functionality to the editor in some form.

Try this.

It works in multiplayer.

You can paste any existing template entity to the vehicle.

But you can’t add new rendinst appearance (because we need sync template to define new one)

as long it comes, it doesn’t matter how.

the editor should be made relatively easier for everybody.

so we can have more mods out there, and have higer quality.

to not end up having just compentitions, and half baked mods out there.

( ironic coming from someone who uses other codes, and has literally 2 hangar mods which are the same and one broken mod )

but, for the next month i have big plans.

it’s just that… my time is shrinked and the editor is not really intuitive or easy to work with if it wasn’t for people like you and devenndar taking the time to explain.

so essentially, you can’t add more than one rendinst?

correct?

Just add it to this array

"attach_decorators__templates:array"{

    "templates:object"{
      relativeTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]
      template:t="train_smoke_effect"
      nodeName:t="emtr_exhaust_01"
    }

    "templates:object"{
      relativeTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]
      template:t="train_smoke_effect"
      nodeName:t="emtr_exhaust_01"
    }

    "templates:object"{
      relativeTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]
      template:t="train_smoke_effect"
      nodeName:t="emtr_exhaust_01"
    }
  }

It doesn’t have to be rendisnt, you can add effects or flames or a capzone or bombsite

I’m not sure if there are other issues, this will need to be tested on your own.

Its default value is aneffect

well, i’m surprised and sort of glad that we have somewhat of a working way to attach things to normal vehicles,

but…

not to sound stubborn, but i still think we should get some sort of prefab for rendinsts to integrate with entities. ( whenever possible of course )

because… yeah it’s not gonna be much fun for me or anyone else to have to do trial and error 567467343276times just to get a position correct.

would be simpler to build first, create a template, and then use it in entities ( to end up having to adjust only one position instead of all ).

1 Like

This isn’t prefab (which is just collection of saved entities with their values), it’s a template (a prototype, because templates should have different names, not just Prefab) with seemingly composite object functionality intended. This way it may be coded to spawn listed entities, or check and control them in some way. Will need Triggers system or scripts to be useful, anyway. But it will be template, not something else.

2 Likes

well, can’t we have… some sort of feature that does what prefab sort of do but for templates?

because i feel like it would be much easier and helpful for us instead of having to place each and singular rendinst through decorators that have different axes too.

so that, in order for us to move it, we would only have to move one decorator instead of each and single one of them. and it gets complicated to go one by one for larger things…

not sure if i’m making my self clear.

1 Like

Triggers system planned has trigger_spawner template (in plans, not for real) which does exactly this: spawns listed objects in specified area with given properties values. Also editor will need “Bake entities as spawner” and “Spawn entities from spawner” functionality to ease work with trigger_spawner entities.

2 Likes

ugh… examples?

so a simpleton like me can understand, and make use of such things ( when will actually be implemented ) instead of bothering folks like you or other fine people.

because, as far as i know, triggers are usually prompted based on X ( or Y ) happens with Z is / has initialied / triggered.

sort of, a chain reaction so to speak.

correct?

so, for example,

a large explosions with effect and damage template happens because ( for example ) the rendinst underteath that it’s a fuel tank exploded.

right? ( as long i or anyone code it in a way that happens. through triggers or some sort )

then, how would i end up using triggers for decoration purposes

i don’t get the… logic behind.

1 Like

It’s easy, trigger_spawner will react to specified trigger signal and spawn listed objects in its area. As signal source you will be able to use trigger_start, for example, which sends trigger signal at mission start. So at start of your mission trigger_start entity will send trigger signal ID to every other trigger entity which accepts them and in this case it will be trigger_spawner entity with same signal ID.

3 Likes

As for example, you can create anything like a prefab or just bunch of entities. Then select them. Then press “Make trigger spawner” button and you will get trigger_spawner entity with all those entities encoded in its values. Then you may delete original entities and leave spawner only, connecting it to some trigger event (by trigger signal ID), like mission start.

3 Likes