IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules Attention:

This is for the discussion and releasing of tutorials for modifying GTA. Anything that isn't a tutorial will be deleted without notification.

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (31) 1 [2] 3 4 ... Last »  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [GTA SA] ~ CLEO Script Tutorial ~

 
DarthGrijo  
Posted: Friday, Jul 3 2009, 08:12
Quote Post


V.I.P MEMBER! yeah, i wish
Group Icon
Group: Members
Joined: May 1, 2008

XXXXX



Hey,

How would u make a cleo mod that displays the vehicle( your currently in)'s health?

like if i were in a slamvan it would display the slamvan's current health? suicidal.gif

Thanx biggrin.gif
PM
  Top
 

 
ZAZ  
Posted: Friday, Jul 3 2009, 09:28
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (DarthGrijo @ Jul 3 2009, 08:12)
Hey,

How would u make a cleo mod that displays the vehicle( your currently in)'s health?

like if i were in a slamvan it would display the slamvan's current health?  suicidal.gif

Thanx  biggrin.gif

Please post here questions which belongs to the tutorial.
Generell questions of mission coding will be answerd in the mission coding forum
use opcode search tool to find opcodes for your plan
you need to get the instance of the player car, then read the health of the car and use any text opcode which allows to display a value.
Users WebsitePM
  Top
 

 
DvD463  
Posted: Friday, Jul 3 2009, 10:11
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Dec 2, 2008

XXXXX



Ok, Thanks wink.gif
PM
  Top
 

 
DaBeast.  
Posted: Friday, Jul 3 2009, 12:19
Quote Post


I can has polygon?
Group Icon
Group: Members
Joined: Jan 12, 2009

be.gif

XXXXX



Awesomely detailed tutorial ZAZ, truly awesome. I also like the flowchart. Keep it up man! icon14.gif
Users WebsitePMMSN
  Top
 

 
bull.04  
Posted: Friday, Aug 14 2009, 06:43
Quote Post


:D
Group Icon
Group: Members
Joined: Apr 11, 2008

us.gif

Member Award




I know it's kind of A bump, but I need to load from SPC_GA the bank_087 sound_023 how would I load that from a script?
Users WebsitePMMSNPlayStation Network
  Top
 

 
ZAZ  
Posted: Sunday, Aug 16 2009, 09:35
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (bull.04 @ Aug 14 2009, 06:43)
I know it's kind of A bump, but I need to load from SPC_GA the bank_087 sound_023 how would I load that from a script?

Sorry, I don't know. I think there is no way to execute this sound by script.
Maybe it's possible with 09D5: but it needs to do a lot of trail and error to find out which sound number plays which sound.
The sound numbers for script use have no association to the file names.
opcode 09D5 plays voice sounds which are also mostly used from exe for random peds on street
like pain sounds, breathing, coughing ect...
presumable uses PAIN_A SFX, SPC_FA SFX, SPC_PA SFX Archive Directory
Users WebsitePM
  Top
 

 
bull.04  
Posted: Sunday, Aug 16 2009, 15:55
Quote Post


:D
Group Icon
Group: Members
Joined: Apr 11, 2008

us.gif

Member Award




Hmmm, I was trying to get the sound from SPC_GA.
Users WebsitePMMSNPlayStation Network
  Top
 

 
markbaker  
Posted: Wednesday, Aug 26 2009, 12:36
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 26, 2009

XXXXX



Great Tutorial!

I have a couple simple questions - how can I spawn a vehicle & have it drive forward on it's own, either in a straight line or along a specified path? Also, is it possible to spawn a vehicle that has peds driving/riding in it?
PM
  Top
 

 
ZAZ  
Posted: Friday, Aug 28 2009, 18:30
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award





Car Drive Tutorial

QUOTE (markbaker @ Aug 26 2009, 12:36)
Great Tutorial!

I have a couple simple questions -  how can I spawn a vehicle & have it drive forward on it's own, either in a straight line or along a specified path?  Also, is it possible to spawn a vehicle that has peds driving/riding in it?

Ok, lets start with the base: "how can I spawn a vehicle" and use the exemple script of
tutorial theme: Scripting/Writing a Thread -- Next Step/ Spawn a 3D model

Script below spawns the car Infernus in Grovestreet if player goes into red marker(sphere)
If player leave the spot the car will be released from script and the reading process jumps back into 1.Loop
CODE
{$CLEO .cs}
:3dModels_1
03A4: name_thread 'MODL'

:3dModels_2
0001: wait  0 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @3dModels_2
00D6: if  0
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
004D: jump_if_false @3dModels_2

0247: request_model #INFERNUS

:Load_Model_Check
0001: wait  0 ms
00D6: if  0
0248:   model #INFERNUS available
004D: jump_if_false @Load_Model_Check

00A5: 1@ = create_car #INFERNUS at 2487.5  -1660.5  13.35
0175: set_car 1@ z_angle_to 90.0
0249: release_model #INFERNUS

:3dModels_3
0001: wait  0 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @3dModels_3
00D6: if  0
80FF:   NOT   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2491.5  -1667.5  13.35 radius  2.0  2.0  2.0
004D: jump_if_false @3dModels_3
01C3: remove_references_to_car 1@  // Like turning a car into any random car
0002: jump @3dModels_2



In the next step I spawn 2 actors in the car and let the car drive to a fix coord destination
fourthermore I add an marker to can see on radar where the car is.

To spawn the actor directly in the car I use opcode 0129: for the driver and 01C8: for the passenger.
It's also possible to spawn the actors by normal placement and let then the actors enter the car. Either as driver or as passenger, also with different opcodes.
The passenger opcodes needs to set the seat number in the last parameter:
0 = front passenger seat, 1 or 2 for the back seats

To let the car drive I use a simple "drive_to opcode"
There are a lot of other variation to let a car drive and it requires allways to set the speed.

The Loop after the "drive-to commands" needs now conditions which belongs to the car drive action
Very important is to check if the car is wrecked.
We need one or more ways to let the script refresh, I mean to release the car, it's marker and the actors from our script in some cases to can beginn the script from beginning.
Such situations can be if player dies or gets arrested, if the car is wrecked or if it is far away
if or
0119: car 1@ wrecked
01F4: car 1@ flipped
8202: not actor $PLAYER_ACTOR near_car 1@ radius 500.0 500.0 flag 0


Script below spawns the car Infernus in Grovestreet with two homies inthere,
if player goes into red marker(sphere)
It drives to the next crossroad and stays there till player is far away from car (500.0 units)
CODE
{$CLEO .cs}
:CarDrive_1
03A4: name_thread 'CDRIVE'

