OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: NightJay0044 on 20 Sep 2005, 23:51:34
-
Here my descrption. This is what I have inserted on the intro island.
-M1A1 Tank
-Mi-24 Hind
-Player (ME)
I've given the Mi-24 a name: H1
MY ISSUE:
I want the M1A1 tank to fire at the hind. Here are the commands that I've already tried using with help from TriggerHappy.
this dowatch h1;this dotarget h1;this fire ["gun120","gun120"]
I've put that in the Init Field: of the M1A1 tank. The Tank Targets the hind and follows it with it's turret, but it doesn't open fire.
HELP:
Is there anything I'm doing wrong, or something new needs to be added? Thank you all.
-
Here my descrption. This is what I have inserted on the intro island.
-M1A1 Tank
-Mi-24 Hind
-Player (ME)
I've given the Mi-24 a name: H1
MY ISSUE:
I want the M1A1 tank to fire at the hind. Here are the commands that I've already tried using with help from TriggerHappy.
this dowatch h1;this dotarget h1;this fire ["gun120","gun120"]
I've put that in the Init Field: of the M1A1 tank. The Tank Targets the hind and follows it with it's turret, but it doesn't open fire.
HELP:
Is there anything I'm doing wrong, or something new needs to be added? Thank you all.
The fire command is what you are doing wrong. When using the fire command:
-A unit will ONLY fire if it is ABLE to (waiting for weapon to load, etc..)
-If the unit is ready to fire, it will INSTANTLY fire, not giving it time to target
-If the unit is not able to fire (now this one is odd) it sometimes will cause a unit (it depends on the type of weapon) to fire as soon as it is ready to fire
There is no way to know of the M1 is targeting the hind, and no way to tell if its aiming at it, so that means you can't know when to execute the fire command. My advice is to use an addon that has air targeting shells.
-
Hey Kyle Sarnik~
There is no way to know of the M1 is targeting the hind, and no way to tell if its aiming at it, so that means you can't know when to execute the fire command. My advice is to use an addon that has air targeting shells.
yes what about the Inv.Target or that addon that's out , I have that?
-
Well, that could work if you used a script to setpos the target over the hind in a loop, however then you might end up with units firing guided anti-tank weapons at the helicopter, and actually locking on to it :o
-
Wait, NightJay, you said in your first post that the M1 was moving it's turret to look at the Mi-24, right? This means, to me at least, that the tank is watching the chopper. The invisible addon should not be needed. All you need to do is issue the fire command at the right time, which means waiting until the shell is loaded.
-Student Pilot
-
Or get an invisible target addon and use the Threat: Armor target by setPosing it to the chopper's position.
Edit: Wow. Clicked too late. :P
-
Student Pilot~
Wait, NightJay, you said in your first post that the M1 was moving it's turret to look at the Mi-24, right? This means, to me at least, that the tank is watching the chopper. The invisible addon should not be needed. All you need to do is issue the fire command at the right time, which means waiting until the shell is loaded.
How do I properly execute those commands then?
Tyger ~
Or get an invisible target addon and use the Threat: Armor target by setPosing it to the chopper's position.
Yes Im sure the inv.addon would work but it there is an easier way I'm all for it.. ;D
-
He shouldn't need an invisible target, the tank already targets the chopper. His problem is in this code:
this dowatch h1;this dotarget h1;this fire ["gun120","gun120"]He's giving the fire command right away, the tank doesn't have a shell ready at that time. Wait ~30 seconds before giving the fire command.
-Student Pilot
EDIT:
Everyones...posting...too...fast...can't...keep...up :P
Maybe try putting the command in a trigger and setting the trigger to countdown from 30 seconds?
-
Well, ignore my post. Someone already mentioned it, and apparently I click way too slow :P
-
He shouldn't need an invisible target, the tank already targets the chopper. His problem is in this code:
this dowatch h1;this dotarget h1;this fire ["gun120","gun120"]He's giving the fire command right away, the tank doesn't have a shell ready at that time. Wait ~30 seconds before giving the fire command.
-Student Pilot
EDIT:
Everyones...posting...too...fast...can't...keep...up :P
Maybe try putting the command in a trigger and setting the trigger to countdown from 30 seconds?
But like I said, this is not a sound method. Because you can't detect (in a script) if the tank has a firing solution, you can't be sure that when you issue the fire command that the tank is aiming at its target. And dotarget is NOT allways reliable, it can often not work depending on the units awareness of the target and also a few other factors, and sometimes the unit won't properly update its firing solution in time, meaning it will target where the hind started, but sometimes won't track it properly.
-
True, but he's using a dowatch and a dotarget with each other. I would think with that redundancy the tank would always be looking at the chopper, or at least most of the time.
-Student Pilot
-
True, but he's using a dowatch and a dotarget with each other. I would think with that redundancy the tank would always be looking at the chopper, or at least most of the time.
-Student Pilot
Dowatch won't ensure anything, dowatch tells a unit to moniter something, not target it. Dowatch on a tank only makes the commander's turret follow the object or, even worse, the driver will point the tank in that direction.
-
Thanks for all your replies. Anybody who wants to take a look at the details in-game OFP, download is below..
-
Hoorah, it works with the inv.target addon. Now for my helicopter mission, it opens fire right away at the chopper. Cool thanks guys..