Jump to content
Sign in to follow this  
six_ten

Bayonet

Recommended Posts

I'm at the point with my Black Powder mod that I'm ready to add bayonets to my muskets. I haven't yet tried it but I think this is a possible approach and I'd like to get some feedback and ideas from those more experienced than me.

-- as a starting point, modify one of the weapon attachments, like a suppressor or laser sight, replacing it with a bayonet model. Now the bayonet can be added and removed from the musket.

-- add a memory point at the tip of the bayonet model and a second one further in, if the first point contacts a player then the blade scratches him and he takes light damage, if the first point then the second point hits him, he is penetrated and takes much more damage

-- taking a cue from the campfire, where just being within a meter or so causes damage, create an eventhandler for the attached bayonet to cause damage if the Tip memory point is within a few centimeters of a player

-- make it so that if bayonet is attached, left mouse button fires the normal bullet, right mouse button fires an animation to thrust the weapon forward.

-- if bayonet is detached I'd like it to be "holstered" on the player's side. I've made custom uniform models for all my characters, so it is possible to add attachment points, or even move the NVG slot for example to the hip.

Does this make sense as the best and simplest way to create a working attachable bayonet?

Edit:

At http://forums.bistudio.com/showthread.php?178148-razor-wire-to-cause-damage I found an example that seems close to what I was thinking about (though I want mine built-in not external scripts) but one of the posters warns that too many instances will cause problems. Since every musket will be capable of using a bayonet, whatever method I use has to be low-impact on performance.

if using the editor; give the wire the name "barbWire" and put this in it's Init:

this execVM"barbwiredamage.sqf";

then create a file called barbwiredamage.sqf, save it in the root of your mission folder and put this inside it:

Private [ "_distance" ];
while (alive player) do {
sleep 1;
_distance = player distanceSqr barbWire;
if (_distance < 0.1) then { sleep 0.5; player setDamage 0.05; };
} else { hint"W00ps, you died. I should stop executing this script."; };

Now you have one barbwire that will give you the thing you want. But if you are going to put a shitload (more than 30) razor wires in your mission, it would be better not to use this method. Something to do with script spam.

Edited by Six_Ten

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×