:CarDrive_2
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @CarDrive_2
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
004D: jump_if_false @CarDrive_2

0247: request_model #INFERNUS
0247: request_model #fam1
0247: request_model #fam2

:CarDrive_3
0001: wait  0 ms
if  and
0248:   model #INFERNUS available
0248:   model #fam1 available
0248:   model #fam2 available
004D: jump_if_false @CarDrive_3

00A5: 1@ = create_car #INFERNUS at 2487.5  -1660.5  13.35
0175: set_car 1@ z_angle_to 90.0
0129: 2@ = create_actor  8 #fam1 in_car 1@ driverseat
01C8: 3@ = create_actor  8 #fam2 in_car 1@ passenger_seat  0
0186: 4@ = create_marker_above_car 1@
07E0: set_marker 4@ type_to 1

0249: release_model #INFERNUS
0249: release_model #fam1
0249: release_model #fam2

////////////////////  the drive-to commands --vv----

00A7: car 1@ drive_to 2353.1528 -1658.6493 13.3846//---simple drive-to command
00AD: set_car 1@ max_speed_to  20.0//---speed declaration, important!!
00AE: unknown_set_car 1@ to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic


////////////////////  the drive-to commands --^^----



:CarDrive_13
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @CarDrive_13
if  or
0119:     car 1@ wrecked
01F4:     car 1@ flipped
8202:   not actor $PLAYER_ACTOR near_car 1@ radius 500.0 500.0 flag 0
004D: jump_if_false @CarDrive_13
01C3: remove_references_to_car 1@  // Like turning a car into any random car
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 3@ // Like turning an actor into a random pedestrian
0164: disable_marker 4@
0002: jump @CarDrive_2



As I said, there are a lot of other variation to let a car drive. The opcode 00A7: of the exemple above is the simpliest.
The car drive then strictly along the gta paths. The paths are stored in the nodes.dat in gta3.img
These paths are the routes for the random cars in traffic.
If you place a car in an area without path like in middle of the desert and let then the car drive, it drives first to the path
and then to the destination.
The car can not reach the destination if the destination is not on a path.
A car drive script can be a very annoying work, also if the destinations are on paths.
It often won't drive that route which we want or it stucks.

----------------------------------------------------------------------------

We have several opcodes to force the car to let it do what we want

----------------------------------------------------------------------------

opcode 04e0: let the car ingnore the paths and let it drive straight ahead to the destination
04e0: car 1@ abandon_path_radius 200

replace the script part with the drive-to commands of script above with this drive-to commands:
CODE
////////////////////  the drive-to commands --vv----

00A7: car 1@ drive_to 2431.5864 -1628.0818 13.698//---simple drive-to command
00AD: set_car 1@ max_speed_to  20.0//---speed declaration, important!!
00AE: unknown_set_car 1@ to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic
04e0: car 1@ abandon_path_radius 200

////////////////////  the drive-to commands --^^----

the destination is between the highway and grovestreet at that empty area
without 04e0: the car drives a long way on the street
opcode 04e0: works only in the given radius,
it means: by radius 200 the startpoint and the next destination may not be bigger than 200 units
more than 250 is not possible

----------------------------------------------------------------------------

the car chases the player with opcode 00AF: and 2 as last parameter

CODE
////////////////////  the drive-to commands --vv----

00AD: set_car 1@ max_speed_to  20.0//---speed declaration, important!!
00AE: unknown_set_car 1@ to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic
00AF: set_car 1@ driver_behaviour_to  2//-- 2 as last param let chase the player

////////////////////  the drive-to commands --^^----


four valid settings for opcode 00AF:
1 - follow road, drive back if way is blocked
2 - kill the player
4 - drive to player and stop
8 - ignore road-paths

----------------------------------------------------------------------------

the car drives automaticly along the paths with opcode 00AF: and 1 as last parameter

CODE
////////////////////  the drive-to commands --vv----

00AD: set_car 1@ max_speed_to  20.0//---speed declaration, important!!
00AE: unknown_set_car 1@ to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic
00AF: set_car 1@ driver_behaviour_to 1

////////////////////  the drive-to commands --^^----


----------------------------------------------------------------------------

We can use an opcode to read the coords infront of the car and let it drive to that point

CODE
////////////////////  the drive-to commands --vv----

0407: create_coordinate 11@ 12@ 13@ from_car 1@ offset  -10.0  15.0  0.0
00A7: car 1@ drive_to 11@ 12@ 13@//---simple drive-to command
00AD: set_car 1@ max_speed_to  20.0//---speed declaration, important!!
00AE: unknown_set_car 1@ to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic


////////////////////  the drive-to commands --^^----


----------------------------------------------------------------------------

We can use an opcode to read the coords infront of the car and let it drive to that point
and give it a start boost with opcode 04BA:

CODE
////////////////////  the drive-to commands --vv----

0407: create_coordinate 11@ 12@ 13@ from_car 1@ offset  -10.0  15.0  0.0
00A7: car 1@ drive_to 11@ 12@ 13@//---simple drive-to command
00AD: set_car 1@ max_speed_to  20.0//---speed declaration, important!!
00AE: unknown_set_car 1@ to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic
04BA: set_car 1@ speed_instantly  50.0

////////////////////  the drive-to commands --^^----


----------------------------------------------------------------------------

Let the driver do corrections

R* use in the main.scm a stuck car check, but this function don't work in Cleo
But to let the driver do corrections can be used opcode 06C7:

CODE
////////////////////  the drive-to commands --vv----

06C7: AS_actor 2@ driver_of_car 1@ perform_action 14 timelimit 3000    //backward circle
00A7: car 1@ drive_to 2353.1528 -1658.6493 13.3846//---simple drive-to command
00AD: set_car 1@ max_speed_to  20.0//---speed declaration, important!!
00AE: unknown_set_car 1@ to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic

////////////////////  the drive-to commands --^^----


the driver make first a backward circle for ca. 3 seconds, then the car drives to the given point
----------------------------------------------------------------------------
some different versions of opcode 06C7:
CODE
06C7: AS_actor 2@ driver_of_car 1@ perform_action 6 timelimit 1000     //a short stop                    
06C7: AS_actor 2@ driver_of_car 1@ perform_action 6 timelimit 2000000  //a long stop                    
06C7: AS_actor 2@ driver_of_car 1@ perform_action 3 timelimit 3000     //backwards to the right side, than straight ahead
06C7: AS_actor 2@ driver_of_car 1@ perform_action 22 timelimit 3000    //backwards to the left side, than straight ahead  
06C7: AS_actor 2@ driver_of_car 1@ perform_action 14 timelimit 3000    //backward circle                  
06C7: AS_actor 2@ driver_of_car 1@ perform_action 9 timelimit 3000     //bump forward                        
06C7: AS_actor 2@ driver_of_car 1@ perform_action 7 timelimit 3000     //steer left                            
06C7: AS_actor 2@ driver_of_car 1@ perform_action 8 timelimit 3000     //steer right


----------------------------------------------------------------------------

Let the driver drive

Opcode 05D1: let the driver drive instead to let the car drive

This function can also ignore the paths (like using 04e0: car 1@ abandon_path_radius)
and let the driver drive the car directly to the given point
It's depending from the setting in the flags

0 0 5 let it drive on paths
2 0 5 ignore the paths

CODE
////////////////////  the drive-to commands --vv----

05D1: AS_actor 2@ drive_car 1@ to  2353.1528 -1658.6493 13.384 speed  20.0  0  0  5

////////////////////  the drive-to commands --^^----


----------------------------------------------------------------------------

Opcode 05D1: can be set more times as combo in an AS_Pack
It needs than to set -1 instead the variable name of the driver
and assign the actor 2@ after the AS_pack-setup to the defined AS_pack

CODE
////////////////////  the drive-to commands --vv----

0615: define_action_sequences 5@
05D1: AS_actor -1 drive_car 1@ to  2353.1528 -1658.6493 13.384 speed  20.0  0  0  5
05D1: AS_actor -1 drive_car 1@ to  2431.7739 -1674.7444 13.6643 speed  20.0  0  0  5
05D1: AS_actor -1 drive_car 1@ to  2431.5864 -1628.0818 13.698 speed  20.0  2  0  5
0616: define_action_sequences_end 5@
0618: assign_actor 2@ to_action_sequences 5@
061B: remove_references_to_AS_pack 5@

////////////////////  the drive-to commands --^^----



----------------------------------------------------------------------------

Define a scmpath for the driver

Set first opcode 05D6: to clear first a possibly created previous scmpath
Than set new coords for the scmpath and use opcode 07E7: to let the driver drive along this path

This function can also ignore the paths (like using 04e0: car 1@ abandon_path_radius)
and let the driver drive the car directly to the given point
It's depending from the setting in the flags

0 0 5 let it drive on paths
2 0 5 ignore the paths

CODE
////////////////////  the drive-to commands --vv----

05D6: clear_scmpath
05D7: add_point_to_scmpath  2353.1528 -1658.6493 13.384
05D7: add_point_to_scmpath  2431.7739 -1674.7444 13.6643
07E7: AS_assign_scmpath_to_actor 2@ in_car 1@ speed  20.0 flags  0  0  5

////////////////////  the drive-to commands --^^----


----------------------------------------------------------------------------

Car drive scripts in praxis

----------------------------------------------------------------------------

In praxis to write a car drive script with a longer specific route needs a more complex script,
which checks if the car reached the destination to can submit the new destination.
Because you can not check the same destination coords which you want to submit when the car reached it,
you must use access checks

Fourthermore it needs to check if the car do airborns because it looses the coord information
and we must give this information again in this case

A check if the car is fliped or wrecked makes allways sense, because it can not continue the route and the script should cancel the action in this case

R* use in the main.scm a stuck car check, but this function don't work in Cleo
a check if the car speed is smaller than 1.0 can help

----------------------------------------------------------------------------

The SF-Airport Circle version 1

The script below teleport the player to the SF airport on a motorbike and spawns an opponent driver on motorbike who drives around the airort building.
Go outside to the exterior map and press Backspace then follow the opponent driver to see what he do
Opcode 00A7: car 1@ drive_to is used and 04e0: car 1@ abandon_path_radius
The driver falls from bike sometimes and enters again his ride to continue the drive
Alternativ you can activte the opcode 08C6:
CODE
//08C6: set_actor 9@  stay_on_bike 1

To refresh the script needs to leave the aiport, you must have a distance of 700.0 units to the startpoint

CODE
{$CLEO .cs}
:Drive_1
03A4: name_thread 'DRIV'

:Drive_3
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
jf @Drive_3
077E: 0@ = active_interior
if  and
0039:   0@ ==  0  // integer values
0AB0:   key_pressed 8//----------------------------------------Backspace  
jf @Drive_3
016A: fade  0 ()  250 ms
0001: wait 250 ms
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at -1338.5  -408.1  14.1
0173: set_actor $PLAYER_ACTOR z_angle_to  90.8
0001: wait  500 ms
0247: request_model #NRG500
0247: request_model #MAFFA

:Drive_5
0001: wait  0 ms
if  and
0248:   model #NRG500 available
0248:   model #MAFFA available
jf @Drive_5
00A5: 1@ = create_car #NRG500 at -1333.5  -408.1  14.1
0175: set_car 1@ z_angle_to  280.0
0224: set_car 1@ health_to  2000
00A5: 7@ = create_car #NRG500 at -1354.5  -419.1  14.1
0175: set_car 7@ z_angle_to  280.0
0224: set_car 7@ health_to  2000
020A: set_car  7@ door_status_to 4
02AC: set_car 7@ immunities  1  1  1  1  1
01EC: make_car 7@ very_heavy  1
0129: 9@ = create_actor  24 #MAFFA in_car 7@ driverseat
0223: set_actor 9@ health_to  3000
04E4: unknown_refresh_game_renderer_at  -1333.5  -408.1
03CB: set_camera  -1333.5  -408.1  14.1
029B: 23@ = init_object 1655 at -1576.02  -202.34  13.76
0177: set_object 23@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 23@
0382: set_object 23@ collision_detection  1
029B: 24@ = init_object 1655 at -1597.9  -506.5  21.7
0177: set_object 24@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 24@
0382: set_object 24@ collision_detection  1
029B: 25@ = init_object 1655 at -1375.9  -581.5  13.69
0177: set_object 25@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 25@
0382: set_object 25@ collision_detection  1
029B: 26@ = init_object 1655 at -1374.9  -585.5  13.69
0177: set_object 26@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 26@

0382: set_object 26@ collision_detection  1
0177: set_object 23@ z_angle_to  135.0
0177: set_object 24@ z_angle_to  225.0
0177: set_object 25@ z_angle_to  280.0
0177: set_object 26@ z_angle_to  280.0
0186: 29@ = create_marker_above_car 7@
07E0: set_marker 29@ type_to 1

0249: release_model #NRG500
0249: release_model #MAFFA
04e0: car 7@ abandon_path_radius 200
00AD: set_car 7@ max_speed_to  100.0
04BA: set_car 7@ speed_instantly  30.0
00AF: set_car 7@ driver_behaviour_to  1
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
0001: wait  250 ms
036A: put_actor $PLAYER_ACTOR in_car 1@
0001: wait  250 ms
016A: fade  1 ()  1000 ms
0001: wait  1000 ms
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
0006: 15@ =  0  // integer values
0006: 16@ =  0  // integer values
0006: 20@ =  20000  // floating-point values
0006: 19@ =  0  // integer values
0007: 11@ =  -1320.48  // floating-point values
0007: 12@ =  -407.1  // floating-point values
0007: 13@ =  13.76  // floating-point values
00A7: car 7@ drive_to  11@ 12@ 13@
00AD: set_car 7@ max_speed_to  1.0
04e0: car 7@ abandon_path_radius 250
//08C6: set_actor 9@  stay_on_bike 1

:Drive_7
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
jf @Drive_7

0050: gosub @Drive_sub_3

if  and
8119:   NOT   car 1@ wrecked
8119:   NOT   car 7@ wrecked
8118:   NOT   actor 9@ dead
jf @Drive_7
if
00FE:   actor $PLAYER_ACTOR  0 ()near_point -1333.5  -408.1  14.1 radius  650.5  650.5  50.5
jf @Drive_12
jump @Drive_7

:Drive_12
0164: disable_marker 29@
01C3: remove_references_to_car 1@  // Like turning a car into any random car
01C3: remove_references_to_car 7@  // Like turning a car into any random car
01C2: remove_references_to_actor 9@  // Like turning an actor into a random pedestrian
0108: destroy_object 23@
0108: destroy_object 24@
0108: destroy_object 25@
0108: destroy_object 26@
jump @Drive_3


:Drive_sub_3
if
8119:   NOT   car 7@ wrecked
jf @Drive_sub_109
if
00DB:   actor 9@ in_car 7@
jf @Drive_sub_99
if
0039:   19@ ==  1  // integer values
jf @Drive_sub_10
0006: 19@ =  0  // integer values
jump @Drive_sub_100

:Drive_sub_10
if
0039:   15@ ==  0  // integer values
jf @Drive_sub_11
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  5.2  5.2  5.0
jf @Drive_sub_11
0006: 15@ =  1  // integer values
0007: 11@ =  -1181.78  // floating-point values
0007: 12@ =  -331.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
jump @Drive_sub_100

:Drive_sub_11
if
0039:   15@ ==  1  // integer values
jf @Drive_sub_12
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @Drive_sub_12
00AD: set_car 7@ max_speed_to  10.0
0006: 15@ =  2  // integer values
0007: 11@ =  -1282.1  // floating-point values
0007: 12@ =  -159.3  // floating-point values
0007: 13@ =  13.76  // floating-point values
0175: set_car 7@ z_angle_to 340.0
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
jump @Drive_sub_100


:Drive_sub_12
if
0039:   15@ ==  2  // integer values
jf @Drive_sub_13
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @Drive_sub_13
00AD: set_car 7@ max_speed_to  25.0
0006: 15@ =  3  // integer values
0007: 11@ =  -1498.78  // floating-point values
0007: 12@ =  -138.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
0175: set_car 7@ z_angle_to 65.0
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
jump @Drive_sub_100

:Drive_sub_13
if
0039:   15@ ==  3  // integer values
jf @Drive_sub_14
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  8.2  8.2  5.0
jf @Drive_sub_14
00AD: set_car 7@ max_speed_to  25.0
0006: 15@ =  4  // integer values
0007: 11@ =  -1576.78  // floating-point values
0007: 12@ =  -202.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
0175: set_car 7@ z_angle_to 135.0
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
jump @Drive_sub_100



:Drive_sub_14
if
0039:   15@ ==  4  // integer values
jf @Drive_sub_15
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  5.2  5.2  5.0
jf @Drive_sub_15
0006: 15@ =  5  // integer values
0007: 11@ =  -1694.78  // floating-point values
0007: 12@ =  -352.30  // floating-point values
0007: 13@ =  13.9  // floating-point values
0175: set_car 7@ z_angle_to 135.0
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
jump @Drive_sub_100

:Drive_sub_15
if
0039:   15@ ==  5  // integer values
jf @Drive_sub_16
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @Drive_sub_16
00AD: set_car 7@ max_speed_to  10.0
0006: 15@ =  6  // integer values
0007: 11@ =  -1691.78  // floating-point values
0007: 12@ =  -409.30  // floating-point values
0007: 13@ =  13.9  // floating-point values
0175: set_car 7@ z_angle_to 180.0
000A: 16@ +=  0  // integer values
0007: 17@ =  40.0  // floating-point values
0007: 18@ =  10.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
jump @Drive_sub_100

:Drive_sub_16
if
0039:   15@ ==  6  // integer values
jf @Drive_sub_17
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  8.2  8.2  5.0
jf @Drive_sub_17
00AD: set_car 7@ max_speed_to  0.0
0006: 15@ =  7  // integer values
0007: 11@ =  -1519.78  // floating-point values
0007: 12@ =  -580.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
0175: set_car 7@ z_angle_to 250.0
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  0.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
jump @Drive_sub_100

:Drive_sub_17
if
0039:   15@ ==  7  // integer values
jf @Drive_sub_18
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @Drive_sub_18
00AD: set_car 7@ max_speed_to  5.0
01EB: set_car_density_to  0.0
0006: 15@ =  8  // integer values
0007: 11@ =  -1299.78  // floating-point values
0007: 12@ =  -565.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
0175: set_car 7@ z_angle_to 0.0
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
jump @Drive_sub_100


:Drive_sub_18
if
0039:   15@ ==  8  // integer values
jf @Drive_sub_109
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  25.2  25.2  5.0
jf @Drive_sub_109
00AD: set_car 7@ max_speed_to  0.0
0006: 15@ =  1  // integer values
000A: 16@ +=  1  // integer values
0007: 11@ =  -1181.78  // floating-point values
0007: 12@ =  -331.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
0175: set_car 7@ z_angle_to 1.0
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
04e0: car 7@ abandon_path_radius 250
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2

if
0039:   16@ ==  2  // integer values
jf @Drive_sub_100
00BC: text_highpriority 'BJ_LOSE'  5000 ms  1
jump @Drive_sub_100


:Drive_sub_99
if
0039:   19@ ==  0  // integer values
jf @Drive_sub_109
00AD: set_car 7@ max_speed_to  0.0
05CB: actor_goto_and_enter_car 9@ 7@  5000
0006: 19@ =  1  // integer values
jump @Drive_sub_109

:Drive_sub_100
00A7: car 7@ drive_to  11@ 12@ 13@
00AD: set_car 7@ max_speed_to  17@
03F0: text_draw_toggle  0
0006: 33@ =  0  // integer values
jump @Drive_sub_109



:Drive_sub_102
if
01F3:   car 7@ airborne
jf @Drive_sub_103
0007: 18@ =  0.0  // floating-point values
00A7: car 7@ drive_to  11@ 12@ 13@
04BA: set_car 7@ speed_instantly  18@
00AD: set_car 7@ max_speed_to  17@
jump @Drive_sub_103

:Drive_sub_103
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  30.2  30.2  5.0
jf @Drive_sub_104
jump @Drive_sub_105

:Drive_sub_104
02E3: 20@ = car 7@ speed
if
81F3:   NOT   car 7@ airborne
jf @Drive_sub_106
if  and
0021:   20@ >  30.0  // floating-point values
0019:   33@ >  700  // integer values
jf @Drive_sub_105
04BA: set_car 7@ speed_instantly  50.0

:Drive_sub_105
if
0019:   33@ >  2000  // integer values
jf @Drive_sub_109

:Drive_sub_106
0006: 33@ =  0  // integer values


:Drive_sub_109
0051: return


----------------------------------------------------------------------------

The SF-Airport Circle version 2

Same script as above but now opcode 07E7: AS_assign_scmpath_to_actor is used
It teleports the player to the SF airport on a motorbike and spawns an opponent driver on motorbike who drives around the airort building.
Go outside to the exterior map and press Backspace then follow the opponent driver to see what he do
To refresh the script needs to leave the aiport, you must have a distance of 700.0 units to the startpoint

CODE
{$CLEO .cs}
:scmpath_1
03A4: name_thread 'SCMP'

:scmpath_3
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
jf @scmpath_3
077E: 0@ = active_interior
if  and
0038:   0@ ==  0  // integer values
0AB0:   key_pressed 8//----------------------------------------Backspace  
jf @scmpath_3
016A: fade  0 ()  250 ms
0001: wait 250 ms
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at -1338.5  -408.1  14.1
0173: set_actor $PLAYER_ACTOR z_angle_to  90.8
0001: wait  500 ms
0247: request_model #NRG500
0247: request_model #MAFFA

:scmpath_5
0001: wait  0 ms
if  and
0248:   model #NRG500 available
0248:   model #MAFFA available
jf @scmpath_5
00A5: 1@ = create_car #NRG500 at -1333.5  -408.1  14.1
0175: set_car 1@ z_angle_to  280.0
0224: set_car 1@ health_to  2000
00A5: 7@ = create_car #NRG500 at -1354.5  -419.1  14.1
0175: set_car 7@ z_angle_to  280.0
0224: set_car 7@ health_to  2000
020A: set_car  7@ door_status_to 4
02AC: set_car 7@ immunities  1  1  1  1  1
01EC: make_car 7@ very_heavy  1
0129: 9@ = create_actor  24 #MAFFA in_car 7@ driverseat
0223: set_actor 9@ health_to  3000
04E4: unknown_refresh_game_renderer_at  -1333.5  -408.1
03CB: set_camera  -1333.5  -408.1  14.1
029B: 23@ = init_object 1655 at -1576.02  -202.34  13.76
0177: set_object 23@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 23@
0382: set_object 23@ collision_detection  1
029B: 24@ = init_object 1655 at -1597.9  -506.5  21.7
0177: set_object 24@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 24@
0382: set_object 24@ collision_detection  1
029B: 25@ = init_object 1655 at -1375.9  -581.5  13.69
0177: set_object 25@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 25@
0382: set_object 25@ collision_detection  1
029B: 26@ = init_object 1655 at -1374.9  -585.5  13.69
0177: set_object 26@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 26@

0382: set_object 26@ collision_detection  1
0177: set_object 23@ z_angle_to  135.0
0177: set_object 24@ z_angle_to  225.0
0177: set_object 25@ z_angle_to  280.0
0177: set_object 26@ z_angle_to  280.0
0186: 29@ = create_marker_above_car 7@
07E0: set_marker 29@ type_to 1

0249: release_model #NRG500
0249: release_model #MAFFA
04e0: car 7@ abandon_path_radius 200
00AD: set_car 7@ max_speed_to  100.0
04BA: set_car 7@ speed_instantly  30.0
00AF: set_car 7@ driver_behaviour_to  1
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
0001: wait  250 ms
036A: put_actor $PLAYER_ACTOR in_car 1@
0001: wait  250 ms
016A: fade  1 ()  1000 ms
0001: wait  1000 ms
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
0006: 15@ =  0  // integer values
0006: 16@ =  0  // integer values
0006: 20@ =  20000  // floating-point values
0006: 19@ =  0  // integer values
0007: 11@ =  -1320.48  // floating-point values
0007: 12@ =  -407.1  // floating-point values
0007: 13@ =  13.76  // floating-point values
00A7: car 7@ drive_to  11@ 12@ 13@
00AD: set_car 7@ max_speed_to  1.0
04e0: car 7@ abandon_path_radius 250
08C6: set_actor 9@  stay_on_bike 1





:scmpath_7
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
jf @scmpath_7

0050: gosub @scmpath_sub_3

if  and
8119:   NOT   car 1@ wrecked
8119:   NOT   car 7@ wrecked
8118:   NOT   actor 9@ dead
jf @scmpath_7
if
00FE:   actor $PLAYER_ACTOR  0 ()near_point -1333.5  -408.1  14.1 radius  650.5  650.5  50.5
jf @scmpath_12
jump @scmpath_7

:scmpath_12
0164: disable_marker 29@
01C3: remove_references_to_car 1@  // Like turning a car into any random car
01C3: remove_references_to_car 7@  // Like turning a car into any random car
01C2: remove_references_to_actor 9@  // Like turning an actor into a random pedestrian
0108: destroy_object 23@
0108: destroy_object 24@
0108: destroy_object 25@
0108: destroy_object 26@
jump @scmpath_3


:scmpath_sub_3
if
8119:   NOT   car 7@ wrecked
jf @scmpath_sub_109
if
00DB:   actor 9@ in_car 7@
jf @scmpath_sub_99
if
0039:   19@ ==  1  // integer values
jf @scmpath_sub_10
0006: 19@ =  0  // integer values
jump @scmpath_sub_100

