Home   Help Search Login Register  

Author Topic: Kick that bag out  (Read 2314 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Kick that bag out
« on: 25 Jan 2006, 02:09:26 »
Hello,

im making a mission where the player with his Russian Federation Naval Spetznatz must start with scilenced weapons to be secret but there not as powerful as unscilened and the players squad also has no heavy weapons. Well that works well and good with a few gaurds, but when enemy reinforcements come with armor, the player + squad need somthing with a little more punch. So I have the perfect time. A helecopter comes in and fastropes(from 15 meters) another squad to assist the player. I also thought, "What a perfect time to drop in some heavy weapons" So I need a way for a talented scripter here at ofpec, to make it look like sombody in the helocopter, kicks a bag or somthing___ containing lots of weapons and ammo__out the door of the helo. Then it just lands there and the player can reequip his squad.

So does it sound possible. I know theres no bag for ofp but if an addon is needed thats fine. But just make sure I can add weapons and ammo to it. And if the scripter just wants to use an ammo crate for now thats fine I can add a bag in later.

Thank you in advance


Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Kick that bag out
« Reply #1 on: 25 Jan 2006, 23:28:01 »
That's relativly easy if you're just using an ammo crate. You can basically drop the ammo crate out of the helicopter by spawning it, or from a higher pos, parachuting it. Let me go search my HD. I have a script I created for something like that...

Ah, here it is...

Code: [Select]
;Written by Tyger
;Operation Flashpoint: Resistance v1.96 script
;Use at your own risk. This file was only intended for the mission it was in.
;This file is open source. All I ask is you give credit where it is due.

;ratelo_ammo.sqs

;Define position and shift
_pos = _this select 0
_shift = _this select 1

;Check if shift was used
? !(_shift) : Hint "You did not use shift when clicking. Ammo resupply canceled."; exit

? called_ammo > 2 : Hint "You have no remaining Ammo drops to use."; exit
called_ammo = called_ammo + 1
~30

;Create Parachute/Ammo Box/Game Logic

_ammobox = "ReammoBoxWest" createVehicle [0,0,0]
_parachute = "Parachute" camCreate [(_pos select 0) + 2,(_pos select 1) + 10, 0]
_parachute setdir random 360
_logic = "Logic" camCreate [0,0,0]
_logic moveInDriver _parachute

;Ammo Crates Follow Parachutes
#ParaLoop
_parachute setVelocity [(velocity _parachute select 0) / 1.1, (velocity _parachute select 1) / 1.1, -6]
_ammobox setPos [getPos _logic select 0, getPos _logic select 1, (getPos _logic select 2) + 1]
_ammobox setdir getdir _logic
~0.01
? vehicle _logic != _logic : goto "ParaLoop"

_ammobox setPos [getPos _ammobox select 0, getPos _ammobox select 1, 0]
deleteVehicle _logic
[_ammobox] exec "Dialogs\AmmoFill.sqs"
_smoke = "SmokeShellGreen" camCreate [getpos _ammobox select 0, getpos _ammobox select 1, 1]

exit

That's for a parachuting ammo crate. Let me work with it really quickly, and I'll make one where it looks like it was kicked out the door.
« Last Edit: 25 Jan 2006, 23:30:01 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Kick that bag out
« Reply #2 on: 25 Jan 2006, 23:33:55 »
Hmm. If you spawn an ammo crate in the air, won't it just fall down to the ground?  :P If so, all you need is a script that spawns the ammo crate, and maybe adds some dust for effect. So if you're paradropping, use the one above.

Edit:
Try the script below. you call it using
[pos] exec "ammodrop.sqs"

Let me know if the script works with grass poofing up. I'm not sure if I made it quite right, since i've no time to test. :P
« Last Edit: 25 Jan 2006, 23:50:52 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Kick that bag out
« Reply #3 on: 26 Jan 2006, 00:55:40 »
hey, thanks for the reply.

I tried the second one
it just floats in the air, it never comes down, enen when I shoot it.

what to do?
« Last Edit: 26 Jan 2006, 01:04:19 by penguinman »

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Kick that bag out
« Reply #4 on: 26 Jan 2006, 05:39:02 »
Okay, sorry.

I guess the ammo crates dont fall. I'll modify the script. Just a sec...

EDIT:
Try that.
« Last Edit: 26 Jan 2006, 05:52:21 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Kick that bag out
« Reply #5 on: 26 Jan 2006, 06:09:26 »
OK, thanks it works, the grass effect looks pretty good.

now how do I fill it with ammo

Offline XCess

  • Former Staff
  • ****
Re:Kick that bag out
« Reply #6 on: 26 Jan 2006, 10:32:21 »
crate addWeaponCargo ["weapon",X]
crate addMagazineCargo ["ammo".X]

change weapon for weapon class name
change ammo for ammo class name
change x for number
change crate for crate name (defined before the camCreate)

crateName = "ammobox" camCreate (getPos helo)

not sure on classname or positioning, that parts already been done, just showing you where the name is defined.

« Last Edit: 26 Jan 2006, 10:35:30 by XCess »

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Kick that bag out
« Reply #7 on: 26 Jan 2006, 23:46:56 »
Oh, forgot about that.  :P Just another sec...

Okay, open up the attached script, and scroll all the way to the bottom. You should find this code commented out:

Code: [Select]
; Remove the semicolons and copy the below code to add gear to the ammocrate
;_ammobox addMagazineCargo ["MagazineName",#ofmags]
;_ammobox addWeaponCargo ["WeaponName",#ofwpns]
;End of ammo section

Remove the semi colons, and replace the MagazineName/WeaponName as well as #ofmags/#ofwpns with the relavent class names. You probably know how that works. To add more weapons and ammo, you just copy and paste ;)
« Last Edit: 26 Jan 2006, 23:53:03 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Kick that bag out
« Reply #8 on: 27 Jan 2006, 01:24:57 »
And a slightly updated version. As you can tell by this thread I've been having trouble creating multiple crates with names, but in this version, you can add ammo and weapons to the crate outside of the script.

Use the addWeaponCargo/addMagazineCargo commands on TYGAMMOBOX. i.e. TYGAMMOBOX addWeaponCargo ["M16",1].

It is still initalized like this:

;To execute this script, use [position] exec "ammodrop4.sqs"
;position is the position you want the crate to be spawned at. For instance, ;if you wanted the
;crate to spawn 3 meters to the right of the helicopter, use:
;[[(getPos myChopper select 0) + 3 * sin (getDir myChopper),(getPos ;myChopper select 1) + 3 * cos (getDir myChopper),(getPos myChopper select 2)]] exec "ammodrop4.sqs"
;To add ammunition and weapons to the ammocrate, just add weapons and ammo to TYGAMMOBOX.
« Last Edit: 27 Jan 2006, 01:25:27 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re: Kick that bag out
« Reply #9 on: 03 Jul 2006, 10:00:58 »
ok i will try that thanks

Offline Seven

  • Members
  • *
  • Am I a llama?
Re: Kick that bag out
« Reply #10 on: 24 Jul 2006, 12:42:33 »
I know this is an old one, but could someone post the full script again for this?

Thx in advance!  :)

Offline Cheetah

  • Former Staff
  • ****
Re: Kick that bag out
« Reply #11 on: 24 Jul 2006, 15:07:39 »
It's in the second post I think. So I don't know what you need on top of that one?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Seven

  • Members
  • *
  • Am I a llama?
Re:Kick that bag out
« Reply #12 on: 24 Jul 2006, 15:49:27 »
It's just that I can't find this part in the second post ;)
But I'll sort it out with this!
Thx :)

Oh, forgot about that.  :P Just another sec...

Okay, open up the attached script, and scroll all the way to the bottom. You should find this code commented out:

Code: [Select]
; Remove the semicolons and copy the below code to add gear to the ammocrate
;_ammobox addMagazineCargo ["MagazineName",#ofmags]
;_ammobox addWeaponCargo ["WeaponName",#ofwpns]
;End of ammo section

Remove the semi colons, and replace the MagazineName/WeaponName as well as #ofmags/#ofwpns with the relavent class names. You probably know how that works. To add more weapons and ammo, you just copy and paste ;)

*edit: I made this which works good enough ;d

edit2: Hm ok that didn't really work that good. In the above script would _pos be the chopper from where the crates are dropped? And also what's the _shift for when dropping from a chopper? What I want is a chopper to come drop 4 crates once AA has been taken out... Cheers :)
« Last Edit: 25 Jul 2006, 08:28:51 by Seven »