Jump to content
Sign in to follow this  
blackpixxel

UTS-15 Shotgun

Recommended Posts

Something very rough for you.

this addEventHandler ["fired", "this playMove ANIMATIONAME"];

This goes in your player init box.

This is just for testing. Once you've tested the animation you'll need to add it into the config as the "fired" event for the weapon.

Share this post


Link to post
Share on other sites

Should I enter the name of the .rtm-file or the one of the config that was defined in the CfgMoveBasic? Because none of them work with this code.

I also added the following lines in the weapon base config, but I guess there is a mistake.

		class eventHandlers
	{
		fired = "_this playMove BoltActionAnim_stand";
	};

Edited by BlackPixxel

Share this post


Link to post
Share on other sites

It could work, perhaps try

class eventHandlers 
       { 
           fired = "_this playMove 'BoltActionAnim_stand'"; 
       };

Just added ' ' around the animation string. Other than that, try playMoveNow. Or perhaps even use it as a gesture.

Also check that _this refers to the unit that fired and is not an array of some sort.

Share this post


Link to post
Share on other sites

This also doesn't work. Maybe there is a mistake in the other config parts where it defines the animation or whatever it is doing there.

class CfgMovesBasic
{
class DefaultDie;
class ManActions
{
	BoltActionAnim_stand = "BoltActionAnim_stand";
};
class Actions
{
	class RifleBaseStandActions;
	class NoActions: ManActions
	{
		BoltActionAnim_stand[] = {"BoltActionAnim_stand","Gesture"};
	};
};
};
class CfgGesturesMale
{
class Default;
class RifleReloadProneBase;
class States
{
	class BoltActionAnim_stand: Default
	{
		file = "\tb_arifle_uts15\anim\Handanim_uts15_pump.rtm";
		looped = 0;
		speed = .24;
		mask = "handsWeapon";
		headBobStrength = 0;
		headBobMode = 0;
		canPullTrigger = 1;
		rightHandIKBeg = 1;
		rightHandIKEnd = 1;
		leftHandIKCurve[] = {0,1,0.05,0,0.95,0,1,1};
	};
};
};

This config part is from another rifle, but my animation was played when I used it as the reload-animation with "reloadaction".

Share this post


Link to post
Share on other sites

Mhmm, it won't even show me the hint if I use this:

			class EventHandlers
		{
			fired = "(_this select 0) hint 'Shot fired'";
		};

So the problem must be somewhere else. But I have absolutely no idea of the whole config/scripting things, so I don't know how I should continue..

Share this post


Link to post
Share on other sites

Okay, now I made an init.sqf that I run with the config file to add the fire eventhandler. At least it shows me the hint/message after every shot, but when I enter the name of the animation (how I named it in the config file) it does nothing. I would say that Arma simply does not know where it should find the animation. I also tried to add the path, but it also doesn't work (playmove '\tb_arifle_hkump45\config\CfgGesturesMale\PumpActionStand').

Has anyone any ideas how I can solve this problem?

Share this post


Link to post
Share on other sites
Try PlayGesture?

This one does not work too. Maybe I have to implement my animation into another Arma config so that the game knows which animation I mean with this code..

Share this post


Link to post
Share on other sites

Have you binarized the animation? If I recall that was an issue that also stopped me from being able to use an animation in my glasses mod. Check your RPT file for any errors also.

Share this post


Link to post
Share on other sites
Have you binarized the animation? If I recall that was an issue that also stopped me from being able to use an animation in my glasses mod. Check your RPT file for any errors also.

Shouldn't the animatio be binarized when I make a *.pbo out of the addon? Or does it require an extra step for the *.rtm ?

Share this post


Link to post
Share on other sites

You will need to binarize the PBO. It doesn't automatically binarize the pbo.

Share this post


Link to post
Share on other sites
You will need to binarize the PBO. It doesn't automatically binarize the pbo.

I always used the option 'binarize' in PinPBO, so I would say that this should not be the problem. The animation worked, when I used it as a normal reload animation, but now I would like to start it at a certain time (in this case: after every shot).

Share this post


Link to post
Share on other sites

Now it works by using two additional .sqf files. But there are two other problems.

Similar to this video (this is NOT my video) the upper body changes its position everytime during the animation. So it always moves a bit away from the weapon, which looks weird.

In addition to that, the body stays about 2.5-3s in this position, which Is mich longer that the animation itself. Is there an way to change this? And can I allow the player to look through the weaponsights during the animation?

I hope that some animation specialists can answer this.

Thank you for your help!

Share this post


Link to post
Share on other sites

Simply animate teh upper body along with the arms to stay in the neutral position. All BI animations do not have this problem, but most community made ones so far do because apparently the body switches to the same upright position it has when standing at ease. Only animating the arms like in other fps's doesn't work in arma, you gotta animate the whole body pretty much.

Share this post


Link to post
Share on other sites

Okay, so does it mean that the body position of the current animation in oxygen is in the neutral position or do I just have to change some options, like adding keyframes to the body too?

<a  href=oxygen_zps795e7582.png' alt='oxygen_zps7

And it is possible to animate the pump-part of the weapon as well? How would I have to do that?

Thank your for your help!

Share this post


Link to post
Share on other sites

-----

Edited by BlackPixxel
problem of this post solved

Share this post


Link to post
Share on other sites

I was finally able to make a simple pump-action animation. At the moment there is just the movement of the hand and a little weapon shake. Next to that the following video also shows a test HE-ammunition where I used the 25mm AA-rounds :cool:

In the future I will have to improve this and add a animation of the moving part of the weapon as well, but for now my knowledge is too limited, so I will move this task further away.

My next step is the reload-system. I would like to be able to not have the typical magazine system where you load the 15 bullets at once and cannot combine two half-filed magazines. So I will use 1-round magazines. Each time you load a magazine/bullet the ammocount of the weapon will increase by one. In addition to that I want to make a reload-animation that repeats dependend on the rounds that are left for a full weapon. The only drawback I could imagine is that you will have to click very often to fill your inventory with single bullets, but the enhanced flexibility might be great.

If someone has any ideas to one of the steps, feel free to share them, I could need any help because I often feel like :confused:

Share this post


Link to post
Share on other sites

Something counter-strike/battlefield like should be possible with a reloading script. You can also make the pump handle move with a little script.

PS. To do the duel feed system check out the config classes of the 30mm RCWS weapons.

Share this post


Link to post
Share on other sites

Mhmm, I'm stuck at the reload-part.

Does anyone know how I can run an .sqf file everytime when the player is reloading his weapon?

This is very important to make the bullet per bullet animation.

Share this post


Link to post
Share on other sites

You can use the following method.

Use displayAddEventHandler to add a new KeyDown event. Example:

(findDisplay 46) displayAddEventHandler ["KeyDown","_this call MY_FUNCTION"];

In the function called by the event check that the dikCode matches the actionKey. Example:

if ((_this select 1) in (actionKeys "ReloadMagazine")) then { DO STUFF };

Share this post


Link to post
Share on other sites

Okay, I now used the following code:

waitUntil {!(isNull (findDisplay 46))};
menu = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) in actionKeys ""ReloadMagazine"") then {hint 'reload weapon'; _this execvm '\tb_arifle_hkump45\scripts\PumpAction.sqf';}"];

While it will show me the hint the PumpAction.sqf won't run. The code to call the sqf is the same like for the pumpaction animation itself after every shot which works.

So why does it not like to run the file inside of the if-loop?

Share this post


Link to post
Share on other sites

can't just run a FIRED EH? - let me rephrase - if by "run script when reloading" as in the reload and pump of the shotty, the FIRED EH will work. If you mean by magazine reload, probably best to use the FIRED EH and use a

"if count rounds left < 1 then {do something}" logic.

EDIT - Of course the FIRED must be applied to the man not the gun. UM.... there IS a reload magazine animation source... check the BIKI for details. Normally use that to hide the magazine, ammo belts etc. during a magazine reload. Then you could run something from that like an INIT to wait for the animation to be "1" then do something. Still a script for the man but you get the idea.

What *exactly* are you trying to run on the magazine reload? Just that animation loop? Not sure how to do new custom animations like that.

Edited by hcpookie

Share this post


Link to post
Share on other sites

What *exactly* are you trying to run on the magazine reload? Just that animation loop? Not sure how to do new custom animations like that.

I want to run a new script with a new loop. Until the magazine is full I want to play a reload-animation for every single round and increase the ammocount by one at every iteration.

In the end you should just reload one single bullet if you just shot one and two if you shot two instead of reloading the full 7 rounds each time.

But I have to approach this goal in tiny steps with my little knowledge about scripting and mod-making

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  

×