How to place a usable rifle grenade in editor?

for exmple diakov_grenade_launcher

1 Like

In theory you maybe can add mods by editing entities.blk. But im not sure. Today maybe will check it.

1 Like

yeah, maybe

m1903_springfield_with_grenade_launcher{
  _extends:t="m1903_springfield"
  animchar__res:t="m1903_springfield_with_grenade_launcher_char"
  gun__blk:t="content/e_ww2_common/gamedata/weapons/m1903_springfield_with_grenade_launcher.blk"
  item__template:t="m1903_springfield_with_grenade_launcher_gun_item"
  item__proto:t="content/e_ww2_common/gamedata/weapons/m1903_springfield_with_grenade_launcher.blk"
  item__weapTemplate:t="m1903_springfield_with_grenade_launcher_gun"
  item__name:t="items/m1903_springfield_with_grenade_launcher"
  gun__locName:t="m1903 Springfield with grenade launcher"
  gun__showChamberedAmmo:b=no
}

m1903_springfield_with_grenade_launcher_gun{
  _extends:t="m1903_springfield_gun"
  _extends:t="m1903_springfield_with_grenade_launcher"

  "gun_mods__slots:object"{

    "grenade_launcher:object"{
      m1_grenade_launcher:t="m1_grenade_launcher"
    }
  }
}
  "gun_mods__slots:object"{

    "bayonet:object"{
      m1_bayonet:t="m1_bayonet"
      m1905_bayonet:t="m1905_bayonet"
      m1917_bayonet:t="m1917_bayonet"
    }
  }
3 Likes

Probably we can’t. Reason is attachable ID.
Weapon use mod id for some functions. Mod use weapon id for to be attached to weapon.
Generates entities always saves ID. That is why it works only in gun game/custom profile.

Interesting little thing: You can attach scope to some weapons that don’t have slot for this mod.


But not sure that it will work on gun game or custom profile.

Anyways… Heh…
Because of you I found way how to save some weapon stats after pickup! Even gun__shotFreq!!!
Thanks you very much! I’ll later write post about it in editor questions post.

1 Like

Well… I found way how to add gun mods to weapons. It’s easy:


Yeah. Weapon will not changed visualy, but when you pickup it then it will be with scope.

1 Like

It’s grenade_launcher slot.



But still need to do some work with ammo :slight_smile:
Nvm. Just need put nearby grenade ammo and pickup it by soldier.

1 Like

interesting.

i know the topic is old, but is it possible to add ammunitions through the initialcomponents?

more precisely, i’m working on a gun carrier.

except, it’s just a vehicle carrying weapons.

and, for example, i putted a few panzerfausts for players to grab.

but my issue is, the panzerfaus comes empty with no ammo.

same goes for grenade launchers.

i could attach ammunitions to the chassy of the vehicle, but i’d rather have the weapon ( in this case, the panzerfaust and grenade launcher ) coming with already 1 or more munitions.

i tried already by adding:
image

but when i pick up the weapon, is empty:

1 Like

You can do it if add ammoCount (integer) in customProps (!not in initialComponents!).
The first ammoCount in customProps is weapon ammo:


For grenade launcher… You probably need to add gunModsProps, grenade_launcher and then ammoCount.
But I’m not sure that it works fine. Because after fire it just play anims without anything.

2 Likes

alright. i’ll give it a try since now i’m working on my gun carrier for a bit, and show the results.

EDIT.

it work if the weapon is on the ground.

so, the weapon it self, has a shell ( or how many the user puts )

which thank you very much :slight_smile: i’m sure it will be very useful for me and others.

unfortunately, it did not worked for me on what i had in mind.

    "attach_decorators__templates:object"{
      relativeTm:m=[[1, 0, 0] [0, 1, -0] [0, 0, 1] [-1.4, 1.15, 1.1]]
      template:t="panzerfaust_100_gun_item+item_in_world"
      
  "customProps:object"{
    ammoCount:i=1
  }
      nodeName:t="root"
    }

and no matter how i put it

( this would look more approriate )

    "attach_decorators__templates:object"{
      relativeTm:m=[[1, 0, 0] [0, 1, -0] [0, 0, 1] [-1.4, 1.15, 1.1]]
      template:t="panzerfaust_100_gun_item+item_in_world"
      nodeName:t="root"

     "customProps:object"{
       ammoCount:i=1
     }
    }

( i essentially made it into a decoration so that would stick on vehicles: )


and would have followed a vehicle.

problem is, it removes the ammo when it gets picked up by a player:

that’s… very unfortunate…

pretty much anything that goes under decors property settings do not get saved. like for example rendinsts where if you would like to mount a roof / tents on vehicles, the collissions will always be on despite manually inserting the ri_extra__hasCollision:b=no

it does not get saved…

regarding the grenade thrower, wouldn’t work attached to vehicles because of the id. as… decors are usually generated with different ids each time.

and on the ground, doesn’t work either:

i followed the same properties,

it loads the grenade, but it doesn’t fire:

oh well. i’m just destined to not being able to do the stuff that i want because of the editor… again.

but. thank you very much.
as i didn’t know that i had to use the ammoCount for weapons :+1:

2 Likes

Well… In "attach_decorators__templates:object"{ you can’t edit attached entity properties.
But I think it should be possible to add panzerfaust with ammo. As another entity.
I mean in entities.blk add something like it:

panzerfaust_100_gun_vehicle_item{
  _extends:t="panzerfast_100_gun_item"
  "customProps:object"{
    ammoCount:i=1
  }
}

Maybe it should work…
But yeah… Not in multiplayer because it’s new entity.

Yep. As how I said it doesn’t work fine. You have ammo, but you will not able to fire.
So for use grenade launcher you will need to put around map grenade launcher items.

2 Likes

But… why

It seemed straight forward enough for me.

Shouldn’t an editor with functions and templates works on those said templates?

For being a logical editor, logic do not really connect with each other.

Or maybe it’s me.
since I always have simple ideas and more though ones,
Yet In both scenario, I always manage to get something wrong or mess stuff out😂

Oh well… thanks again.

Guess I should invest more time with those entities and only work for singleplayer stuff since those entities allows for everything yet only work in single.

Btw, the dms were super useful, and I got carried away by making custom transport, a working half track which I will share tomorrow. And you have no idea how much time I spended to make lots of clothings with the entities.

Wish there ware better example for what else could be used, but for now. It will do.

2 Likes