OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Kaliyuga on 15 Oct 2003, 23:13:49
-
Well... on the off chance that someone here can help with this little problem we're having I'll go ahead and post about it ...
I tried the CoC forums ::)..... but they're a joke ::) ::) ::)... and not a very good one either.. :-\ >:( >:( >:(
basically... the player can fire the torpedos just fine when in the sub ... but AI won't fire em no matter what ???
anyone have any ideas about what could cause this.... since evidently expecting any kind of support from CoC on this matter is hopeless ?
P.S. this is one of the only issues keeping this addon from release
-
well... correct me if i'm wrong but aren't the torpedos that you attach to vehicles fake ones that are replaced by the real torpedos witch are vehicles when fired? So what you could do is open up the scripts for them and see if you can pull out a fired eventhandler that makes all of that happen and then make your own torpedo weapon. It doesn't have to be a real torpedo, just a weapon that AI will fire on ships with and add the eventhalnder to your config so that when the AI or player fires the fake torpedo weapon, the real torpedo will apear. Should work if i'm right about how they work. Try it.
-
There's an EventHandler in the config.cpp file , and without it they don't fire at all.....
whether the player is the gunner or not.....
right now ... if the player is the gunner.. everything works fine....
if the player is the driver, selects Manual Fire and then fires.. works just fine....
now.. if you throw an AI into the gunners seat he just sits there..... enemy boats are called out.... but no firing ???
unfortunately the Open source vehicles provided by CoC are helicopters.. and there is little or no documentation provided for boats ...
-
ok what I mean is, make a weapon that does no dammage and is not visable (you could have a firging sound tho) and that AI will try to fire on ships with. Then, make a fired eventhandler in the config of the sub for that weapon:
_this addeventhandler ["Fired",{ [_this,TORPEDO] exec "\CoC_Torpedoes\init\switchSea.sqs"}]
where TORPEDO is the CoC torpedo... ex: CoC_Mk48
if you can get the AI to fire any weapon at ships, attach that eventhandler to it. You see, the weapon you made is really fake, even tho thats accualy whats being "fired", the eventhandler will stick a CoC torpedo in its place. Therefore, of the AI fires a fake weapon AT a ship, a torpedo will fire instead and hopefully hit the ship.
-
O.K. I did a little more experimenting with it... and once I added a Machine Gun to the submarine... the Gunner would lock on and fire with it.... but when switching to the Torpedo launcher weapon still no dice... :P
I think we will more than likely use your suggested method Kyle to fix this bug.... shame it doesn't work as advertised... but hey what does right? ;D
Thanks again for the suggestion and I'll keep you posted on what happens with it....
If we can get this bug squashed its very possible to see a submarine release within a few days of the torpedos working properly for AI ;)
:cheers:
-
So, did it work? (that is if you tried it yet) lol... just wanna see if it works, you see, just by doing the smallest thing you could contribute to an addon (I know what its like when I made my MP5K addon...);D
-
Is there any point in AI fireing torps on their own initiative?
I mean, it has a GREAT influence on the game, why not just script the unfortunate ship dead?
-
Erm..
Is there any point in AI fireing torps on their own initiative?
I mean, it has a GREAT influence on the game, why not just script the unfortunate ship dead?
What?? Are you serious?? Who wouldn't put torpedos on their submarine?.... Anyway it should work and hope to see the release of your sub soon Kaliyuga. :thumbsup:
-
I did get some input from Denior of the CoC and he seems to think that our problem can be fixed by an alteration to the weapons class of our config.cpp, so we'll try to go that route first...
If not.. I'm positive that your fix would work too Kyle.. ;D
rest assured we are going to spend alot of time this weekend on getting it all ready to go... (finally) :P
and yes Josef.. there is a point to AI being able to fire torpedoes on their own.......
wouldn't be much use if there had to be a human manning the gunners spot always :P
-
yea thats all it really is, if you can get an AI to fire anything in any way at a ship, you can get him to fire the torpedos.... So let me get this straight... Are they suggesting that you change something in your config that will make the AI target and fire at ships with the "fake" torpedo weapon... Well it doesn't matter I guess it would work but it never hurts to try to help ;)
-
Here's what he said:
My guess is that this can be resolved through the definitions in the cpp. The torpedoes should be no different than the machine gun. As a matter of fact, the torpedo launceher on a boat is a machine gun.
here's the submarine weapon:
class CfgWeapons
{
class Default {};
class MGun: Default{};
class MachineGun7_6: MGun{};
class MachineGun12_7: MachineGun7_6{};
class Browning: MachineGun12_7{};
class CoC_Mk48LauncherBoat:Browning{};
class CoC_ShkvalLauncherBoat:CoC_Mk48LauncherBoat{};
class CoC_ShkvalLauncherBoatSUB: CoC_ShkvalLauncherBoat
{
with this in the config.cpp as well for the vehicle
weapons[] = {CoC_ShkvalLauncherBoatSUB};
magazines[] = {CoC_ShkvalLauncherBoatSUB};
Here's what is in the CoC config.cpp for boat weapons:
class MGun: Default{};
class MachineGun7_6: MGun{};
class MachineGun12_7: MachineGun7_6{};
class Browning: MachineGun12_7{};
class CoC_Mk48LauncherBoat:Browning
{
with the Shkval torpedoes being listed lower in the cpp as:
class CoC_ShkvalLauncherBoat:CoC_Mk48LauncherBoat
now... if I simply change this:
weapons[] = {CoC_ShkvalLauncherBoatSUB};
magazines[] = {CoC_ShkvalLauncherBoatSUB};
to this:
weapons[] = {CoC_ShkvalLauncherBoatSUB, MachineGun12_7 };
magazines[]={CoC_ShkvalLauncherBoatSUB,MachineGun12_7};
the MG works but not the torpedoes.. are we overlooking something simple here? :-\
-
By doing that, all you did was add a machine gun as well as torpedos (Im pretty sure).... I still think my way would work better... lol... but if you can figure this out then go right ahead...
-
I was just illustrating the point that since the MG works just fine..
that the problem must lie somewhere in the weapon definition of the torpedo launcher... which I took from the CoC documentation...
So it's very unfortunate that it doesn't work if you use the way the person who made the addon tells you ...... :-\
We will probably use your method now that I've played around with the config a bunch with no luck.... :-\ as this is the very last thing holding up the submarine's release at this point.
-
Well if you use my method, let me know if/when it works :thumbsup: