Jump to content
Sign in to follow this  
mrflay

FLAY Archery Fetish Mod (wip)

Recommended Posts

well at least they hit a certain spot well. this should be easy to fix by adding some extra velocity to the projectile via fired event handler. although it would be great if BI could add a check by the engine, if the ammo is explosive or not and make the AI aim accordingly. that would make the grenadelauncher class very useful for other weapon types like this too. like throwing spears and crossbows:)

awesome work btw. nice touch with the target UI showing the point of impact. may i ask what you used to make the animations?

Share this post


Link to post
Share on other sites
well at least they hit a certain spot well. this should be easy to fix by adding some extra velocity to the projectile via fired event handler. although it would be great if BI could add a check by the engine, if the ammo is explosive or not and make the AI aim accordingly. that would make the grenadelauncher class very useful for other weapon types like this too. like throwing spears and crossbows:)

I'm not sure how it all works under the hood, but it would make a lot of sense if the AI adjusts the aim according to the muzzle type.

I went with the GrenadeLauncher because it appears to be required for firing shells (explosive arrows) and seems to handle regular bullets as well (e.g. broadhead, precision, and regular arrows) from the player's perspective. It isn't a big deal for me to add another muzzle type if that's what's needed.

awesome work btw. nice touch with the target UI showing the point of impact. may i ask what you used to make the animations?

Thanks! I made the animations with O2. These animations are just placeholders to show that there is a difference between loading from back quiver and the bow mounted quiver. They are only one or two keyframes each, so it didn't require a lot of effort.

Share this post


Link to post
Share on other sites

I love your work . It would be awesome if you could contact Bohemia for making Weapons and Body animations easier to make .

Also implementing a good system for creating melee weapons.

That way there could a be a possibility of creating a Mount and Band like Medieval combat simulator inside of ARMA 3.

Thank you for all your hard work !

Share this post


Link to post
Share on other sites

Just watched the videos. Wow man very impressive, looks like great fun and your implementation of everything looks spot on :)

Share this post


Link to post
Share on other sites

It does not work well with AI at the moment, but then I haven't really started to look at that yet. From AI perspective the bow is a grenade launcher, so if it is possible to get the AI to be accurate with a grenade launcher they should have no problems using the bow. At the moment, though, it seems they aim for the feet.

See

yeah it seems the AI aims close in front of the enemy. the precision at this distance looks a bit high. maybe you should increase the dispersion of the weapon. and maybe also the decline of the arrows. however thats all subtleties you can adjust later.

hmm do you think its also possible to make fire arrows? would probably look really cool at nights :D

Share this post


Link to post
Share on other sites

dude this mod looks awesome, would make a good addition to wasteland or some unique hunting type missions. mind you didnt rambo use one in one of his movies?

Share this post


Link to post
Share on other sites
Happy to see another archer here :) Yes, a more realistic damage model is definitely on the roadmap for the mod. It may not be there right away and maybe not the default damage model, but it just wouldn't be right to call it a fetish otherwise. Great feedback btw.