:scmpath_sub_10
if
0039:   15@ ==  0  // integer values
jf @scmpath_sub_11
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  5.2  5.2  5.0
jf @scmpath_sub_11
0006: 15@ =  1  // integer values
05D6: clear_scmpath
0007: 11@ =  -1181.78  // floating-point values
0007: 12@ =  -331.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100

:scmpath_sub_11
if
0039:   15@ ==  1  // integer values
jf @scmpath_sub_12
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @scmpath_sub_12
00AD: set_car 7@ max_speed_to  10.0
0006: 15@ =  2  // integer values
05D6: clear_scmpath
0007: 11@ =  -1282.1  // floating-point values
0007: 12@ =  -159.3  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100


:scmpath_sub_12
if
0039:   15@ ==  2  // integer values
jf @scmpath_sub_13
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @scmpath_sub_13
00AD: set_car 7@ max_speed_to  25.0
0006: 15@ =  3  // integer values
05D6: clear_scmpath
0007: 11@ =  -1498.78  // floating-point values
0007: 12@ =  -138.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100

:scmpath_sub_13
if
0039:   15@ ==  3  // integer values
jf @scmpath_sub_14
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  8.2  8.2  5.0
jf @scmpath_sub_14
00AD: set_car 7@ max_speed_to  25.0
0006: 15@ =  4  // integer values
05D6: clear_scmpath
0007: 11@ =  -1576.78  // floating-point values
0007: 12@ =  -202.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100



:scmpath_sub_14
if
0039:   15@ ==  4  // integer values
jf @scmpath_sub_15
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  5.2  5.2  5.0
jf @scmpath_sub_15
0006: 15@ =  5  // integer values
05D6: clear_scmpath
0007: 11@ =  -1694.78  // floating-point values
0007: 12@ =  -352.30  // floating-point values
0007: 13@ =  13.9  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100

:scmpath_sub_15
if
0039:   15@ ==  5  // integer values
jf @scmpath_sub_16
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @scmpath_sub_16
00AD: set_car 7@ max_speed_to  10.0
0006: 15@ =  6  // integer values
05D6: clear_scmpath
0007: 11@ =  -1691.78  // floating-point values
0007: 12@ =  -409.30  // floating-point values
0007: 13@ =  13.9  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  40.0  // floating-point values
0007: 18@ =  10.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
jump @scmpath_sub_100

:scmpath_sub_16
if
0039:   15@ ==  6  // integer values
jf @scmpath_sub_17
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  8.2  8.2  5.0
jf @scmpath_sub_17
00AD: set_car 7@ max_speed_to  0.0
0006: 15@ =  7  // integer values
05D6: clear_scmpath
0007: 11@ =  -1519.78  // floating-point values
0007: 12@ =  -580.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  0.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
jump @scmpath_sub_100

:scmpath_sub_17
if
0039:   15@ ==  7  // integer values
jf @scmpath_sub_18
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @scmpath_sub_18
00AD: set_car 7@ max_speed_to  5.0
01EB: set_car_density_to  0.0
0006: 15@ =  8  // integer values
05D6: clear_scmpath
0007: 11@ =  -1299.78  // floating-point values
0007: 12@ =  -565.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100


:scmpath_sub_18
if
0039:   15@ ==  8  // integer values
jf @scmpath_sub_109
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  25.2  25.2  5.0
jf @scmpath_sub_109
00AD: set_car 7@ max_speed_to  0.0
0006: 15@ =  1  // integer values
000A: 16@ +=  1  // integer values
05D6: clear_scmpath
0007: 11@ =  -1181.78  // floating-point values
0007: 12@ =  -331.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@

if
0039:   16@ ==  2  // integer values
jf @scmpath_sub_100
00BC: text_highpriority 'BJ_LOSE'  5000 ms  1
jump @scmpath_sub_100


:scmpath_sub_99
if
0039:   19@ ==  0  // integer values
jf @scmpath_sub_109
00AD: set_car 7@ max_speed_to  0.0
05CB: actor_goto_and_enter_car 9@ 7@  5000
0006: 19@ =  1  // integer values
jump @scmpath_sub_109

:scmpath_sub_100
07E7: AS_assign_scmpath_to_actor 9@ in_car 7@ speed 17@ flags 2 0 3
03F0: text_draw_toggle  0
0006: 33@ =  0  // integer values
jump @scmpath_sub_109



:scmpath_sub_102
if
01F3:   car 7@ airborne
jf @scmpath_sub_103
0007: 18@ =  0.0  // floating-point values
04BA: set_car 7@ speed_instantly  18@
07E7: AS_assign_scmpath_to_actor 9@ in_car 7@ speed 17@ flags 2 0 3
jump @scmpath_sub_103

:scmpath_sub_103
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  30.2  30.2  5.0
jf @scmpath_sub_104
jump @scmpath_sub_105

:scmpath_sub_104
02E3: 20@ = car 7@ speed
if
81F3:   NOT   car 7@ airborne
jf @scmpath_sub_106
if  and
0021:   20@ >  30.0  // floating-point values
0019:   33@ >  700  // integer values
jf @scmpath_sub_105
04BA: set_car 7@ speed_instantly  50.0

:scmpath_sub_105
if
0019:   33@ >  2000  // integer values
jf @scmpath_sub_109

:scmpath_sub_106
0006: 33@ =  0  // integer values


:scmpath_sub_109
0051: return


This post has been edited by ZAZ on Saturday, Oct 3 2009, 09:38
Users WebsitePM
  Top
 

 
ZAZ  
Posted: Saturday, Aug 29 2009, 13:22
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award





Use Carrec Paths to let a vehicle move along a recorded route

Record a path with Seemanns carrec.cs http://cleo.sannybuilder.com/
More informations at http://www.gtaforums.com/index.php?showtopic=297295

Its created then in GTASA\data\paths

Rename it to carrec899.rrr and import it into carrec.img
Then use the script below to assigne player car to the path
CODE
{$CLEO .cs}
:DrvCarrec_1
03A4: name_thread 'DRVCARC'

:DRVCARC_11
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @DRVCARC_11
00D6: if and
0AB0:   key_pressed 57
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @DRVCARC_11
03C0: 0@ = actor $PLAYER_ACTOR car
0A30: repair_car 0@
0224: set_car 0@ health_to 1000
0006: 8@ = 899
07C0: load_path 8@

:DRVCARC_85
0001: wait 0 ms
00D6: if
07C1:   path 8@ available
004D: jump_if_false @DRVCARC_85
00D6: if
8119:   not car 0@ wrecked
004D: jump_if_false @DRVCARC_218
0001: wait 500 ms
05EB: assign_car 0@ to_path 8@

:DRVCARC_148
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @DRVCARC_218
00D6: if or
0AB0:   key_pressed 48
0119:   car 0@ wrecked
004D: jump_if_false @DRVCARC_195
0002: jump @DRVCARC_218

:DRVCARC_195
00D6: if
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @DRVCARC_218
0002: jump @DRVCARC_148

:DRVCARC_218
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @DRVCARC_218
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
05EC: release_car 0@ from_path
0873: release_path 8@
01C3: remove_references_to_car 0@ // Like turning a car into any random car
0001: wait 1000 ms
0002: jump @DRVCARC_11
Users WebsitePM
  Top
 

 
Rapier  
Posted: Monday, Aug 31 2009, 04:05
Quote Post


Retired scripter
Group Icon
Group: Members
Joined: Aug 14, 2005

ba.gif

XXXXX



QUOTE (ZAZ @ Jun 5 2009, 18:34)
we can use the adress 0x00969110 as cheat key_press check

This memory address is for version 1.0, but, for version 1.01 which will be?
That's because my mods did not work anymore after I did the upgrade to version 1.01 and all are activated as a cheat.
PM
  Top
 

 
Wesser  
Posted: Monday, Aug 31 2009, 07:21
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




It's 0x96B790 for 1.1. smile.gif
PMMSNPlayStation Network
  Top
 

 
markbaker  
Posted: Monday, Aug 31 2009, 16:56
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 26, 2009

XXXXX



wow, thanks ZAZ! this is a god-send smile.gif
PM
  Top
 

 
markbaker  
Posted: Monday, Aug 31 2009, 22:43
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 26, 2009

XXXXX



One more question:

Is there a pathing tool out there like carrec, but for the Camera instead of for cars?

It would be nice if i could record a path for my camera to move along during cutscenes, for a cinematic feel.

Thanks
PM
  Top
 

 
Rapier  
Posted: Tuesday, Sep 1 2009, 00:18
Quote Post


Retired scripter
Group Icon
Group: Members
Joined: Aug 14, 2005

ba.gif

XXXXX



QUOTE (Wesser @ Aug 31 2009, 05:21)
It's 0x96B790 for 1.1. smile.gif

Thanks Wesser!
PM
  Top
 

 
ZAZ  
Posted: Tuesday, Sep 1 2009, 16:37
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (markbaker @ Aug 31 2009, 22:43)
One more question:

Is there a pathing  tool out there like carrec, but for the Camera instead of for cars?

It would be nice if i could record a path for my camera to move along during cutscenes, for a cinematic feel.

Thanks

No, there isn't way to make camera paths.
For camera exist a lot of opcodes to realize your plan.
One way could be to record a carrec with heli and use then any vehicle to attach the carrec path.
Then put the camera on vehicle
CODE
00A5: 1@ = create_car #INFERNUS at 2487.5  -1660.5  13.35
0679: put_camera_on_car 1@ with_offset 0.0 -5.0 1.5 rotation 0.0 0.0 0.0 0.0 2//view trunk

0679: put_camera_on_car 1@ with_offset 0.0 -5.0 1.5 <--xyz position relativ to car
xyz point to view relativ to car-->> 0.0 0.0 0.0 rotation -->> 0.0 2 <--mode


the equivalent for the actor is opcode 067C:
The exemple above is from a cutsene which I made to move the camera nearer to the viewpoint
CODE
0007: 6@ =  0.5  // floating-point values
0007: 7@ =  0.0  // floating-point values
0007: 8@ =  0.0  // floating-point values

:Loop
wait 0
067C: $PLAYER_ACTOR  8@  6@ 0.7  7@  13.5 0.5 0.0  2
000B: 6@ +=  0.03  // floating-point values
000B: 7@ +=  0.01  // floating-point values
000B: 8@ +=  0.01  // floating-point values
jump @Loop

If you put the cam to player the player-walk-movement will be buggy


In connection with opcode 015F: you can set the camera view to follow an actor automaticly
CODE
015F: set_camera_position -2248.2187 -79.441 37.7686 rotation 0.0 0.0 0.0
0159: camera_on_ped 80@ 15 2




This post has been edited by ZAZ on Tuesday, Sep 1 2009, 16:40
Users WebsitePM
  Top
 

 
markbaker  
Posted: Thursday, Sep 3 2009, 02:00
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 26, 2009

XXXXX



ZAZ:

I've got a heli flying along a carrec path with a camera attached to the heli.


What I want to do is: the heli-mounted camera automatically 'point at' a parked or moving car while the heli is flying along the path. Is this possible?

PM
  Top
 

 
ZAZ  
Posted: Thursday, Sep 3 2009, 18:52
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (markbaker @ Sep 3 2009, 02:00)
I've got a heli flying along a carrec path with a camera attached to the heli.
What I want to do is:  the heli-mounted camera automatically 'point at' a parked or moving car while the heli is flying along the path. Is this possible?


Camera on carrec path

Only the combination of opcode 015F: and 0159: let the camera follow automaticly a moving target point
But we have enough codes in SA to do everything.
We can read the car positions as variable values and and insert this variables as parameter in the standart camera position opcode

The placing of cars by using parked_car_generator dont allows the using of its variable name in vehicle associated opcodes
because its not a car but a car_generator
But we can simple use the same coords to insert it in the standart camera target opcode


The script below spawns a NRG500 and follows the carrec path carrec899.rrr by keypress 8
The camera shows a fix XYZcoordpoint
(I placed a Monster at SFAirport and drove around and inserted the coords of the parked_car #monster in the script)
//-init_parked_car_generator #MONSTER color -1 -1 1 alarm 0 door_lock 0 0 10000 at -1355.7821 -71.4736 14.1462 angle 86.0
0160: set_camera_point_at -1355.7821 -71.4736 14.1462 mode 2
CODE
{$CLEO .cs}
:CameraDrive_1
03A4: name_thread 'DRVCARC'

:CameraDrive_11
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @CameraDrive_11
if
0AB0:   key_pressed 56//----------- key 8
004D: jump_if_false @CameraDrive_11
0247: request_model #NRG500

:CameraDrive_13
0001: wait  0 ms
00D6: if  0
0248:   model #NRG500 available
004D: jump_if_false @CameraDrive_13

00A5: 0@ = create_car #NRG500 at 0.0  0.0  100.0
0175: set_car 0@ z_angle_to 0.0
02AC: set_car 0@ immunities BP 1 FP 1 EP 1 CP 1 MP 1
0249: release_model #NRG500
0006: 8@ = 899
07C0: load_path 8@

:CameraDrive_17
0001: wait 0 ms
00D6: if
07C1:   path 8@ available
004D: jump_if_false @CameraDrive_17
00D6: if
8119:   not car 0@ wrecked
004D: jump_if_false @CameraDrive_50
0001: wait 500 ms
05EB: assign_car 0@ to_path 8@

:CameraDrive_21
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @CameraDrive_50
00D6: if or
00E1:   key_pressed  0  15//Enter/Exit
0119:   car 0@ wrecked
004D: jump_if_false @CameraDrive_25
0002: jump @CameraDrive_50

:CameraDrive_25
0407: create_coordinate 11@ 12@ 13@ from_car 0@ with_offset 0.0 0.0 1.0
015F: set_camera_position 11@ 12@ 13@ rotation 0.0 0.0 0.0
//init_parked_car_generator #MONSTER at -1355.7821 -71.4736 14.1462
0160: set_camera_point_at -1355.7821 -71.4736 14.1462 mode 2
0002: jump @CameraDrive_21

:CameraDrive_50
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @CameraDrive_50
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
05EC: release_car 0@ from_path
0873: release_path 8@
01C3: remove_references_to_car 0@ // Like turning a car into any random car
0001: wait 1000 ms
0002: jump @CameraDrive_11



To view a moving target from a moving vehicle is a bit more complicate because we need a script for the moving target and a script for the camera on carrec path.
I merged the CarDrive script and the CameraDrive script

Script below spawns the car Infernus in Grovestreet with two homies inthere,
if player goes into red marker(sphere)
additional it spawns a NRG500 and follows the carrec path carrec899.rrr
The camera shows a moving XYZcoords of the driving Infernus
CODE
{$CLEO .cs}
:CarrecCamCarDrive_1
03A4: name_thread 'CRCMCDR'

:CarrecCamCarDrive_2
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @CarrecCamCarDrive_2
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
004D: jump_if_false @CarrecCamCarDrive_2

0247: request_model #INFERNUS
0247: request_model #fam1
0247: request_model #fam2
0247: request_model #NRG500

:CarrecCamCarDrive_3
0001: wait  0 ms
if  and
0248:   model #INFERNUS available
0248:   model #fam1 available
0248:   model #fam2 available
0248:   model #NRG500 available
004D: jump_if_false @CarrecCamCarDrive_3

00A5: 1@ = create_car #INFERNUS at 2487.5  -1660.5  13.35
0175: set_car 1@ z_angle_to 90.0
0129: 2@ = create_actor  8 #fam1 in_car 1@ driverseat
01C8: 3@ = create_actor  8 #fam2 in_car 1@ passenger_seat  0
0186: 4@ = create_marker_above_car 1@
07E0: set_marker 4@ type_to 1

00A5: 0@ = create_car #NRG500 at 0.0  0.0  100.0
0175: set_car 0@ z_angle_to 0.0
02AC: set_car 0@ immunities BP 1 FP 1 EP 1 CP 1 MP 1

0006: 8@ = 899
07C0: load_path 8@

:CarrecCamCarDrive_5
0001: wait 0 ms
00D6: if
07C1:   path 8@ available
004D: jump_if_false @CarrecCamCarDrive_5
00D6: if
8119:   not car 0@ wrecked
004D: jump_if_false @CarrecCamCarDrive_50
0001: wait 500 ms
05EB: assign_car 0@ to_path 8@

////////////////////  the drive-to commands --vv----

0615: define_action_sequences 5@
05D1: AS_actor -1 drive_car 1@ to  2353.1528 -1658.6493 13.384 speed  20.0  0  0  5
05D1: AS_actor -1 drive_car 1@ to  2431.7739 -1674.7444 13.6643 speed  20.0  0  0  5
05D1: AS_actor -1 drive_car 1@ to  2431.5864 -1628.0818 13.698 speed  20.0  2  0  5
0616: define_action_sequences_end 5@
0618: assign_actor 2@ to_action_sequences 5@
061B: remove_references_to_AS_pack 5@

////////////////////  the drive-to commands --^^----



:CarrecCamCarDrive_13
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @CarrecCamCarDrive_13

////////////////////  the the camera codes must run in a Loop --vv----
0407: create_coordinate 11@ 12@ 13@ from_car 0@ with_offset 0.0 0.0 1.5
015F: set_camera_position 11@ 12@ 13@ rotation 0.0 0.0 0.0
0407: create_coordinate 14@ 15@ 16@ from_car 1@ with_offset 0.0 0.0 1.0
0160: set_camera_point_at 14@ 15@ 16@ mode 2
////////////////////  the the camera codes must run in a Loop --vv----

if  or
00E1:     key_pressed  0  15//Enter/Exit
0119:     car 0@ wrecked
0119:     car 1@ wrecked
01F4:     car 1@ flipped
8202:   not actor $PLAYER_ACTOR near_car 1@ radius 500.0 500.0 flag 0
004D: jump_if_false @CarrecCamCarDrive_13

:CarrecCamCarDrive_50
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @CarrecCamCarDrive_50
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
05EC: release_car 0@ from_path
0873: release_path 8@
01C3: remove_references_to_car 0@ // Like turning a car into any random car
01C3: remove_references_to_car 1@  // Like turning a car into any random car
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 3@ // Like turning an actor into a random pedestrian
0164: disable_marker 4@
0249: release_model #INFERNUS
0249: release_model #fam1
0249: release_model #fam2
0249: release_model #NRG500
0001: wait 1000 ms
0002: jump @CarrecCamCarDrive_2




This post has been edited by ZAZ on Thursday, Sep 3 2009, 19:57
Users WebsitePM
  Top
 

 
Chuka  
Posted: Friday, Sep 11 2009, 15:57
Quote Post


3&7'
Group Icon
Group: Members
Joined: Apr 8, 2009

ve.gif

XXXXX



ZAZ!! in Spanish! please!! inlove.gif
Users WebsitePM
  Top
 

 
ZAZ  
Posted: Friday, Sep 11 2009, 17:03
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (Chuka @ Sep 11 2009, 15:57)
ZAZ!! in Spanish! please!!  inlove.gif

try google translation, but don't use the translated scripts tounge2.gif
Users WebsitePM
  Top
 

 

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)

0 Members:

Pages: (31) 1 [2] 3 4 ... Last »

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG