Results 1 to 8 of 8

Thread: Proper settings for hidevalue and revolving animation for ammo belts?

  1. #1

    Proper settings for hidevalue and revolving animation for ammo belts?

    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:

    Code:
    			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:

    Code:
    			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?

  2. #2
    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;
    };

    Last edited by Thromp; May 20 2012 at 16:31.
    A chopper cup of Coffee in a chopper coffee pot
    TOH Now with added Coffee
    http://www.helpivanmartin.org/

  3. #3
    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.

  4. #4
    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
    Last edited by Thromp; May 21 2012 at 16:37.

  5. #5
    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?

  6. #6
    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;

  7. #7
    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/H...royable_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?

    Spoiler:
    Last edited by hcpookie; May 22 2012 at 22:14.

  8. #8
    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:
    Spoiler:


    MODEL.CFG SKELETON:
    Spoiler:


    MODEL.CFG CFGMODELS:
    Spoiler:


    3D Model Sections in O2:
    Spoiler:


    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".
    Last edited by hcpookie; Jun 21 2012 at 16:57.

Similar Threads

  1. ArmA without proper ammo weights?
    By IceBreakr in forum ARMA - GENERAL
    Replies: 6
    Last Post: Feb 19 2007, 03:35
  2. ammo crate config settings
    By Sgt Anderson in forum OFP : CONFIGS & SCRIPTING
    Replies: 0
    Last Post: Feb 25 2006, 21:36
  3. Revolving
    By in forum OFP : O2 MODELLING
    Replies: 9
    Last Post: Feb 24 2004, 12:03
  4. Animating ammo belts and stifs
    By bmgarcangel in forum OFP : O2 MODELLING
    Replies: 0
    Last Post: Nov 29 2003, 04:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •