Home   Help Search Login Register  

Author Topic: erm.. can anybody help? AI airplane landing  (Read 2267 times)

0 Members and 2 Guests are viewing this topic.

OFPpilot

  • Guest
erm.. can anybody help? AI airplane landing
« on: 10 Mar 2003, 19:53:11 »
Sure, it sounds like simple, but when i tried it i ran into number of problems.. with most annoying part being the AI pilot not able to lower the landing gear. I got the plane to just "touch" the ground with the airplane's tail at relatively low speed (120 km/h) but then without the landing gear extended, the AI pilot just pulled the airplane right back up again.
What i tried so far is:
             shuttle action ["lower gear"]; shuttle is the name of the plane.
So, can anyone give me some hints? BTW, i used the same action command to lower the flaps and it worked fine.

Iwesshome

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #1 on: 10 Mar 2003, 21:13:19 »
did you try....

shuttle action ["lower landing gear"]

Iwesshome

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #2 on: 10 Mar 2003, 21:24:17 »
Ok,

I am looking at the unofficial command reference guide and this is what I see

STR_ACTION_LAND Landing autopilot
STR_ACTION_CANCEL_LAND Landing autopilot off

I wonder if you could write a quick... hummmm
 
Waypoint 1 - Move (over runway)
activation field: shuttle action land

Trigger 1 - Activated by West (or east)
set this trigger right where he lands and in the activation field: shuttle action cancel land

Waypoint 2 - Move

Wonder if that would work??? Shame I am not home right now to try it.

Probably would need to be tweaked with practice.
« Last Edit: 10 Mar 2003, 21:47:11 by Iwesshome »

OFPpilot

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #3 on: 10 Mar 2003, 22:03:02 »
I've tried both of those.. and Iwesshome the action when i get into the shuttle to lower the landing gear is called "Gear down" so i used that. landing autopilot wouldnt work because the landautopilot thing is messed up and it makes the plane go around in circles... Thx anyway :)

Iwesshome

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #4 on: 10 Mar 2003, 22:40:14 »
I found this on the BIS Official forums....

Quote
plane action ["LAND GEAR"];

Toggles down/up
You would have to add a little boolean gear monitor to it or something, with eventHandlers would be best.  That is to make sure you never do the opposite action
Then I saw this... maybe it is a start  ???

Quote
Somehow the plane action ["LAND GEAR"]; only raises the gear when it's allready down but I can't get it to make the gear go down.

Any ideas?

OFPpilot

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #5 on: 10 Mar 2003, 22:44:23 »
hm.. what is a boolean gear monitor? have any idea by any chance man? ???
i'm just trying to make this mission that involves space shuttle getting ambushed by terrorists during landing and the USAF has to defend the shuttle.. hopefully i can figure this out soon

Iwesshome

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #6 on: 10 Mar 2003, 23:40:24 »
Ok... I searched through 300 posts on the official BIS forum and anything with vehicles people say this,

plane action ["LAND GEAR"]

So if we can find what the gear name really is you will be in business. I am going to play around with it when I get home...

OFPpilot

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #7 on: 11 Mar 2003, 00:08:00 »
okies, thx very much Iwess, I appreciate it man. I've tried to use that "LAND GEAR":
               shuttle action ["LAND GEAR"]
didn't work but i guess i'll try something else :)

Iwesshome

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #8 on: 11 Mar 2003, 00:13:02 »
Have you tried these codes on the official BIS add-ons like the A-10? I am heading home now so I will hop on later to see how things went and let you know if I was successful.

OFPpilot

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #9 on: 11 Mar 2003, 00:53:19 »
yea.. it works on the A10 but i wanna see if i can do the same thing to the other unofficial airplanes.. well ok then good luck man

OK now I just found out that the "LAND GEAR" command works when I am the pilot of the shuttle. However, it doesn't work when the AI pilot is controlling the shuttle. What's wrong with this thing?
« Last Edit: 11 Mar 2003, 01:04:52 by OFPpilot »

Iwesshome

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #10 on: 11 Mar 2003, 13:48:52 »
Now I am dumb founded,

I tried it with the A-10 and it worked fine... tried it on the shuttle and it didn't work. I couldn't even get the shuttle to land on Autopilot for it kept flying where it wanted to and not where I needed it.

I am going to try to download some add-ons like the F-16 or F-4 to see if they work because I noticed on the C-130 it has the same issues like the shuttle. Wonder if it a size issue or just third party add-on... say some posts on the BIS official forum with people designing planes and it talked about how to animate the wheels.

If I can find that page again I will link it so you can see the code.... maybe it can be turned into a script?

OFPpilot

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #11 on: 11 Mar 2003, 17:44:40 »
haha i know man flaps work fine and the freakin landing gear doesn't work. Also the engine doesn't shut off when i tell it to do so.
 Yup that's exactly what i'm seeing. C130, C17, the shuttle don't want to put their landing gear down. Oh, incase you missed what i said, even with the A-10, AI pilots wouldn't put the landing gear down and if YOU are the one flying the airplanes (ANY airplanes including unofficial ones) "LAND GEAR" code works. So is it like AI issue in the game engine?

Iwesshome

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #12 on: 11 Mar 2003, 18:28:33 »
I think it could be the game engine... I wonder if there is a way decode the official A-10 add-on and see if there is some type of script in the planes file that tell the computer what to do on handling a landing?

IW

Try this link -

http://www.flashpoint1985.com/cgi-bin/ikonboard301/ikonboard.cgi?s=3e6e1ebb593affff;act=ST;f=54;t=27010;hl=landing+gear

And this link -

http://www.ofpec.com/yabbse/index.php?board=13;action=display;threadid=5341;start=0
« Last Edit: 11 Mar 2003, 18:43:30 by IW »

OFPpilot

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #13 on: 11 Mar 2003, 18:57:28 »
ah.. I checked out those 2 links but i think i need to be able to decode the addons don't i? or can i just use whatever the command there was in those links as a script attached to the addon? This thing's putting a dump truck on my head!

Iwesshome

  • Guest
Re:erm.. can anybody help? AI airplane landing
« Reply #14 on: 11 Mar 2003, 19:06:21 »
What I am looking at is possibly turning that code into a script,

What I found and maybe could be played with...

Quote
#################################################
; # syntax: [OBJECT] exec "Gear.sqs";
; #
; # OBJECT:
; # Aircraft object
; #
; #################################################


; **************** VARIABLES ******************

_Helo1 = _this select 0
_player = player


; ********* THE MAIN LOOP ***************
#CheckPosLoop

;********** check pilot status
?(not alive _helo): goto "exit"

; get position of helicopter. _z = altitude direction
_pos = GetPos _helo1;
_x = _pos select 0;
_y = _pos select 1;
_z = _pos select 2;

goto "CheckSpeed"
goto "CheckPosition"


goto "CheckPosLoop"
; ************** END OF MAIN LOOP ***************



;************* AI AUTO RAISE/LOWER GEAR ROUTINE ********************
; this could also be used to auto raise/lower canopies, ramps as/before
; aircraft moves etc
; When the Player is in an aircraft stall warnings/gear up warnings etc could sound

; NOTE: Only ai has auto gear up/down in this routine


;********** CHECK SPEED AND ALTITUDE OF AIRCRAFT FOR RAISE/LOWER GEAR - AI ONLY *****
#CheckSpeed

; Check whether player is on board, if he is then goto routine to Player Only Routine
?(_player in _helo1): goto "checkGearUp"


; speed _Helo1 > 35. 35 is speed reached before events happen
; _z = altitude. _z>50. When altitude of 50 is reached before events happen

? ( speed _Helo1 >= 10 and _z>= 50): goto "RaiseGear"
? ( speed _Helo1 <= 30 and _z<= 50): goto "LowerGear"

goto "CheckPosLoop"

; ****** Raise the gear
#RaiseGear
_helo1 animate ["maingear",1]

goto "CheckPosLoop"

; ******* Lower the gear
#LowerGear
_helo1 animate ["maingear",0]

goto "CheckPosLoop"



; ****************** PLAYER ONLY *****************
#checkGearUp
?(_helo1 animationPhase "maingear"==0): goto "CheckPosLoop"

?(_player in _helo1 and _z<= 30 ): goto "PlayGearUpSound"

goto "CheckPosLoop"

;*************** GEAR UP SOUND
;defined Class Sounds in config.cpp

#PlayGearUpSound
;first check if the player is on board (not checked if pilot, copilot or cargo. But if not flying the chopper the warning will still sound if the chopper is flying too low
?(_player in _helo1 and _z<= 30 ): goto "GearSound"
goto "CheckPosLoop"


;*************** PLAY SOUND
; As defined in Class Sounds in config.cpp
#GearSound
playSound "GearUp"
goto "CheckPosLoop"


#exit
exit
« Last Edit: 11 Mar 2003, 19:07:23 by IW »