Jump to content
Sign in to follow this  
hcpookie

Proper settings for hidevalue and revolving animation for ammo belts?

Recommended Posts

I've ran into a problem. Attempting to get the ammo belt values working.

The animation to hide the last few rounds of the ammo belt doesn't have enough documentation to figure out. I've tried to imitate the existing configs for ammo belts and it doesn't seem to work. The animations either reverse or stay hidden at init. I've tried to reverse values (set 1 to -1 or 0 etc) to no avail.

Example from the M2 hummer:

			class Bullet012
		{
			type="hide";
			source="revolving";
			selection="bullet012";
			minValue = -1.0;//rad -57.29578
			maxValue = 0.0;//rad 0.0
			minPhase = -1.0;//rad -57.29578
			maxPhase = 0.0;//rad 0.0
			hideValue = 0.98001003;
		};

The hideValue is - I THINK - based on the magazine capacity. So a 100-round magazine would have the values incremented by 100. So for a revolver, would this value be incremented by 6?

For example 1\6 =

- bullet 1 hideValue = 0.16667

- bullet 2 hideValue = 0.33334

- bullet 3 hideValue = 0.5

- bullet 4 hideValue = 0.66667

- bullet 5 hideValue = 0.83333

- bullet 6 hideValue = 1

... is this correct?

My understanding of the hideValue is that when the Revolving animation is animated once, the bullet 1 value will be "true" and it will hide. Then the second animiation will make the bullet 2 value "true" etc. and repeats until the magazine is empty. Taking this logic, the hideValue settings for the last few rounds of a 100-round belt config makes sense... 0.96001, 0.97001004, 0.98001003

I have tried applying this formula in my model and it doesn't work. I am imitating the minValue/maxValue and minPhase/maxPhase settings from the HMMWV50 model.cfg. Example:

		class Bullet001
		{
			type="hide";
			source="Revolving";
			SourceAddress = 2;
			selection="bullet001";
			memory = 0;
			minValue = -1.0;
			maxValue = 0.0;
			minPhase = -1.0;
			maxPhase = 0.0;
			hideValue = 0.16667;
		};
		class Bullet002
		{
			type="hide";
			source="Revolving";
			SourceAddress = 2;
			selection="bullet002";
			memory = 0;
			minValue = -1.0;
			maxValue = 0.0;
			minPhase = -1.0;
			maxPhase = 0.0;
			hideValue = 0.33334;
		};
... etc.

The hide animation is "active" at startup, and so you never see the bullets. The ammo appears empty.

I have tried removing:

- sourceaddres

- memory

- minPhase

- maxPhase

... and no change.

I have tried adding initPhase to animationsources in the config... nothing.

The best I can do is reverse the values to make the animations "unhide" so it appears to be filling up the empty ammo! :) This makes me conclude that the model skeleton settings are correct and this issue is a problem getting the values configured properly. I've done enough to know that the minValue maxValue settings can't be reversed - can't have min = 1 and max = 0 for example. I have experimented with every variation I can think of - reversing values, using negative values, and using the hideValue for the maxValue settings. Nothing seems to affect the animation.

Any ideas to make this work?

Share this post


Link to post
Share on other sites

i dont know about hiding in weapons but Hidevalue is a percent of the source

so i believe

type="hide";

source="Revolving";

hideValue = 0.33334;

this will hide when revolving animation reaches 0.33334 % of 1 full turn of revolving or 1 maybe.

the last of the belt i think are commonly hidden using isempty source like magazine IIRC ?

revolving in the root is defined as follows ( you may need tor add this if you think the default is not good for your weapon maybe think )

class Revolving

{

type="rotation";

source="revolving";

selection="buben";

axis="osa_buben";

memory="true";

animPeriod=0;

angle0=0;

angle1="rad -360";

};

class Bullet001

{

type="hide";

source="Revolving";

SourceAddress = 2;

selection="bullet001";

memory = 0;

minValue=0.000000;

maxValue=1.000000;

hideValue = 0.16667;

};

class Bullet002 :Bullet001

{

hideValue = 0.33334;

};

class Bullet003 :Bullet001

{

hideValue = 0.63334;

};

Edited by Thromp

Share this post


Link to post
Share on other sites

Making buben inherit from Revolving didn't work; I had to define the buben cylinder rotation.

And what you posted is exactly as I have the bullet00x definitions. I reviewed other hide animations I've done - sunroof, camonet, and the wheel damage tutorial. Can't seem to make anything work.

Share this post


Link to post
Share on other sites

Well as long as your bones in model.cfg are correct and you have defined animation sources in your .cpp you really should be ok

you really should not need to redefine revolving in your model.cfg , but depends on your p drive set up I guess , to show in bbuldizer you may but not for game

Have you set up your anim sources in your cpp ?

Animation sources

Class revolving

Source = revolving

Weapon = your weapon

Edited by Thromp

Share this post


Link to post
Share on other sites

I set anim sources but made no impact; still same behavior. Something I found - I tried setting the hide values to negative: hideValue = -0.16667; ...etc. and now the animation is completely hidden at startup! Of course it doesn't toggle on/off regardless of how it is configured. If it is animated "unhidden" at init, it stays "unhidden". If it is animated "hidden" at init, it stays "hidden". This behavior stays the same regardless of magazine change. WHICH, by the way, works fine. I have the cover animations flip up/down correctly with "reloadMagazine".

At this point it appears that the hideValue will make a hidden object unhidden only if the value is decremented. Negative values have the "unhide" effect regardless of the config. Which is exactly how the hidden objects in my other configs such as sunroof, camonet, etc. work! (e.g. "animate ['sunroof', 0]" will reveal the sunroof). How do the BIS ammo belts' bullet001, bullet002, etc. config work with minvalue = -1.0 and maxvalue = 0 ? Yes that is incrementing upwards but doesn't affect my animation.

So if I'm on the right track, I think my question is how to reverse the values that get passed to the hide animation?

Share this post


Link to post
Share on other sites

hmm , very complicated to just hide bullet here i think.

i think these values are screwed is your problem

minValue = -1.0;

maxValue = 0.0;

minPhase = -1.0;

maxPhase = 0.0;

init phase is 0 of revolving and end phase is 1 (or 360 degree)

hidevalue of 0.10000 will hide bullet at 0.1 of 360 degree

so all this min and max phase in your bullets to me should be simply

minValue = 0;

maxValue = 1;

minphase = 0;

maxphase =1;

Share this post


Link to post
Share on other sites

Totally agree the values are screwed up. I'm imitating the BIS configs I've extracted. Every single one of them have the same -1/0 values. The other "hide" animations indicate to use the same thing... like the damaged tire hide tutorial here:

http://community.bistudio.com/wiki/How_to_create_destroyable_wheels

... where the example shows to use -1/0:

The following class is an example animation that makes the destroyed wheel visible:

class wheel_1_1_destruct_unhide

{

type="hide";

source="HitLFWheel";

sourceAddress="mirror";

selection="wheel_1_1_unhide";

minValue = -1;

maxValue = 0;

minPhase = -1;

maxPhase = 0;

hideValue = 0.010000;

};

I've made destroyable wheels using the 0/1 values but that was with the damage animation source... very simple too - once the damage threshold is reached, animate the models. So I'm not sure what makes this "revolving" animation source be so different. I must be doing it wrong. I've tried setting the cylinder (buben) animation to negative values, thinking perhaps the scale is backwards for an "unhide" effect, but no change in behavior.

This example is from the M2 MG config. I'm not sure what the rad values are that are commented. Perhaps the extract tool isn't reading these properly?

class Bullet001

{

type="hide";

source="Revolving";

selection="bullet001";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.87001;

};

class Bullet002

{

type="hide";

source="Revolving";

selection="bullet002";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.88001;

};

class Bullet003

{

type="hide";

source="Revolving";

selection="bullet003";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.89001;

};

class Bullet004

{

type="hide";

source="Revolving";

selection="bullet004";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.90001;

};

class Bullet005

{

type="hide";

source="Revolving";

selection="bullet005";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.91001004;

};

class Bullet006

{

type="hide";

source="Revolving";

selection="bullet006";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.92001003;

};

class Bullet007

{

type="hide";

source="Revolving";

selection="bullet007";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.93001;

};

class Bullet008

{

type="hide";

source="Revolving";

selection="bullet008";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.94001;

};

class Bullet009

{

type="hide";

source="Revolving";

selection="bullet009";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.95001;

};

class Bullet010

{

type="hide";

source="Revolving";

selection="bullet010";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.96001;

};

class Bullet011

{

type="hide";

source="Revolving";

selection="bullet011";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.97001004;

};

class Bullet012

{

type="hide";

source="Revolving";

selection="bullet012";

minValue = -1.0;//rad -57.29578

maxValue = 0.0;//rad 0.0

minPhase = -1.0;//rad -57.29578

maxPhase = 0.0;//rad 0.0

hideValue = 0.98001003;

};

Edited by hcpookie

Share this post


Link to post
Share on other sites

Update - it works!

Now someone needs to explain why rebooting my computer made the config start to work! :( I am assuming here that O2 or the PBO packing tool isn't releasing something from memory meaning there's a memory leak in one of those applications. Regardless, the moral of the story is that if you have a config or model editing issue, REBOOT AND TRY AGAIN!

Incredibly frustrating.

Here's the final config that worked for me:

CONFIG.CPP:

class animationsources {

class revolving {

source = "revolving";

weapon = "my_weapon";

};

MODEL.CFG SKELETON:

class CfgSkeletons {

class Default;

class my_weapon: Default {

isDiscrete = 1;

skeletonInherit = "Default";

skeletonBones[]=

{

"reload_cover","",

"buben","reload_cover",

"shells", "buben",

"bullet006","shells",

"bullet005","bullet006",

"bullet004","bullet005",

"bullet003","bullet004",

"bullet002","bullet003",

"bullet001","bullet002",

"reload_knob","",

"trigger","",

"zasleh",""

};

};

};

MODEL.CFG CFGMODELS:

class CfgModels {

class Default;

class my_weapon: Default {

sections[]=

{

"zasleh"

};

skeletonName="my_weapon";

class Animations

{

class buben

{

type="rotation";

source="revolving";

selection="buben";

axis="osa_buben";

memory=1;

angle0=0;

angle1="rad -360";

};

class Bullet001

{

type="hide";

source="revolving";

selection="bullet001";

sourceAddress="mirror";

minValue = -1;

maxValue = 0;

minphase = -1;

maxphase = 0;

hideValue = 0.001;

};

class Bullet002: Bullet001 {

selection="Bullet002";

hideValue = 0.16667;

};

class Bullet003: Bullet001 {

selection="Bullet003";

hideValue = 0.333336;

};

class Bullet004: Bullet001 {

selection="Bullet004";

hideValue = 0.500004;

};

class Bullet005: Bullet001 {

selection="Bullet005";

hideValue = 0.666672;

};

class Bullet006: Bullet001 {

selection="Bullet006";

hideValue = 0.916674;

};

class reload_cover_open

{

type="rotation";

selection="reload_cover";

source="reloadMagazine";

axis="reload_cover_axis";

memory=1;

minValue=0.08;

maxValue=0.12;

minPhase = 0.08;

maxPhase = 0.12;

angle0=0.000000;

angle1=1.570796327;

};

class reload_cover_close: reload_cover_open

{

minValue = 0.9;

maxValue = 0.95;

minPhase = 0.9;

maxPhase = 0.95;

angle0 = 0.0;

angle1=1.570796327;

};

class reload_knob: buben

{

selection="reload_knob";

};

class trigger

{

type = "rotationZ";

source = "reload";

selection = "trigger";

axis = "trigger_axis";

memory=1;

minValue = 0;

maxValue = 1;

angle0 = "rad 0";

angle1 = "rad -10";

};

};

};

};

3D Model Sections in O2:

buben: Rotating cylinder (Default BIS cylinder definition): Rotation as defined in this config is clockwise when viewed from gunner's eyes

shells: All bullet tips...

Bullet001: Bullet tip of first shot fired: Top cylinder that is in line with barrel

Bullet002: Bullet tip of second shot fired: next cylinder to rotate into the barrel..

Bullet003: "" "" third shot fired...

Bullet004: "" "" 4th shot fired...

Bullet005: "" "" 5th shot fired...

Bullet006: "" "" 6th shot fired...

The data for the hide value depends on how far the cylinder rotates (all are simple percentages). The values are such that immediately after the shot, the bullet disappears to simulate "fired". The values will probably need to be altered for a counter-clockwise rotation. All are un-hidden on reload when the cylinder is rotated back to "0".

Edited by hcpookie

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  

×