Jump to content
Sign in to follow this  
arthur666

switch to gunner in helicopter problem

Recommended Posts

So, obviously AI gunners are lacking. When piloting the Apache, I'ld like to at least be able to come to a hover, switch to gunner position and use the gun and its optics myself, like in Longbow2. But when I do this, the pilot dumps the collective and the chopper crashes. If I have waypoints set up for the mission, the pilot just starts moving towards the next waypoint. Any easy way to keep the chopper from doing either of these things? I tried - this disableAI "MOVE" - for the pilot when using no waypoints, but didn't help.

ALso, I was using teamswitch key "U", not the swap gunner which only works for tanks.

Share this post


Link to post
Share on other sites

...or is there a way to access the gunner's sight from the pilot seat?

Share this post


Link to post
Share on other sites

What about switching to manual fire on the action menu? That way the gunner is just there for the ride.

Share this post


Link to post
Share on other sites
What about switching to manual fire on the action menu? That way the gunner is just there for the ride.

Well, I'ld like to be able to aim the cannon using the optics with the thermal sights and all. Also, I don't think the AI gunner does a good job of attacking groups of soldiers. He tends to pick one target, aim, shoot, pick another, reaim, shoot etc. The AI is also very poor at ID-ing enemy soldiers. You have to get too close for him to open up.

Share this post


Link to post
Share on other sites

Oh yeah, I know what you mean. I tried a test mission awhile back where I was a gunner in a Cobra, and I could not get the pilot to stop overflying the targets. I just wanted him to sit there and let me have at it. I don't know of any good solution.

Share this post


Link to post
Share on other sites

The helicopter crashes upon switching because the engine stops during the short moment it doesn't have a pilot. A simple apache engineOn true will do the trick. I don't have an answer to how to make the new pilot keep the present altitude, though.

Share this post


Link to post
Share on other sites

Got a solution that may involve a bit of coding. Place an empty apache on the map. In its init put

this engineon true;

call it helo1 and set its special to flying. Put two soldiers on the map in one of their init's put

this moveindriver helo1;

and in the other

this moveingunner helo1;

(you can pick to play as either one). Add a radio trigger (radio alpha) that is triggered repeatedly and in its activation field add

selectNoPlayer; selectPlayer gunnername

add in the text field of the trigger "switch to gunner". Create another radio trigger that is triggered repeatedly (radio bravo) and in its activation field

selectNoPlayer; selectPlayer pilotname

and in the text field of the trigger write "switch back to pilot". If your planning on flying then switching to gunner and hovering while you shoot, then make yourself the pilot ( the guy with

this moveindriver helo1;

in his init). The AI will immediately stop flying once you switch to the gunner but will hover at at 50m all time, I don't know how to achieve a different altitude but I'm sure this could be achieved with a bit more scripting.

Hope this helps.

Share this post


Link to post
Share on other sites

thanks yall, I'll give it a try. Always 50m is not going to work well, but its a start.

Share this post


Link to post
Share on other sites

well i tried to help you, but it wasnt having it. i was trying to set some infinite loops while the player was the gunner to maintain an altitude, but arma crashes with every infinite loop i come up with. using "isPlayer pilot" in the condition of a trigger and telling it to execute repeatedly with 0 seconds in between, for some reason only executes once for every time the player enters the gunner seat, but doesnt continue to execute while the player is the gunner. thats why i tried the infinite loop

as for the code above, the engineOn command is a little redundant, because when you set a units "special" to flying, it automatically has it's engines on

Share this post


Link to post
Share on other sites
well i tried to help you, but it wasnt having it. i was trying to set some infinite loops while the player was the gunner to maintain an altitude, but arma crashes with every infinite loop i come up with. using "isPlayer pilot" in the condition of a trigger and telling it to execute repeatedly with 0 seconds in between, for some reason only executes once for every time the player enters the gunner seat, but doesnt continue to execute while the player is the gunner. thats why i tried the infinite loop

as for the code above, the engineOn command is a little redundant, because when you set a units "special" to flying, it automatically has it's engines on

Always have a waiting period when looping something.

#loop
hintSilent format ["%1",time]
~0.01
goto "loop"

Share this post


Link to post
Share on other sites

see theres so many things i dont know about this language. i didnt realize you could wait with ~0.01. that makes things easier for me knowing that for some other missions im doing now too. i also didnt know that this had goto statements. i dont particularly like gotos and can really never think of a reason to use them, so ill stick with my while and for loops, but its still good to know

Share this post


Link to post
Share on other sites
Always have a waiting period when looping something.

#loop
hintSilent format ["%1",time]
~0.01
goto "loop"

yea i just realized, that isn't even close to right. first off, im not seeing any semicolons and that signifies a commands end. second off the ~ is a bitwise operator. i dont know whats more sad, that i didnt realize it until now, or that i didnt realize it until i actually tried typing it in

if that is right in any universe, which im seriously doubting...then somebody clean up the syntax so i can use the wait without writing a script to use the sleep command

Share this post


Link to post
Share on other sites

Celery is just using the "deprecated" SQS syntax, which is still widely used :D

It's perfectly valid inside an SQS script.

Here is the SQF version:

while {true} do
{
hintSilent format ["%1",time];
sleep 0.01;
};

Share this post


Link to post
Share on other sites

yea but im looking for a way to do it without a script. the sleep command doesnt work without a script

Share this post


Link to post
Share on other sites

You mean inside the trigger? You could spawn the code inside a trigger, it creates a separate execution thread, something like this:

[]spawn{ some code; more code; sleep 0.01; other code; };

Share this post


Link to post
Share on other sites

A... In my mission, I have completed this or at least similar function. I use Selectplayer+SelectLeader code and use "addAction" to add option to the helicopter. I didn't find any problem such as crash. Maybe I didn't understand what you are discuss about?

Share this post


Link to post
Share on other sites
You mean inside the trigger? You could spawn the code inside a trigger, it creates a separate execution thread, something like this:

[]spawn{ some code; more code; sleep 0.01; other code; };

thats awesome! thats exactly what i was looking for.

ive been trying desperately to avoid learning how to write scripts lol...and so far ive been able to do everything i want to do without it except for sleeping. but this facilitates my stubbornness that much more lol.

from what i understand the commands are all still the same as doing it right in the editor, but i just dont like the idea of having to import stuff into missions to run it, so im being stubborn, and trying to do it without writing an actual script to run lol

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  

×