Jump to content
Sign in to follow this  
mad rabbit

Disable bas cas action for my cti map

Recommended Posts

I'm making a CTI map within which I have CreateVehicle'd a BAS AH-60L DAP Blackhawk into a group of its own.  In addition, I start with a BAS Satcom (for testing purposes) and as such the "RADIO: Close Air Support" action appears in my menu.  This is due to the following which is an extract from the bas_mah60.bpo config.cpp:

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

class 60DAPSupport

{

displayName="RADIO: Close Air Support";

position="";

radius=9999999;

condition="!(player in this) && (({_x hasweapon {bas_satcom}} count units group player)>=1)&& (group this != group player)&& (count units group this)==2 && !isengineon this && !(isnull driver this) && !(isnull gunner this) && this animationphase {switch1DAPCAS}==0 && !(BAS_CAScalled)&& (player == (leader group player))";

statement="[this,player] exec {\bas_mah60\fx\BAS_CAS.sqs}";

};

};

class EventHandlers

{

init = "_this select 0 exec {\BAS_MAH60\FX\BAS_60init.sqs}; _this select 0 exec {\BAS_MAH60\FX\BAS_CASinit.sqs};_this select 0 animate [""sidedoorr"", 1]; _this select 0 animate [""sidedoorl"", 1]";

Please note: this was an extract from the excellent BAS MAH60 addon/pbo

However, I which to prevent this option from appearing in a players action menu if they or any of the AI in their group have the BAS Satcom, as this would conflict (in terms of balancing which I don't want to go into) with the CoC artillery and more importantly I wish to run my own CAS script.

I have tried a couple of things sigularly and in combination with each other centering around the "!(BAS_CAScalled)" requirement for the action to appear.  These include:

trying to remove all eventhandlers of the type "init" from the CVed helo

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

_CASHelo removeAllEventHandlers "init"

adding an event handler that sets "BAS_CAScalled" to false if it is true and attaching this to the CVed Helo

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

_CASHelo addEventHandler ["init",{(if !(BAS_CAScalled) then {BAS_CAScalled = true;PublicVariable "BAS_CAScalled"})}];_debugCAS = Format ["BAS CAS state = %1",BAS_CAScalled];hintc _debugCAS

globally stating at the start of the CTI map and within a looping update the

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

BASCAScalled = false;PublicVariable "BAS_CAScalled"

and now I'm outta of ideas.  This is mainly due to the fact that I only started learning scripting 2 months ago and I have no idea about config.cpp and if their resultant effects/settings can be modified.  And I also can assume that some of my trialed solutions don't make sense hence this post sad_o.gif

(1)So if anyone has any ideas on how to get around this please help me (particularly if your a BAS member smile_o.gif)

Follow-on question:

(2)Is it actually POSSIBLE to modify the effects of an addon by including a script or even a config.ccp within the main dir of a map pbo?

I assume it is at least for addons to modify the effects of config.cpp settings from other addons, which the technique used by most mods esp. ECP.

Thanks in advance.

Share this post


Link to post
Share on other sites

Just make

this animate ["switch1DAPCAS", 1]

or any other value than 1, but not 0!!!

The only bad thing is, I don't know which side effects this has, so use it with caution.

Share this post


Link to post
Share on other sites

Thank you for your quick reply vektorboson.  I have also found your dialog tutorial very informative as well.

I was going to use your solution but was hoping their was another as I was also afraid of the side effects of changing the animation phase of a newly CVed BAS helo.  It definitely disabled the CAS but I am unsure if it will have effects down the track once I start running the helo through some scripts.  Again, some input from a BAS member would be appreciated.

In addition, I am again eager to hear from a BAS member in relation to this as I am interested to know why my solution to change the BAS_CAScalled state to "false" did not work.

Actually, on a more broader note, does anyone have an answer to my previous described question (2) or can direct me to some info on it (I did a thorough search on the net)?

Further explaination:

-include a config.cpp file in a map pbo to modify the characteristics of an addon e.g. decrease certain weapon damage etc. Luckily/brilliantly CoC include parameters such as 'M101 firing range' that you can alter/specify in your map (and a quick plug for them as they have been very heplful in their private "Ask The Team" forum *thanks to dinger esp.*)

if a config.cpp cannot be included in a map pbo to alter an addon in game then what about

-use a script within a map to modify parameters/conditions (such I tried with BAS_CAScalled) within an addon's config.cpp for in game. i.e. same effect but using a script instead of a config.cpp

It would be interesting to know how this would be accomplished with a map as opposed to an addon. I assume that this is the basis for most sound packs e.g. ECP altering sound sources or gfx to their pbos as opposed to default BIS ones.

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  

×