Jump to content
Sign in to follow this  
quantenfrik

problem with remote fire

Recommended Posts

hi,

I'm currently working on an artillery script for the 155mm SPA, and this includes that they should fire when i give the command.

But I can't get it to work the way I want: I can't use forceWeaponFire, nothing happens if I use this command, which is also descriped in the wiki article at the bottom: "Currently this command is not available for land vehicle remote fire". I don't know why this is the case but I guess there's a reason for it.

I also tried fire, but whatever combination I try the projectile goes straight up in an angle of around 60-70 degrees, ignoring the direction of the barrel. If I switch to third person and view around the scorcher, the barrel will go straight up after it fired the round. If I don't view around, the barrel will stay in position but the shell will still fly at an high angle.

I also can't use doArtilleryFire because I want to set the charge and angle manually, and doArtilleryFire doesn't allow that.

Another thing I tried but have absolutely zero experience with was to use a gamelogic (see code), but it didn't work either.

Also what buggers me is that when I use fire with a different firemode (e.g. Single2) than the one which is currently selected (e.g. Single1), it will wait until I changed to the corresponding fire mode and not change it on its own.

this is the code I currently use, of course I can't post all the different versions I tried. 45 and 46 are x and c.

MY_KEYDOWN_FNC = {
   switch (_this) do {
	case 45: {
			vehicle gunner player fire [(currentWeapon vehicle player), "Single1"];

       };
	case 46: {

		hint format ['%1\n%2', currentWeaponMode player, currentWeapon vehicle player];
		MyGameLogic action ["useWeapon",(currentWeapon vehicle player),vehicle gunner player,0];
		};

   };

};  
waituntil {!isnull (finddisplay 46)};
(findDisplay 46) displayAddEventHandler ["KeyDown","_this select 1 call MY_KEYDOWN_FNC;false;"]; 

Anybody got an idea that could help me?

Share this post


Link to post
Share on other sites

What exactly are you trying to achieve?

Get in the gunner seat, adjust elevation and azimuth, then hop out and remotely fire the gun?

Share this post


Link to post
Share on other sites

Thank you for your answer! What I hove to achieve in the end is that my script outputs an angle and direction to which (likely) an AI will align its artillery gun to, and another button press would be the firing command. it's the latter part I struggle currently with, until now I've mainly worked on the UI but now I wanted to finally see some action. So at the moment I'm still sitting in the gunner seat when i trigger my script above, in the end though it'll be an AI. But if "fire" and "forcweaponfire" don't work for me, I doubt they'll later do for AI.

Share this post


Link to post
Share on other sites

Update: Fortunately, "fire" works without problems when an AI is in the turret, so I got that going for me, which is nice.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×