Home   Help Search Login Register  

Author Topic: Empty Weapons, Force Firing, Creating Objects and Camera  (Read 730 times)

0 Members and 1 Guest are viewing this topic.

shadow99

  • Guest
Hello. I've compiled a group of 4 questions that have been biting me for a while now:

1) How do I place an empty weapon on the ground? I need to place a single empty LAW Launcher in front of some ammo crates.

2) In cutscenes, I would really, really like to know how to get an object to shoot at another object. This means, selecting WHAT object, selecting WHAT weapon to fire, and at WHAT target. I tried the 'action' command with 'fire' and I've had no luck. I've also had the correct weapon names as well, but nothing happens. Even if it did, the firing of the unit wouldn't be accurate at all.

3) Creating objects. One question: how? How do I create an object in the mission editor and then have it pop up when I want it to?

4) When camera scripting, how do I get a camera to stick along side of something as that something moves? I want the camera to keep 5 meters away from a choppers's port side and remain at the same velocity as the chopper itself, instead of just watching the chopper fly past?

An example of this would be in the 'FlashPoint' mission, the second mission of the official campaign.

Thanks very much!
 

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #1 on: 02 Nov 2004, 10:30:40 »
1.   You need a weaponHolder.    It's kind of like an invisible ammo crate.     Hunt around for more info.   Here's a working example

weaponH1 = "weaponHolder" createVehicle getMarkerPos "WH"
weaponH1 addMagazineCargo ["kozliceball", 4]
weaponH1 addMagazineCargo ["kozliceshell", 4]
weaponH1 addWeaponCargo ["kozlice", 1]
weaponH1 setPos getMarkerPos "WH"
weaponH1 setDir 70


2.  Syntax not guaranteed.
 
loon1 doTarget victim1
loon1 doFire victim1


3.  Don't understand the question.   Would the command setPos help?


4.   Use Blanco's logiccam script from the Editors Depot.   There are other methods but this one I found best.   It looks a little complicated at first but in fact it's not, it's dead easy and does exactly what you want.    Just read the instructions.
« Last Edit: 02 Nov 2004, 10:30:55 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #2 on: 02 Nov 2004, 21:23:11 »
3) Do you mean having units or vehicles created? The commands CreateUnit eg:

Code: [Select]
"SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha]

 and the CreateVehicle, eg:

Code: [Select]
_tank = "M1Abrams" createVehicle getmarkerpos "tankFactory"

may help. Also useful is CamCreate to create munitions useful in bombard scripts, eg:

Code: [Select]
"LaserGuidedBomb" CamCreate [0,0,0]

Hope that answers your question  :).

shadow99

  • Guest
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #3 on: 03 Nov 2004, 04:43:28 »
Yeah, it all does. Thanks coldst33l and macguba. Part from that "LaserGuidedBomb" thing at the end, everything was new to me.
I read about creating objects in another thread macguba, so I don't know quite what I mean. I was just hoping someone would pick up on it.

As for targeting and firing in a cutscene, is there anything I could add to macguba's syntax which would decipher which weapon the loon1 would fire?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #4 on: 03 Nov 2004, 09:12:25 »
unit selectWeapon weapon

Operand types:
unit: Object
weapon: String
Type of returned value:
Nothing
Description:
Select given weapon. For weapon values see CfgWeapons.

Example:
soldierOne selectWeapon "LAWLauncher"
Plenty of reviewed ArmA missions for you to play

shadow99

  • Guest
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #5 on: 04 Nov 2004, 00:59:16 »
Oh, foolish me. I've used this before. I'm sorry, macguba.

There is another problem. 'dofire', as far as I know, does not work with vehicles. I'm not sure if 'dotarget' does either, but I can't confirm that. Any other suggestions to target and shoot an object via vehicle?
« Last Edit: 04 Nov 2004, 01:45:02 by shadow99 »

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #6 on: 04 Nov 2004, 17:38:01 »
I had a go and it worked for me. It appears that dotarget doesn't work for vehicles but dofire worked fine when getting a T80 to fire on a civilian car. The trick is to make sure there is a shell in the chamber when the command is issued. If the command is given while it is reloading then the vehicle will forget the command and do nothing.

bored_onion

  • Guest
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #7 on: 04 Nov 2004, 18:46:39 »
you could create a script that replayed the dofire command until the thing had fired and then deactivate it with an eventhandler

shadow99

  • Guest
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #8 on: 04 Nov 2004, 21:46:17 »
Well, my problem is getting a Shilka to fire upon a helicopter. I can understand why this might be a bit of a troubled situation, with all the complications doFire has with aerial targets.

But switching to ZsuCannon should be instant, but the blasted Shilka won't take down two helicopters. I'll post the segment of the script this occurs in, but my scripting ability is very basic, so don't feel the urge to poke a stick with the other stuff  :P:

_cam camsettarget heli1
_cam camsetrelpos [4,20,35]
_cam camcommit 0
~2
heli1 selectWeapon Zunilauncher38
~1
heli1 doTarget shilka2
heli1 doFire shilka2
~1
heli1 doTarget shilka2
heli1 doFire shilka2
~1
heli1 doTarget shilka2
heli1 doFire shilka2
~1
_cam camsettarget shilka2
_cam camsetrelpos [-13,10,8]
_cam camcommit 6
~8
shilka2 selectWeapon ZsuCannon
shilka2 doTarget heli1
shilka2 doFire heli1
~2
_cam camsettarget heli1
_cam camsetrelpos [5,0,20]
_cam camcommit 0
~2
~1
shilka2 doTarget heli2
shilka2 doFire heli2
_cam camsettarget heli2
_cam camsetrelpos [0,40,20]
_cam camcommit 5
~4

And just to let you know, the helicopter doesn't fire FFARs either. Not once.

shadow99

  • Guest
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #9 on: 06 Nov 2004, 05:13:58 »
bump?

Offline Blanco

  • Former Staff
  • ****
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #10 on: 06 Nov 2004, 05:19:42 »
Quote
heli1 selectWeapon Zunilauncher38
should be
heli1 selectWeapon "Zunilauncher38"

and

Quote
shilka2 selectWeapon ZsuCannon
should be
shilka2 selectWeapon "ZsuCannon"

also try to reveal the targets first.

Quote
heli1 reveal Shilka2
and use short delays between the reveal, dotarget and dofire command lines
« Last Edit: 06 Nov 2004, 05:23:34 by Blanco »
Search or search or search before you ask.

shadow99

  • Guest
Re:Empty Weapons, Force Firing, Creating Objects and Camera
« Reply #11 on: 06 Nov 2004, 06:19:29 »
Thanks heaps for the reply, Blanco. I'll try out that script again now.