Quantcast

Jump to content

» «
Photo

Moody helicopter landing

7 replies to this topic
kristjannuus
  • kristjannuus

    Just call me Kris, it's easier

  • Members
  • Joined: 12 Apr 2009

#1

Posted 03 February 2014 - 09:10 PM

I'm in a bit of a pickle here. 

I managed to get my script right with this 

http://pastebin.com/UpifWDfD Helicopter lands and everything is dandy.

 

However when adding bits to make the game prettier (weathers and further lines), I end up with helicopter just idle-flying above the place it is supposed to land (also the camera changes mid-air don't happen with this script too) 

http://pastebin.com/fR1J0L5r

 

I've been going crazy with this. Could anybody see what's the problem here?

Thank you.


ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#2

Posted 05 February 2014 - 08:02 PM

that's funny, the weather caused your problem
change set_weather 8 to set_weather 0 and it works, i assume because of different wind factor
 
But you need to fix the mission script, so don't change weather and listen
This code should check if heli is at location to change camera

01AD:   car 1@ sphere 0 near_point -2122.087 2165.33 radius 96.6647 1.0 <--- last parameter is  check radius height

radius 96.6647 1.0 <--- last parameter is check radius height

the code checks if car is in a sphere with center at -2122.087 2165.33
the X-Y dimension of this sphere have a radius of 96.6647

the z dimension(height) have a radius of 1.0

that' means, this sphere is like a flat disc and your heli don't reach this flat sphere

 

increase the last parameter to 10.0

same for the next check

01AD:   car 1@ sphere 0 near_point -1840.823 2133.319 radius 92.8525 1.0

you need to play around to find propper size of the check sphere

if it's to big, the camera changes to early. if it's to small, the camera never change


kristjannuus
  • kristjannuus

    Just call me Kris, it's easier

  • Members
  • Joined: 12 Apr 2009

#3

Posted 06 February 2014 - 03:32 PM

:INTRO_42
wait 0 
if 
   Model.Available(#POLMAV)
   Model.Available(#HUNK)
else_jump @INTRO_42 
1@ = Car.Create(#POLMAV, -2193.403, 2175.967, 162.666)
0825: set_helicopter 1@ instant_rotor_start 
0129: 2@ = create_actor_pedtype 23 model #HUNK in_car 1@ driverseat 
067B: put_camera_on_car 1@ with_offset -5.5 2.5 5.5 point_to_actor 2@ tilt 6.0 2 
072B: put_actor $PLAYER_ACTOR into_car 1@ passengerseat 0 
04A2: set_heli 1@ fly_to 223.6383 1913.288 17.1956 altitude_between 40.0 and 80.0 

:INTRO_178
wait 0 
if 
01AD:   car 1@ sphere 0 near_point -2122.087 2165.33 radius 20.0 20.0 
else_jump @INTRO_178 
067B: put_camera_on_car 1@ with_offset 6.0 7.5 3.5 point_to_actor 2@ tilt 6.0 2 
wait 250 

:INTRO_255
wait 0 
if 
01AD:   car 1@ sphere 0 near_point -1840.823 2133.319 radius 20.0 20.0 
else_jump @INTRO_255 
067B: put_camera_on_car 1@ with_offset 15.0 -7.0 5.5 point_to_actor 2@ tilt 6.0 2 
wait 250 

:INTRO_332
wait 0 
if 
01AD:   car 1@ sphere 1 near_point 227.9872 1915.341 radius 79.1876 150.0 
else_jump @INTRO_332 
Car.SetSpeedInstantly(1@, 5.0)
04A2: set_heli 1@ fly_to 223.6383 1913.288 17.1956 altitude_between 0.0 and 5.0 
0826: enable_hud 1 
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer
Player.CanMove($PLAYER_CHAR) = True
$MARKER_MISSION = Marker.CreateIconAndSphere(47, 263.8979, 1882.195, -30.3906)

:INTRO_451
wait 0 
if 
00ED:   actor $PLAYER_ACTOR 0 near_point 263.8979 1882.195 radius -30.3906 4.0 on_foot 
else_jump @INTRO_451 
mission_cleanup 
$ONMISSION = 0 
return 
end_thread 

I did this now. The camera changes are there, but the heli still refuses to land. It sorts of does a sudden stop in the air, turns 180 degrees and just keeps floating. 


ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#4

Posted 06 February 2014 - 05:49 PM Edited by ZAZ, 06 February 2014 - 05:52 PM.

the code loops endless in the second check because the heli don't fly throw this sphere
:INTRO_255
wait 0 
if 
01AD:   car 1@ sphere 0 near_point -1840.823 2133.319 radius 20.0 20.0 
else_jump @INTRO_255
make radius bigger
btw., i was wrong yesterday, last parameter isn't z dimensions but the meaning is: radius X-dimension Y-dimension, height doesn't play a role in that code
anyway, 1.0 was too small
and now 20.0 is too small
 
My tip:
deactivate the cam codes with commentsslash
//067B: put_camera_on_car 1@ with_offset 6.0 7.5 3.5 point_to_actor 2@ tilt 6.0 2
 
activate the red sphere (change sphere 0 to sphere 1) for all 01AD: codes
then you can better see what happens
if it works fine, then remove commentsslash and deactvate the spheres
 
Also, use opcode 07BB: instead Car.SetSpeedInstantly for speed
// heli fly slowly
07BB: set_heli 1@ horizontal_thrust_power 1
// heli fly fast
07BB: set_heli 1@ horizontal_thrust_power 10

kristjannuus
  • kristjannuus

    Just call me Kris, it's easier

  • Members
  • Joined: 12 Apr 2009

#5

Posted 07 February 2014 - 08:49 AM

Ah, I think I have it figured out. I added temporary "checks" when going through the spheres via displaying a textbox. It seems to be fine. However, the game is really prone to freezing at pause menu and on the main menu, any idea if that might be code related or GTA is simply dicking out?


ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#6

Posted 07 February 2014 - 05:20 PM

displaying text to see if a check has been passed is a good idea
there wasn't any problem when switching to pause menue
the game just crash when mission ends because return is wrong


kristjannuus
  • kristjannuus

    Just call me Kris, it's easier

  • Members
  • Joined: 12 Apr 2009

#7

Posted 07 February 2014 - 05:33 PM

One final thing, the heli doesn't want to slow down with either Car.SetSpeedInstantly or horizontal force opcodes. I've placed the spheres long before the landing area but the heli still overshoots the landing spot and goes berserk and then lands in the wrong place. 


ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#8

Posted 07 February 2014 - 09:11 PM

Change the destination to let the heli turn earlier

add a timecheck of 5 seconds to give the heli the chance to turn back before the code runs into next check if car 1@ sphere 0 near_point to execute the next command

use

0780: heli 1@ hover_above actor 3@ car -1 altitude 0.0 3.0

to land the heli, 

this needs to create a car or an actor at the final destination





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users