Hard Light Productions Forums

Hosted Projects - Non-FreeSpace => MechCommander OmniTech => Topic started by: Drewbs on March 24, 2018, 05:50:15 pm

Title: Airstrikes
Post by: Drewbs on March 24, 2018, 05:50:15 pm
Hey guys, I have been tweaking the game a bit and I wanted to buff airstrikes, but I can't find them. What files control them?
Title: Re: Airstrikes
Post by: Drewbs on March 25, 2018, 08:35:03 am
And as a more important question, can I script airstrikes?

I figure if the Aerospotter can call them in, there must be a way to do it with a script.
Title: Re: Airstrikes
Post by: Drewbs on April 04, 2018, 01:05:27 am
I am assuming one of the many people who have viewed this has some knowledge of the core coding in the game.


So I have this snippet from aerospotter brain code that I think sends the airstrike:
CallStrikeEx(508,-1,AttackPoint[0],AttackPoint[1],-1.0,TRUE,6.0);

BUT, when I try to plug it in to mission script it does not work. Any advice?

Any idea what 508 is for? or any of those other numbers besides the attack coords?
Title: Re: Airstrikes
Post by: RizZen on April 04, 2018, 06:44:49 am
The numbers are coordinates - when IT works like MC1 - i think it does - airstrikes are to find in mission.abl Files, so they ARE Part of Script/scripted.
Title: Re: Airstrikes
Post by: wolfman-x on April 04, 2018, 02:53:26 pm

Drewbs;

here are the definition details for this scripting command in MC2X; maybe that helps you.

callstrikeEx(striketype, -1, xpos, ypos, -1.0, true, time);

calls a strike to a specific location

integer striketype: 0 = demolitioncharge, 1= airstrike, 2 = sensorstrike
integer -1 (do not change !)
real xpos: x coordinate for strike
real ypos: y coordinate for strike
real -1.0 (do not change !)
bool true (do not change !)
real time 15.0 for demolition charge, 0.0 for airstrike snd sensorstrike
Example: callstrikeEx(1, -1, bombspot[0], bombspot[1], -1.0, true, 0.0);

Title: Re: Airstrikes
Post by: Drewbs on April 04, 2018, 10:22:55 pm
Thanks for the breakdown!

Unfortunately, it is not working when I try to implement it. Here is the simple version of what I have:

static boolean    LopAAA;

function init;
       code
LopAAA = TRUE;
endfunction;

//     Main Code
      code
if (LopAAA) then
   CallStrikeEx(1, -1, 235, -1600, -1.0, true, 0.0); //This is the line# ref. in error message
   LopAAA = False;
endif;

I get an error saying:

STOP    :  SYNTAX ERROR data\missions\a_aaa_test.abl [line 82] - (type 16) Incompatible types "callstrikeex"

Do I need to define a strike up top as a boolean or an integer?
Title: Re: Airstrikes
Post by: wolfman-x on April 05, 2018, 07:32:28 am
I am not into MC1..., thus I can not really help.
Try command callstrike instead of CallStrikeEx. Both commands exist in the MC2 code.
Beside this the striketype originally refers to a package number inside object2.pak defining the striketype.
This is similar but different in MC2 then in other MC versions.
Striketype may be 508 in your case.
Title: Re: Airstrikes
Post by: RizZen on April 05, 2018, 10:08:25 am
I understood Hes doing it for MC2.  :eek:
Title: Re: Airstrikes
Post by: Drewbs on April 05, 2018, 05:57:31 pm
Yes, MC2 or well, MCO. I will dig in to that .pak and see what I can figure out.

(I got that original 508 number from the brain file for an aerospotter on the Baxter's Gambit mission of the Carver V campaign)
Title: Re: Airstrikes
Post by: RizZen on April 05, 2018, 10:54:59 pm
I won't inspire object.pak that much. Better analyze all mission files of missions with automated airstrikes... find the lines and compare them... this mostly gives me the answers I need.
Title: Re: Airstrikes
Post by: wolfman-x on April 06, 2018, 09:42:54 am
Drewbs,

your little script works perfectly in MC2X if you you just modify the location input data format.
 
CallStrikeEx(1, -1, 235.0, -1600.0, -1.0, true, 0.0);

I do not see, why that should not work in MCO as well; code is same regarding this.

My prior definitions are correct for both beside there is no demolition charge in MCO.

I tested it under MCO as well, works as expected. Demolition charge for MCO calls airstrike.
Title: Re: Airstrikes
Post by: RizZen on April 06, 2018, 12:32:06 pm
Hey Wolfman-X, i bet one beer that this was his last post  :D
Title: Re: Airstrikes
Post by: Drewbs on April 08, 2018, 01:19:44 am
Sorry for the slow response, I was working on different levels. I will try again, but if having decimal points if the difference I am gonna slap myself. And no Rizzen, I will be posting more, I am making a campaign and I am sure I will have other questions.
Title: Re: Airstrikes
Post by: Drewbs on April 08, 2018, 01:47:36 am
Son
of
a
*****.

Yep that worked! Now I know I need the .0 on things and yall aren't just putting it there just because. You rock Wolfman!
Title: Re: Airstrikes
Post by: RizZen on April 08, 2018, 07:03:10 am
It´s a bit ago since i worked last time on mission scripts im sry i didn´t pointed it out. Welcome back, i gues i owe Wolfman-X a cold one ^^ - im excited for your Campaign!
Title: Re: Airstrikes
Post by: wolfman-x on April 08, 2018, 08:22:52 am
Let the airstrikes hail down now. :nod: