Jump to content
Sign in to follow this  
soul_assassin

UserActions conditioning

Recommended Posts

hello,

I was wondering if anyone knows how to properly condition the useraction class in the cfgvehicles. For example:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CXVCV

                 {

                   displayName = "XCXX";

                   position = "";

                   radius = 0.1;

                   condition="this animationPhase ""VCHD"" < 0.5";

                   statement="this animate[""HSBD"",1]";

                   onlyForPlayer = true;

                 };

works fine and everything is jolly. But if I want multiple conditions line animPhase and speed to be a certain value such as:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CXVCV

                 {

                   displayName = "XCXX";

                   position = "";

                   radius = 0.1;

                   condition="(this animationPhase ""VCHD"" < 0.5) and (this speed < 1)";

                   statement="this animate[""JHDK"",1]";

                   onlyForPlayer = true;

                 };

For this example ive tried:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">condition="(this animationPhase ""VCHD"" < 0.5) and (this speed < 1)";

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">condition="(this animationPhase ""VCHD"" < 0.5) && (this speed < 1)";

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">condition="this animationPhase ""VCHD"" < 0.5; this speed < 1;";

all of which spit out an error either "missing "("" or "missing ";"".

So how should it be done?

Share this post


Link to post
Share on other sites

directly from a working addon of mine:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class range_menu

  {

    displayName="Select Range";

    position="range_menu_pos";

    radius=5;

    condition="(player == gunner this) && (this animationPhase ""range_menu_anim"" < 0.5)";

    statement="this animate[""range_menu_anim"",1]";

    onlyforplayer = true;

  };

I can't see what you're doing 'wrong', but I know the code I posted works, so you should be able to copy paste and alter to your specific needs.

Share this post


Link to post
Share on other sites

just realised that stupid me had wrong syntax :P

should have been 1 > speed this rather then this speed < 1

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  

×