Home   Help Search Login Register  

Author Topic: Unique airstrike script.  (Read 4392 times)

0 Members and 1 Guest are viewing this topic.

Baphomet

  • Guest
Unique airstrike script.
« on: 15 Nov 2002, 02:23:29 »
I've been playing wargasm a bit lately. I like it because it has certain tactical elements that OFP lacks without a fair deal of scripting. One thing I liked about that game in particular was the airstrikes.

Has anyone made a script wherein, you can spawn a flying plane at an entry point, fly to a specified location, once all its ordinance are released or a certain amount of time has passed; then return to its entry point and disappear? I'd like to add something like this to a mission I'm going to make. However I'm not quite sure as to how.

My reason for this being that with a script like that, you would be able to use the script repeatedly. Not having to worry about having an existing a-10 taking off from an airfield (or the closest approximation) and it simply flying around for the duration after it has spent its ammo and runs out of fuel and crashes.

Alternately making a script very similar except specifying a plane to release its payload at a marker location would also be useful.

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #1 on: 17 Nov 2002, 15:27:17 »
OK you threw down the gauntlet and I picked it up and slipped it on  ;)

I had a go at your request, let me know what you think.

Post back if you have any comments or need any help.

nb: Action menu is a little dodgy. Might be best to incorporate it into the radio commands.
« Last Edit: 17 Nov 2002, 15:42:25 by Skumball »

Baphomet

  • Guest
Re:Unique airstrike script.
« Reply #2 on: 20 Nov 2002, 23:26:15 »
     That is so cool. Exactly how I imagined it. Save for the small issue of the ordinance dispersal point being fixed. Most of the airstrike scripts you see on ofpec are fixed on a certain location.

     It's fine for ambience or a scripted event for a single player game. However I was thinking more along the lines of something similar to the movable markers used in the command.abel  mission script. Of course, for the sake of balance adding a brief interval in between airstrikes would also be nice. I haven't fiddled around with the script yet. Still, it looks great and could be quite useful.
« Last Edit: 20 Nov 2002, 23:28:22 by Baphomet »

Baphomet

  • Guest
Re:Unique airstrike script.
« Reply #3 on: 21 Nov 2002, 01:31:16 »
     Well. To solve the problem of not being able to move the marker I basically took movemarker.sqs and radioinit.sqs from Spinor's pre-command engine "controlling groups via moveable marker" script (So credit and thanks go to both to Skumball and Spinor for this). Then integrated it into the existing script with a bit of guesswork and intuition. It was rather easy, for which I'm grateful since half the time with scripting I don't know what the hell I'm doing anyhow.

     So, now I can move the airstrike marker around. This makes it much more tactically feasible not to mention gratifying to paint a target and have it blown to pieces at a moments notice. Now I think I'll try and add a time interval and perhaps a limit on the amount of airstrikes you can have if they are shot out of the sky on their bombing run.


Here it is. The modified version, if anyone wants it. If anyone else makes any interesting modifications to it. I'd like to see it uploaded in another post.
« Last Edit: 21 Nov 2002, 01:32:52 by Baphomet »

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #4 on: 21 Nov 2002, 05:23:00 »
Thanks for the feedback Baphomet.

I have made some major changes and completely rewritten the script to take advantage of the onMapSingleClick function incorporated into 1.85.

Now you can execute the same airstrike by simply clicking on the map view!

Comments and suggestions appreciated by anyone who uses the script. I have uploaded the same zip file to the code snippets section on this site.

Baphomet

  • Guest
Re:Unique airstrike script.
« Reply #5 on: 21 Nov 2002, 11:57:59 »
That works quite well too. With the small exception that if you attempt to issue a waypoint for a soldier to move to in the map. It automatically places down the airstrike marker (useful for someone in a group who isn't in command of units I figure).

Still, its good stuff. More precise than my method. I recall seeing a V2 rocket script which required you to create a marker and name it something and then it would launch the rocket at that destination. That might be an option to explore as well. I think I might check into that when I get some time.

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #6 on: 21 Nov 2002, 13:20:25 »
Hehe, I'm still learning as I go. The onMapSingleClick also receives whether 'shift', 'alt, or 'shift-alt' are also pressed on mouse-click so I will try and implement that, but I hadn't figured it out last night (it was 3am!).

I'm not sure if holding these keys down has some other effect built-in to OFP. I know that alt-click in the game tells a unit to watch that particular direction but I'm not sure about what happens in the map screen. I'll get back here as soon as I work it out.

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #7 on: 21 Nov 2002, 14:12:20 »
Right I have looked into it further and the onMapSingleClick will pass a value of how many units the player has selected to command. A simple 2 lines of extra code have now been added at the start to exit the script if any units are selected. The init.sqs has also been modified to pass the _units value. Hope this solves the problem.

Viriato

  • Guest
Re:Unique airstrike script.
« Reply #8 on: 21 Nov 2002, 19:05:01 »
I have find your script amazing!
I have been playing with it, and only complain about the unrealistic behave of the bombs, so, i added certain modifications;

Assigned the bombs with the same direction the plane has when the bombs are spawned under the plane.

Added the bombs with the same velocity the plane has scaled down (0.3).

Reduced the number of bombs from 6 to 3

reducud the dispersion.

So, now, the bombs drop facing the target and dont drop flat, but fly a little and hit the ground just as a real bomb do!
Now it looks much more realistic and is very accurate.

I have attached the missión, test it and tell me wath you think.

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #9 on: 21 Nov 2002, 19:59:35 »
Thanks Viriato, it's always great to receive feedback. I think that your additions to the code are excellent and I will update my script with your work and mention you at the top. I'll then update my upload to the code snippets on this site once they put it up.

I might tweak the script further, but I think it is pretty good as it is. As always, comments and suggestions are more than welcome.

Viriato

  • Guest
Re:Unique airstrike script.
« Reply #10 on: 21 Nov 2002, 20:38:23 »
I think that the only way to make the script better is to remove a bomb of the plane each time the script spawn a bomb under the plane in order to create the impression that the plane has really launched the plane, i will try this later, now i am at work.
Regards, glad to see you liked the modifications i made.

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #11 on: 21 Nov 2002, 22:47:43 »
The A10 plane used in the mission isn't actually the LGB variant. I haven't found out the name of the LGB A10 so if anyone knows that would help make it look a bit better. At the moment it is the standard A10 with the rockets so removing a rocket on each run would be a bit pointless. Once an LGB A10 is used I can start working out how to actually get the pilot to drop the bombs without having to spawn any seperately. I have looked around and it seems as though the bombs NEED a laser target for the AI pilot to drop them onto. I'll keep looking.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Unique airstrike script.
« Reply #12 on: 21 Nov 2002, 23:10:55 »
da A10 with LGB is

A10LGB  :o  ::)

here is litle modified ver of da script madeit litle mor "other Scripts Freindly" (i made som kindof command engine usin da onmapsingleclick command nd i dont want air strikes on everyplace dat my men go to  ::)) so its now activated by radio u can click only once nd den u can click only after first strike

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #13 on: 22 Nov 2002, 00:21:24 »
Thanks LCD (LSD?  ;) ) That'll make an invaluable addition to the script. I'll get on it as soon as poss.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Unique airstrike script.
« Reply #14 on: 22 Nov 2002, 00:28:41 »
yep LSD  ;)  ;D

cool ;D just put my name (LCD not LSD) in da credits  ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta