Addons & Mods Depot > ArmA - Configs & Scripting

Simple infantry weapon

(1/3) > >>

modEmMaik:
Hi all,

in oder to add a Bundeswehr sniper weapon, I modified the M109 model from the BI-weapon samples.

The result can be downloaded here. I also added the unbinarized version (optional_files/modem_g82).

As a feature, I have added a reload animation:

--- Code: --- class modem_g82 : Default {
...
class Animations
{
...
class modem_g82_bolt_action
{
type="translationX"
source="reload";
selection="bolt";
axis="";
memory="false";
animPeriod=0;
minValue=0;
maxValue=0.25;
};
};
--- End code ---

This bolt section can be found some of the lower visual LOD's, becauseit is a simple visual animation.

Well, I think this could be used as an example for a simple animation  :)

I you want to release a modified version of this addon, feel free  ;)
Only take care that the original addon can be installed in parallel without interference  :good:

BR,
mike

DeanosBeano:
Very nice Mike thankyou,
 I may use this on a larger Artillery piece sometime in the future, Post as many as these examples as you can ,they make great little turorials.

 

modEmMaik:
Tanks Beano,

But using the reload anim on a tank seems unlikely to be implemented via model.cfg entry. According to ArmA wiki, the reload anim is avilable at weapons only  :weeping:

I used to implement a fire eventhandler function on the T-72 NSV to simulate the shell ejection, but this tends to be delayed in MP. Better sollution should be to use a game logic, but I have not yet checked this.  :whistle:

Might also be a good sollution to switch these "effects" on and off, because the game logic can be created using an init eventhandler defined in an alternative .bpo, which gives the option to install/use it or not (I did this for a simple tracer implementation, using the cent-tracers).

config.cpp

--- Code: ---class CfgPatches {

class smurftracers_001 {
units[] = {""};
weapons[] = {};
requiredVersion = 0.108000;
requiredAddons[] = {"Extended_EventHandlers", "cent_tracer"};
};
};

class Extended_Init_EventHandlers {
class All {
smurftracers_001init = "if (isNil 'smurftracers_001xxx') then {smurftracers_001xxx=1; [] execVM ""\smurfctracers\inittracers.sqf"";}";
};
};
--- End code ---

inittracers.sqf

--- Code: ---CENT_SETT_TRACERSETTING = 5;
CENT_SETT_RICO = 1;
CENT_SETT_TRACER = 1;
CENT_SETT_SIZEMOD = 2;

CENT_AUTO=true; // Enable loop
CENT_REFRESH=30; // Sleep time
CENT_PATH="\cent_tracer\"; // Path to take the script from, change to "" if you have the script inside your mission folder
[] execVM (CENT_PATH+"cent_tracer-Init.sqf");
player globalchat "Tracer init done";
--- End code ---

Gnat:
Well, reload seems to be usable (in part) on vehicles via a different method. I used it on my released Hydrofoil addon.
Can't say I've tested with static weapons.

BUT, its really tricky getting the "maxValue", its related to number of rounds in a magazine.
Theres a discussion thread on this subject in the BI Forums.

In the CONFIG.CPP

--- Quote ---      class AnimationSources: AnimationSources
      {
         class gunBarrel
         {
            source = "reload";
            weapon = GNT_76a;
         };
      };

--- End quote ---



Part of MODEL.CFG

--- Quote ---         class main_recoil
         {
            type="translation";
            source="gunBarrel";
            selection="main_recoil";
            begin="recoil_start";
            end="recoil_end";
            initPhase=1;
            memory=1;
            animPeriod =.2;
            sourceAddress = "loop";
            minValue=0;
            maxValue=0.0333;
            offset0=0;
            offset1=1;
          };
--- End quote ---

... not simple, not perfect visually when the last round of a mag is finished, but at least I avoided using a fired EH.

modEmMaik:
I agree, it is near to perfect. :clap:
Rather simmilar to the ammo belt rotation, where you also limmit the maxvalue to 1/mag-count to get a "floating" ammo belt.

Only issue is that all usable magazines have to have the same size, else you get an alias effect in your animation start/end.

Navigation

[0] Message Index

[#] Next page

Go to full version