Home   Help Search Login Register  

Author Topic: Torpedo Problems  (Read 1306 times)

0 Members and 1 Guest are viewing this topic.

Kaliyuga

  • Guest
Torpedo Problems
« 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
« Last Edit: 15 Oct 2003, 23:16:24 by Kaliyuga »

KyleSarnik

  • Guest
Re:Torpedo Problems
« Reply #1 on: 16 Oct 2003, 00:22:04 »
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.

Kaliyuga

  • Guest
Re:Torpedo Problems
« Reply #2 on: 16 Oct 2003, 00:43:01 »
 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 ...

 

KyleSarnik

  • Guest
Re:Torpedo Problems
« Reply #3 on: 16 Oct 2003, 01:30:11 »
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:
Code: [Select]
_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.
« Last Edit: 16 Oct 2003, 01:30:40 by KyleSarnik »

Kaliyuga

  • Guest
Re:Torpedo Problems
« Reply #4 on: 16 Oct 2003, 09:05:06 »
 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:

KyleSarnik

  • Guest
Re:Torpedo Problems
« Reply #5 on: 17 Oct 2003, 03:24:53 »
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

Josef

  • Guest
Re:Torpedo Problems
« Reply #6 on: 17 Oct 2003, 09:54:36 »
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?

KyleSarnik

  • Guest
Re:Torpedo Problems
« Reply #7 on: 17 Oct 2003, 20:48:42 »
Erm..

Quote
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:

Kaliyuga

  • Guest
Re:Torpedo Problems
« Reply #8 on: 17 Oct 2003, 20:55:20 »
  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

KyleSarnik

  • Guest
Re:Torpedo Problems
« Reply #9 on: 17 Oct 2003, 21:14:08 »
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  ;)

Kaliyuga

  • Guest
Re:Torpedo Problems
« Reply #10 on: 18 Oct 2003, 00:34:39 »
 Here's what he said:
 
Quote
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:

Code: [Select]
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

 
Code: [Select]
weapons[] = {CoC_ShkvalLauncherBoatSUB};
           magazines[] = {CoC_ShkvalLauncherBoatSUB};


 Here's what is in the CoC config.cpp for boat weapons:


Code: [Select]
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:

Code: [Select]
class CoC_ShkvalLauncherBoat:CoC_Mk48LauncherBoat

now... if I simply change this:

 
Code: [Select]
weapons[] = {CoC_ShkvalLauncherBoatSUB};
           magazines[] = {CoC_ShkvalLauncherBoatSUB};

to this:

 
Code: [Select]
weapons[] = {CoC_ShkvalLauncherBoatSUB, MachineGun12_7 };
 magazines[]={CoC_ShkvalLauncherBoatSUB,MachineGun12_7};

the MG works but not the torpedoes.. are we overlooking something simple here?  :-\

KyleSarnik

  • Guest
Re:Torpedo Problems
« Reply #11 on: 18 Oct 2003, 03:34:36 »
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...

Kaliyuga

  • Guest
Re:Torpedo Problems
« Reply #12 on: 19 Oct 2003, 18:25:55 »
  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.

« Last Edit: 19 Oct 2003, 21:44:12 by Kaliyuga »

KyleSarnik

  • Guest
Re:Torpedo Problems
« Reply #13 on: 20 Oct 2003, 03:24:14 »
Well if you use my method, let me know if/when it works  :thumbsup: