for exmple diakov_grenade_launcher
In theory you maybe can add mods by editing entities.blk. But im not sure. Today maybe will check it.
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"
}
}
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.
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.
Itâs grenade_launcher
slot.
But still need to do some work with ammo
Nvm. Just need put nearby grenade ammo and pickup it by soldier.
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:
but when i pick up the weapon, is empty:
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.
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 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
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.
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.