Home   Help Search Login Register  

Author Topic: Unique airstrike script.  (Read 4391 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

Baphomet

  • Guest
Re:Unique airstrike script.
« Reply #15 on: 22 Nov 2002, 01:44:27 »
Now that one can order units around and still order airstrikes with the precision of a single mouse click. Its much more versatile. Viriato's is good too. However his is still operating on the "single-click-no-matter-what" code. So I'll have to convert it, If I want a more surgically accurate bombing run. I think I'll also try and modify it so that a unit with a specific name can only use the airstrike ability.

Now if only there was a way to to call the napalm script every time a laserguided bomb is spawned, as opposed to having to write something in the initstring.
« Last Edit: 22 Nov 2002, 02:01:25 by Baphomet »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Unique airstrike script.
« Reply #16 on: 22 Nov 2002, 01:54:31 »
@ Baphomet- y not ? just give me da napalm script nd i wil attach it 2 da bombs ;D (maybe  ;))

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

Baphomet

  • Guest
Re:Unique airstrike script.
« Reply #17 on: 22 Nov 2002, 02:36:45 »
Its just Shogun's napalm script. I don't know how easily one could integrate the script. Still it would look really cool.


I'm having a bit of trouble finding the command which allows one to specify unit text (Perhaps I didn't describe that right). I was just looking through the comref and I found nameofplayer However when I placed the line of script mentioned here:

? (nameofplayer != "comm1") : hint "You can't do that";exit
It didn't work. However if I change it around to say:

? (player != leader player) : hint "You can't do that.";exit ]

... it works just fine. Unless you aren't the leader. Which isn't really what I wan't at this time. =P
« Last Edit: 22 Nov 2002, 02:40:25 by Baphomet »

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #18 on: 22 Nov 2002, 14:29:50 »
OK people, here is the latest version of Airstrike. I tried to update the file in the code snippets section but all it has done is delete the original file. Anyone got any ides? It's kind of embarassing as the file has been mentioned on the OFPEC home page  :-[

*UPDATE* Never mind, it's up again  :D
« Last Edit: 22 Nov 2002, 14:35:09 by Skumball »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Unique airstrike script.
« Reply #19 on: 22 Nov 2002, 15:21:12 »
I liked it ;D

i modified it litle ;) ;D

here is wat i did

1) now wen u give it a target u call da grid locationof da position (looks mor pro ;D)

2) u can now choose 1 of 2 diffrent airstrikes ;D u can call da same plane 2 shot napalms on da enemy ;D (it can b prety hard 4 weak comps nd it requires da napalm addon included in da zip) - if u decide 2 submit da napalm part also - remember 2 change da credits 2 "modified by LCD to use the napalm addon"

:cheers:

LCD OUT

[edit] Damn forgot 2 attach it[/edit]
« Last Edit: 22 Nov 2002, 21:37:54 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Viriato

  • Guest
Re:Unique airstrike script.
« Reply #20 on: 22 Nov 2002, 19:59:48 »
LCD, where can i get the script with the modifications you mentioned?
If you dont post it, please, send me a mail at ;
todoesrelativo@hotmail.com
Regards.

Baphomet

  • Guest
Re:Unique airstrike script.
« Reply #21 on: 22 Nov 2002, 21:43:04 »
Please do post LCD. I would like to see what you've got. By the way. Anyone know what line of script I need to add to specify a certain unit to use Skum's airstirke?



I've sort of figured out a makeshift solution, at least for Skum's latest version. I just add "player == name" in the expcond string of the trigger with airstrike 1.2 However even if one can't use the airstrike, the option is still there. Any ideas as to how to remove the action in the case that one isn't authorized to use the airstrike?
« Last Edit: 22 Nov 2002, 22:01:25 by Baphomet »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Unique airstrike script.
« Reply #22 on: 22 Nov 2002, 21:50:30 »
im trin 2 post it but its not attachin  ???
trin again - if it wil not work again i wil just mail it 2 u  :-\


LCD OUT

[edit] cant attach  :o put ur emails 2 get da script
« Last Edit: 22 Nov 2002, 22:29:51 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Unique airstrike script.
« Reply #23 on: 22 Nov 2002, 22:18:58 »
Update ;D

click here 2 get da file

LCD OUT

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

Viriato

  • Guest
Re:Unique airstrike script.
« Reply #24 on: 23 Nov 2002, 17:10:32 »
People, i hate to give bad news but there is something wrong with this script;
When you try to use this script in other island diferent than desert island, the A10 fall to the ground.
Why?
This happens because the spawned plane has no speed at all, at desert island, the plane reacts before it hit the ground, but, in other islands, i donÂ't knw why, the plane dont act as quickly and hit the ground.
The way to solve this is to assing the plane with some initial speed once spawned, but i have been not able to do this.

If you open the mission.sqm with notepad you will see that a plane with the Special "FLY" line, will have initial speed even if its empty, but i have not been able to repoduce this on the script, if anybody knows how to solve this, please, tell us all.

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #25 on: 23 Nov 2002, 17:22:01 »
mmm. I have tried the script on both Koljugev and Everon and had no problems. You definately had a strikePilot soldier? That's all I can think of. Make sure all markers and the trigger are how they should be, but I doubt it is anything to do with them. If you are spawning the plane over land then maybe the height is too low. Try a value of 1000 or something to make sure it is high enough. (change +400 to +1000 in the strikePlane setPos line).

Baphomet

  • Guest
Re:Unique airstrike script.
« Reply #26 on: 24 Nov 2002, 00:28:11 »
I've had -no- problems whatsoever. In fact I've tested it on a mission I've started on Kolgujev and it looks like its going to be a really interesting addition to the game.

So. Hm. How about that question of mine?  ::)

Offline Skumball

  • Members
  • *
Re:Unique airstrike script.
« Reply #27 on: 24 Nov 2002, 02:29:48 »
Dunno, sorry. Anyone else?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Unique airstrike script.
« Reply #28 on: 24 Nov 2002, 02:44:42 »
umm didnt understand da Q  ::) dont wry its cuzim st00pid  ;)  ;D

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

Baphomet

  • Guest
Re:Unique airstrike script.
« Reply #29 on: 24 Nov 2002, 05:31:16 »
I guess it's not that big a deal. I did essentially what I wanted it to do. I was just wondering if it were possible to get rid of the airstrike radio command for people who aren't supposed to use it. Right now it is set to "Player==com" in the condition string of the triggers which activate the airstrike via radio commands.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Unique airstrike script.
« Reply #30 on: 24 Nov 2002, 11:24:31 »
u meen in multiplayer ? if so i cant help u, sry

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 #31 on: 26 Nov 2002, 00:48:12 »
I have done a bit more testing with the script and the plane does sometimes crash before the pilot reacts. In the cases where it has crashed I positioned myself over the plane. For some reason the pilot will not always start accelerating immediately causing the plane to roll and making it hard for him to pull up. I have uploaded v1.2 again with +800 in the strikePlane setPos line to give him enough time to react, hopefully  ;D ;D ;D
« Last Edit: 26 Nov 2002, 00:49:09 by Skumball »