This and your vids is pleasing to see. Excellent work, I have a 65lb long bow and a Hungarian style recurve myself, and missing out on an event this weekend :(. Now there may be a more convenient way of getting a fix,... kind of.

Share this post


Link to post
Share on other sites
This and your vids is pleasing to see. Excellent work, I have a 65lb long bow and a Hungarian style recurve myself, and missing out on an event this weekend :(. Now there may be a more convenient way of getting a fix,... kind of.

Yeah, hungarian bows are pretty bad ass (fast forward to about the 1.30s mark).

Share this post


Link to post
Share on other sites
I'm not sure how it all works under the hood, but it would make a lot of sense if the AI adjusts the aim according to the muzzle type.

I went with the GrenadeLauncher because it appears to be required for firing shells (explosive arrows) and seems to handle regular bullets as well (e.g. broadhead, precision, and regular arrows) from the player's perspective. It isn't a big deal for me to add another muzzle type if that's what's needed.

Random thoughts -

I know the AI use the different "modes" settings which if you look at the default MG config you'll see what I mean. usually have at least 3 settings - "near", "middle", and "far" settings. Each with their own "accuracy" adjustments. That's what stopped MG gunners from being laser-sniper-accurate at distances. WELL... if the bow can use the MG class then you'll be all set.

NOW... once you do that you may lose the GL "code", so the question of course is how to make it use the MG and keep exploding tips? BIS has provided the Ammo class the ability to run scripts. Check my GL config that uses the ammunition script settings. In a nutshell, the script will spawn an explosive of your choosing at the impact location of the bullet. In actuality you can spawn anything - a cow, whatever. Here you would need to make a "mini-grenade" specifically to simulate an exploding tip. Obviously much less explosive force than for example the A10's exploding cannon rounds :) Even less than a 23mm exploding round. Whatever, you can tweak it to get it just right. So here's the trick:

1. Make your exploding arrow AMMO run the script. It is just a normal arrow round that uses a new model to "show" the exploding tip. Everything else would be identical to the other arrows, with the possible exception of weight. Regardless...

2. The script will spawn the new mini-grenade at the point of impact.

3. "BOOM"

That "should" allow you to make exploding arrows, smoke marker arrows, cow spawning arrows, WHATEVER. :) This is *the* way I made CAS smoke marker rounds for the CAS rocket pods, and is also how I spawn the nautical water mines. In both cases the "smoke rounds" are normal rounds that do zero damage, and use the spawn scripts to generate their payloads. The obvious potential here is incredible and I'm surprised more people don't utilize these scripts.

Reference my research thread here:

http://forums.bistudio.com/showthread.php?140954-Determine-Crater-Impact-position

SCRIPT EXAMPLES are in my threads:

... my GL here - where I use the scripts to make smoke rockets for GL launchers:

http://forums.bistudio.com/showthread.php?134330-RG-6-and-Heavy-Grenadier-units

... and my CAS smoke thread here - where I use the scripts to make smoke rockets for the aircraft rocket pods:

http://forums.bistudio.com/showthread.php?141099-CAS-Smoke-Marker-Rockets

... and my Durandal / Betab thread here - where I use the scripts to make a crater object appear at the point of impact (along with some SFX):

http://forums.bistudio.com/showthread.php?142384-Runway-Denial-Bombs-BLU-107-and-BetAB-500

... and finally my Nautical Mines thread here - I use the script to generate a water mine at the point of the bomb's impact in water:

http://forums.bistudio.com/showthread.php?130623-Ships-Naval-Mines-and-Naval-Objects

I am certain you can simulate the exploding tip arrows using this method, and should be able to add several types of tips to your Rambo inventory. Let's see... poison tips... tear gas tips... smoke marker tips... the list goes on and on :)

Share this post


Link to post
Share on other sites
Random thoughts -

I know the AI use the different "modes" settings which if you look at the default MG config you'll see what I mean. usually have at least 3 settings - "near", "middle", and "far" settings. Each with their own "accuracy" adjustments. That's what stopped MG gunners from being laser-sniper-accurate at distances. WELL... if the bow can use the MG class then you'll be all set.

These dummy modes are not exclusive for the MG. Every weapon used by AI have them. I will need to add/tweak them for the bow when I'm finished with the player side of things.

... Check my GL config that uses the ammunition script settings. In a nutshell, the script will spawn an explosive of your choosing at the impact location of the bullet. In actuality you can spawn anything - a cow, whatever.

Reference my research thread here:

http://forums.bistudio.com/showthread.php?140954-Determine-Crater-Impact-position

Thanks, this might actually be a better way to create the arrows that sticks to walls and ground and such on impact. Right now I'm spawning a script when the arrow is fired in order to keep track of the position and direction of the projectile while it's alive. Will have to look into it.

I am certain you can simulate the exploding tip arrows using this method, and should be able to add several types of tips to your Rambo inventory. Let's see... poison tips... tear gas tips... smoke marker tips... the list goes on and on :)

Hehe, yeah... it's a very very long list :)

Thanks for the suggestions!

Share this post


Link to post
Share on other sites

Looks quite interesting!

Nevertheless it would be a great easter egg if proper (Rambo-like) compound bows with fitting animations were part of the vanilla game (even though not part of the official missions, just available for scripting and mapping).

Share this post


Link to post
Share on other sites

Sorry for the lack of updates. I've come to ways end with the current implementation and are looking into other (less hacky) ways to make the bow work.

I'm hesitant to release the current version of this hack because I think many will be disappointed in just how glitchy it is. I may consider releasing the sources, just not sure whether it's a good idea or not (the implementation is severely flawed). So in the meantime, I'll try to just explain how it works and hopefully someone will facepalm and make something better :)

How it currently "works"

tldr; muzzles, reloadAction, backgroundReload, and other horrible hacks. please don't ban me ;)

This will probably be a little hard to follow as this is a really messy hack and I'm not very good at explaining stuff to begin with. My goal was to make the bow work using a single model and a single configuration. Since this didn't quite work out the way I wanted, my next attempt will probably be using multiple models and configs.

Anyways, lets start with the simple stuff.

Named selections (bones)

As can be seen in the following images, the bow consists of two named selections (or bones); magazine and bolt. The arrow object and muzzle proxy makes out the magazine selection, and the vertices of the middle part of the string makes out the bolt selection.

jCPrWfs.pngpAZyTZJ.png

The magazine and bolt selections are animated together when the bow is drawn using two separate translation animations (i.e. one for the magazine and one for the bolt). When the bow is empty the magazine is hidden with an "revolving" animation. So, with this setup it is possible to get all the required states (i.e. empty, loaded, and drawn). See model.cfg for details.

States

This is where it gets messy. It may help to keep the following image in mind when reading the next part, no guarantees though.

Vn4XOYc.png

The image shows the three possible states the bow can be in (I've removed the bow quiver to make things easier). I'll refer to these states as 1="empty", 2="loaded", and 3="drawn".

Now, one of problems with weapons in arma is the very limited way in which they can be animated. It isn't possible to add custom user controlled animations like there is for vehicles. Instead, one has to rely on the following (engine controlled) animation sources:

  • revolving: Triggered after the weapon has been fired (usually used to animate the bolt action).
  • reloadMagazine: Triggered when the user switches to a another magazine (i.e. not when loading magazine into an empty weapon).
  • isEmpty: Triggered when there's no magazine loaded or the current magazine is empty (same thing?).

One thing to note is that there can only be one reloadMagazine animation and it is used for all muzzles (this is why there are bugs like these #290, #255, #1791).

Empty

So here we have an empty/undrawn bow (1). When the player presses the reload key, the "load" animation should play and we should end up in the loaded state (2). Now keep in mind that there are at least two possible ways to load the bow; from the backpack and from the bow mounted quiver (and in the future, also from a belt quiver).

Since we need different reload animations depending on where we are loading from (backpack or quiver), we have to use separate muzzles. So, for example, if we want to reload from the backpack we first switch to the DummyReloadBackQuiverMuzzle and add the associated 1Rnd_DummyArrow1 magazine. When the player presses the reload key, the reloadAction associated with the muzzle is played.

There is also a hook added to the reload key, that adds a 1Rnd_RegularArrow magazine and switches to the RegularArrowMuzzle (i.e. the muzzle we are actually firing from). This muzzle is configured with autoReload=1 which means the arrow is loaded immediately without any animation playing. You can't tell the muzzle has been switched unless you look at the HUD in the top right corner.

Loaded

In this state (2), when the player presses the reload key, the "draw" animation should play and we should end up in the drawn state (3). It should also be possible to unload the bow (i.e. removing the arrow and putting it back in either the backpack or bow mounted quiver).

So, here we have the RegularArrowMuzzle muzzle selected and a 1Rnd_RegularArrow auto loaded. Since this muzzle is configured with autoReload=1, it's not possible to trigger a reload animation. To workaround this another muzzle has been added, the DummyReloadArrowMuzzle. This muzzle is configured with backgroundReload=1 which allows us to reload it even when it's not selected. This is how the "draw" animation is played, then the player presses the reload key.

Drawn

In this state (3), when the player presses the fire button, the "fire" animation should play and we should end up in the empty state (1).

Ok, so this isn't actually a real state. The reloadAction of the DummyReloadArrowMuzzle is just configured to have a very long timeout. This means we are stuck in a reload animation that make it look like the bow is drawn.

The problem now is how do we fire the bow if its stuck in reload? Well, we can't. But we can terminate the reload animation using playActionNow with a special reset gesture and then use the UseWeapon action to force the player to fire the weapon. I.e.,

player playActionNow "ResetGesture";
gameLogic action ["UseWeapon", player, player, _muzzleIndex];

So this has been attached to the onMouseButtonDown event.

Bugs

Switching muzzles while the reload animation is playing will result in the weapon animation getting stuck (see image below). The only way to reset the weapon animation is to trigger another reload or remove the weapon and re-add it. Since reload cannot be triggered from within a script, the only option is to drop the weapon and re-add it. This has the unfortunate side effect of clearing the state of the flashlight / IR pointer (which are currently unusable).

wTwpuQY.jpg?1

References

config.cpp

model.cfg

Share this post


Link to post
Share on other sites

Short status update.

I'm almost finished with the rewrite and I'm pretty happy with how it works now. Instead of a single bow there's now one bow per state (i.e. empty, loaded, drawn). This made it a lot easier to manage states and it is far less glitchy now.

The only important thing missing right now is the bow mounted quiver, but hopefully it should not be that difficult to make it work with the new implementation.

Anyways, there probably be an alpha test very soon (today or tomorrow depending on the quiver).

Share this post


Link to post
Share on other sites

Ok, I've uploaded a test version of the mod on my dropbox (see link below).

I would really appreciate some feedback on how it feels (forget how it looks for now). There's currently three different ways to load and fire the bow, which one would you prefer?

Alt 1 (Far Cry):

  1. Press 'R' to load an arrow from the backpack or quiver.
  2. Press and hold the 'Fire' button to draw the bow.
  3. Release the 'Fire' button to release the arrow (press 'R' to abort).

Alt 2 (Arma:ish):

  1. Press 'R' to load an arrow from the backpack or quiver.
  2. Press 'R' to draw the bow.
  3. Press 'Fire' to release the arrow (press 'R' to abort).

Alt 3 (Mouse):

  1. Scroll down to load an arrow from the backpack or quiver.
  2. Scroll down to draw the bow.
  3. Press 'Fire' to release the arrow (scroll up to abort).

Keys

R: If the bow is empty, load an arrow from the backpack or quiver. If the bow is loaded, draws the bow.

Shift+R: If the bow is loaded, unloads the arrow and puts it in either backpack or quiver. If bow is drawn, undraws the bow. If the bow is empty, switches between loading arrows from backpack or quiver.

F: To switch between loading from backpack or quiver (bow must be empty).

Scroll Down: Load an arrow (if bow is empty) or draw the bow (if bow is loaded).

Scroll Up: Unload arrow (if bow is loaded), Undraw the bow (if bow is drawn), or Switch between loading from backpack or quiver (if bow is empty).

Known Issues

  • Order of inventory items is changed every time something is changed on the bow.
  • Ammo count for quiver always shows 0.
  • Magazine is not shown in inventory when bow quiver is selected.
  • Cannot change magazine / arrow points when quiver is selected.
  • Scope cannot be used while the bow is drawn.
  • The target indicator is huge when interface size options is not set to "small".

Download

archery_fetish_mod.zip

Share this post


Link to post
Share on other sites

Gonna test this so hard.....

Love you already for the idea.

Edit:

Okay, I encountered a problem while using this in MP:

You can load an arrow, but you cannot draw the bow. As soon as you hit 'Fire', the arrow will be shot immediately w/o drawing the bow....

Edited by RedPhoenix

Share this post


Link to post
Share on other sites

Liking this alot. At first i shuddered at the thought of ArmA´s stiff animations when using a bow, but the resulting gameplay makes up for that. Also loving the sample mission you arranged!

(be aware that mission requires the dev build. i simply deleted some stuff from mission.sqm and got it working on stable build without the vehicles)

Now feedback:

Error in expression <mpty" and _next == "next") then {
_unit removePrimaryWeaponItem _quiver;
_unit a>
 Error position: <removePrimaryWeaponItem _quiver;
_unit a>
 Error Missing ;
Error in expression <mpty" and _next == "next") then {
_unit removePrimaryWeaponItem _quiver;
_unit a>
 Error position: <removePrimaryWeaponItem _quiver;
_unit a>
 Error Missing ;
Error in expression <nit;

_magazine = primaryWeaponMagazine _unit;
_magazine = if (count _magazine =>
 Error position: <_unit;
_magazine = if (count _magazine =>
 Error Missing ;
Error in expression <nit;

_magazine = primaryWeaponMagazine _unit;
_magazine = if (count _magazine =>
 Error position: <_unit;
_magazine = if (count _magazine =>
 Error Missing ;
Error in expression <;

_newMagazine = primaryWeaponMagazine _unit;
_newMagazine = if (count _newMaga>
 Error position: <_unit;
_newMagazine = if (count _newMaga>
 Error Missing ;
Error in expression <;

_newMagazine = primaryWeaponMagazine _unit;
_newMagazine = if (count _newMaga>
 Error position: <_unit;
_newMagazine = if (count _newMaga>
 Error Missing ;

^^ error message upon starting the example mission. Do you have -showscripterrors enabled? If no, you should :)

Another issue i noticed during slomo-camming around, the actual projectile seems to be a tracer which impacts much earlier than the actual arrow.

I guess you scripted the arrow object to follow the tracer? However it should be pretty easy to define the actual arrow model as projectile (at least it was in arma2):

class cfgAmmo {
       class arrow_base;
class arrow: arrow_base {
	model = "\blabla\arrow.p3d";
       };
};

Keep it up :hyper:

Share this post


Link to post
Share on other sites
Alt 1 works best...

Cool, thanks!

Okay, I encountered a problem while using this in MP:

You can load an arrow, but you cannot draw the bow. As soon as you hit 'Fire', the arrow will be shot immediately w/o drawing the bow....

I just tested it in multiplayer by copying the single player mission to my MP mission folder and it seemed to be working. You need to add a GameLogic with the name "gamelogic" in order to use the Far Cry style of firing, though. I will try to fix this in an update so you don't have to add these things manually.

Liking this alot. At first i shuddered at the thought of ArmA´s stiff animations when using a bow, but the resulting gameplay makes up for that. Also loving the sample mission you arranged!

(be aware that mission requires the dev build. i simply deleted some stuff from mission.sqm and got it working on stable build without the vehicles)

The animations in use now are more or less sloppy placeholders. I haven't taken the time to do them properly yet, but I'll look into it soon.

Error in expression <mpty" and _next == "next") then {
_unit removePrimaryWeaponItem _quiver;
_unit a>

The removePrimaryWeaponItem is new for dev (beta) branch. It used to be call removeItemFromPrimaryWeapon in the stable (alpha) branch. I should have uploaded a version that works with stable branch, but forgot. I'll try to put one up soon.

Another issue i noticed during slomo-camming around, the actual projectile seems to be a tracer which impacts much earlier than the actual arrow.

I guess you scripted the arrow object to follow the tracer? However it should be pretty easy to define the actual arrow model as projectile (at least it was in arma2):

Correct. I'm using a tracer model because it makes it easier to see the trajectory. It's easy to change it to an arrow, as you said. I'll look into it for the next update.

Thanks everyone for the feedback!

Share this post


Link to post
Share on other sites

I just tested it in multiplayer by copying the single player mission to my MP mission folder and it seemed to be working. You need to add a GameLogic with the name "gamelogic" in order to use the Far Cry style of firing, though. I will try to fix this in an update so you don't have to add these things manually.

Thanks everyone for the feedback!

Alrright, thanks.

Here is a small screenshot of a friend while we test your mod.

It's extreme fun!

Absolutely recommended!

arma3_2013_06_22_21_26vumu.png

edit:

I just added the gamelogic - no change. Still does not work properly.

Edit2:

It's not a gamelogic I needed to place, it's a trigger activating the script.

Edited by RedPhoenix

Share this post


Link to post
Share on other sites

Added stable branch version.

archery_fetish_mod_alpha.zip (stable branch / alpha only)

Note that this version has some issues with inventory that are not present in the beta version.

It's not a gamelogic I needed to place, it's a trigger activating the script.

Sorry about that! I'll look into adding CBA_XEH support in next update. Hopefully, that'll make things easier to use.

Edited by mrflay
typo

Share this post


Link to post
Share on other sites

getting an error shoting from close distance at this material corrugated sheet

Error in expression <IS_fnc_magnitude;

{

_ret = _ret + [_x / _mag];

} foreach _this;

_ret

>

Error position: </ _mag];

} foreach _this;

_ret

>

Error Zero divisor

File A3\functions_f\vectors\fn_unitVector.sqf, line 18

75w4738le8iu.jpg

is there a way that you can use optics when the arrow is loaded.

testing more. nice addon. great work

also other materials, or random / how close you are to the target. not shure.

Edited by themaster303
also other materials...

Share this post


Link to post
Share on other sites
Added stable branch version.

archery_fetish_mod_alpha.zip (stable branch / alpha only)

Note that this version has some issues with inventory that are not present in the beta version.

Sorry about that! I'll look into adding CBA_XEH support in next update. Hopefully, that'll make things easier to use.

Perfect!

btw: If you want, or need, help with texturing, just write me a PM. I would help you with great joy!

Share this post


Link to post
Share on other sites

Hey, are you still developing? Still a great fan of this mod and would like to see it updated and refurbished :3

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  

×