Quantcast

Jump to content

» «
Photo

[GTA SA] ~ CLEO Script Tutorial ~

631 replies to this topic
ICy92
  • ICy92

    Player Hater

  • Members
  • Joined: 01 May 2009

#61

Posted 07 November 2009 - 07:01 PM

Hey ZAZ thanks for the Camera on carrec path tutorial
its a good idea but the camera angle its stucking... if you know what i mean confused.gif
Is there a way to move the camera angle from A to B? cuz its looking only in a way...

ICy92
  • ICy92

    Player Hater

  • Members
  • Joined: 01 May 2009

#62

Posted 07 November 2009 - 10:32 PM Edited by ICy92, 07 November 2009 - 10:36 PM.

Ok i got it its pretty easy wink.gif

/e1:sry for double post inlove.gif

edit 2: ahrrgg hmm its amazing how it looks but i can see the Nrg where the camera is placed how to make it invisible or something like that dontgetit.gif

serabella
  • serabella

    Noob scripter

  • Members
  • Joined: 18 Jun 2009

#63

Posted 19 January 2010 - 06:26 PM

thanks for the tut, Zaz cookie.gif cookie.gif I have a question, is it possible to make a script which changes my criminal rating by pressing a certain button? Like,, click key 0 to get "king of san andreas" criminal rating tounge.gif tounge.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#64

Posted 20 January 2010 - 04:22 PM

QUOTE (serabella @ Jan 19 2010, 18:26)
thanks for the tut, Zaz cookie.gif cookie.gif I have a question, is it possible to make a script which changes my criminal rating by pressing a certain button? Like,, click key 0 to get "king of san andreas" criminal rating tounge.gif tounge.gif

search with opcode search tool for integer_stat
look also in Sanny Builder Help: GTA SA Statistics ID

integer_stat 152 = Criminals killed on Vigilante Mission

/!\ErManu/!\
  • /!\ErManu/!\

    /!\Custom Cars/!\

  • Members
  • Joined: 25 Jun 2008

#65

Posted 05 February 2010 - 01:55 PM Edited by /!\ErManu/!\, 07 February 2010 - 05:36 PM.

Edit for me for not providing the wished information to me wink.gif

Thanks for tutorials icon14.gif

mode656
  • mode656

    knows the truth

  • Members
  • Joined: 10 Feb 2010

#66

Posted 11 February 2010 - 01:35 AM

the sannybuilder site does not work for me any help :S

ZAZ
  • ZAZ

    Kernlochbohrer

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

#67

Posted 11 February 2010 - 09:58 PM

QUOTE (mode656 @ Feb 11 2010, 01:35)
the sannybuilder site does not work for me any help :S

sannybuilder.com is back
from time to time the provider makes overhaul for a few days

Darkkeness
  • Darkkeness

    The dark is come

  • Members
  • Joined: 31 May 2009

#68

Posted 12 February 2010 - 04:00 AM

Hey Zaz, is possible make a blood splatter effect on the screen for gta sa? i mean cleo

ZAZ
  • ZAZ

    Kernlochbohrer

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

#69

Posted 12 February 2010 - 01:18 PM

QUOTE (Darkkeness @ Feb 12 2010, 04:00)
Hey Zaz, is possible make a blood splatter effect on the screen for gta sa? i mean cleo

Maybe. It needs texturs which looks like having splatter on the screen.

bmb
  • bmb

    "Lots of ideas trying to learn the skills"

  • Members
  • Joined: 02 Feb 2010

#70

Posted 27 March 2010 - 05:39 PM

Great tutorial.

Looking at other Cleo scripts I sometimes run across a code like "00E1: player 0 pressed_key 4" . Key 4 is not in the Virtual key codes in the help file.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#71

Posted 28 March 2010 - 06:37 PM

QUOTE (bmb @ Mar 27 2010, 17:39)
Great tutorial.

Looking at other Cleo scripts I sometimes run across a code like  "00E1:  player 0 pressed_key 4" . Key 4 is not in the Virtual key codes in the help file.

opcode 00E1: is R*originally opcode for key_press and can be changed in options>controle config
they are definded as controle functions, find it in Sanny Builder Help: SCM Documentation: GTA SA:Keypress numbers

Virtual keycodes can only be used with cleo opcode 0AB0:
CODE
0AB0:    key_pressed 8

look for cleo opcodes in Sanny Builder Help: CLEO 3 Code Library: CLEO 3: opcodes

bmb
  • bmb

    "Lots of ideas trying to learn the skills"

  • Members
  • Joined: 02 Feb 2010

#72

Posted 29 March 2010 - 06:11 AM

Thanks ZAZ, didn't realize the opcodes were different. Paying more attention to the to the rest of the code. Right now just trying the basics like switching key_pressed so they don't use the same keys as other Cleo scripts.

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#73

Posted 16 May 2010 - 03:48 AM

QUOTE (ZAZ @ May 17 2009, 19:07)
Ups, visitors. Thx friends.
QUOTE (noelgamo @ May 15 2009, 07:55)

uhm how to make savepoints? cause I dont think I seen one from the tut. but if there is can you tell me wich bit is it.sorry for being a noob. smile.gif   smile.gif

Right, I forgot it.
Here it is:
The classic savescript with savedisk_pickup needs to insert 3 coords points.
One for the savedisk_pickup
One for the spawnpoint beside the pickup
One for the radar marker(If the savedisk is in an interior the location of the radar marker can be very different to pickup)

The savepoint of the script below is in the Atrium of Los Santos/Commerce
CODE
{$CLEO .cs}
:SAVE_1
03A4: name_thread 'SAVE'
0A95: enable_thread_saving
0570: 1@ = create_asset_radar_marker_with_icon 35 at 1722.2682 -1647.6366 42.4687
018B: show_on_radar 1@ 2

:SAVE_2
0001: wait 0 ms
0213: 2@ = create_pickup 1277 type 3 at 1720.7397 -1645.6292 20.2267

:SAVE_5
0001: wait 0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @SAVE_5
00D6: if 0
0214: pickup 2@ picked_up
004D: jump_if_false @SAVE_5
0050: gosub @SAVE_14
0002: jump @SAVE_2

:SAVE_14
00D6: if  0
0038:   $ONMISSION ==  0  // integer values
004D: jump_if_false @SAVE_17
0004: $ONMISSION =  1  // integer values
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
0001: wait  350 ms
03D8: show_SAVE_screen

:SAVE_15
00D6: if  0
83D9:   NOT   save_done
004D: jump_if_false @SAVE_16
0001: wait  0 ms
0002: jump @SAVE_15

:SAVE_16
00A1: put_actor $PLAYER_ACTOR at 1724.3228 -1646.5193 20.2272
0173: set_actor $PLAYER_ACTOR z_angle_to 176.8
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
0004: $ONMISSION =  1  // integer values
0001: wait  350 ms
0004: $ONMISSION =  0  // integer values

:SAVE_17
0051: return


So much $ONMISSION = 0 and $ONMISSION = 1
Yes its nesssary. Otherwise the colored gangwar teritories will not be shown if a save was done while gangwar is activ.

And again the same script but in the kind of "decompilation without opcodes ":
CODE
{$CLEO .cs}
:SAVE_1
thread 'SAVE'
0A95: enable_thread_saving
0570: 1@ = create_asset_radar_marker_with_icon 35 at 1722.268 -1647.637 42.4687
018B: set_marker 1@ radar_mode 2

:SAVE_42
wait 0
2@ = Pickup.Create(1277, 3, 1720.74, -1645.629, 20.2267)

:SAVE_71
wait 0
if
  Player.Defined($PLAYER_CHAR)
else_jump @SAVE_71
if
  Pickup.Picked_up(2@)
else_jump @SAVE_71
gosub @SAVE_121
jump @SAVE_42

:SAVE_121
if
 $ONMISSION == 0
else_jump @SAVE_240
$ONMISSION = 1
Player.CanMove($PLAYER_CHAR) = False
wait 350
03D8: show_save_screen

:SAVE_160
if
83D9:   not save_done
else_jump @SAVE_184
wait 0
jump @SAVE_160

:SAVE_184
Actor.PutAt($PLAYER_ACTOR, 1724.323, -1646.519, 20.2272)
Actor.Angle($PLAYER_ACTOR) = 176.8
Player.CanMove($PLAYER_CHAR) = True
$ONMISSION = 1
wait 350
$ONMISSION = 0

:SAVE_240
return

This doesn't seem to work for me. i try to compile and it says not enough parameters, expected 5.

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#74

Posted 16 May 2010 - 08:13 AM

Are you sure? Because when I copy that code and compile it, I don't have any errors. Are you sure you copied it right?

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#75

Posted 16 May 2010 - 09:03 AM Edited by kal-el5676, 16 May 2010 - 09:06 AM.

Yeah, i'm real nooby when it comes to coding. All i had to do was take the coma's out of the coordinates. sigh.gif

Anyone know a good tutorial for armour and health pickups?

ZAZ
  • ZAZ

    Kernlochbohrer

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

#76

Posted 16 May 2010 - 02:17 PM

QUOTE (kal-el5676 @ May 16 2010, 09:03)
Yeah, i'm real nooby when it comes to coding. All i had to do was take the coma's out of the coordinates.  sigh.gif

Anyone know a good tutorial for armour and health pickups?

You made a failure by copy and paste

take the coma's out?

which commas do you mean?

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#77

Posted 16 May 2010 - 08:20 PM

Yeah i did. The comma's that the coords manager automatically puts in.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#78

Posted 23 May 2010 - 08:41 PM

QUOTE (kal-el5676 @ May 16 2010, 20:20)
Yeah i did. The comma's that the coords manager automatically puts in.

post your script or does it work now?

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#79

Posted 23 May 2010 - 09:15 PM

it works thanks! i was just being a moron.

bartuxx33
  • bartuxx33

    Player Hater

  • Members
  • Joined: 02 Jan 2010

#80

Posted 16 June 2010 - 07:21 PM

Hey nice but my need to enter to yhe enterior the point but i can't find the id for yellow arrow for interior can help me?
if you help me take this cookie.gif cookie.gif cookie.gif cookie.gif cookie.gif cookie.gif cookie.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#81

Posted 19 June 2010 - 03:39 PM Edited by ZAZ, 19 June 2010 - 04:59 PM.

QUOTE (bartuxx33 @ Jun 16 2010, 19:21)
Hey nice but my need to enter to yhe enterior the point but i can't find the id for yellow arrow for interior can help me?

You mean the entrance_marker
CODE
0A40: 1@ = create_entrance_marker_at 2493.9 -1670.8 14.5 color 6

to remove the entrance_marker:

0A41: destroy_entrance_marker 1@



But the yellow markers which we have in San Andreas to enter the interiors are not done with scm scripting
because they are hardcoded in connection with ENEX - IPL -entries
For example you will find in data\maps\LA\LAw.ipl following enex to enter the barber shop
CODE
enex
823.629, -1588.9, 12.5764, 0, 2, 2, 8, 822.629, -1590.4, 12.5784, -1297.58, 0, 4, "BARBER2", 0, 2, 0, 24

More informations at: [SA|DOC] IPL Definitions
To modify or add enex entries requires to start a new game otherwise you will get buggy interior accesses
Or use the GTASA SaveGame ENEX Updater tool


Nevertheless is it possible to make an interior teleport and create therefor an entrance_marker
like in script below
Go to Grovestreet to find the entrance_marker with teleport
CODE
{$CLEO .cs}
:Entrance_marker_1
03A4: name_thread 'ENTRMK'
0A95: enable_thread_saving
0A40: 1@ = create_entrance_marker_at 2493.9 -1670.8 14.5 color 6
0A40: 2@ = create_entrance_marker_at 2527.6 -1679.5 1016.5 color 6

:Entrance_marker_3
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Entrance_marker_3
if
00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2493.9 -1670.8 13.4 radius  2.0  2.0  2.0
004D: jump_if_false @Entrance_marker_5
016A: fade 0 time 1000
0001: wait 1000 ms
04E4: unknown_refresh_game_renderer_at  2535.8301 -1674.6753
03CB: set_camera  2535.8301 -1674.6753 1015.4986
00A1: put_actor $PLAYER_ACTOR at 2535.8301 -1674.6753 1015.4986
0860: link_actor $PLAYER_ACTOR to_interior 1
04BB: select_interior 1
0001: wait 500 ms
016A: fade 1 time 1000
0002: jump @Entrance_marker_3

:Entrance_marker_5
if
00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2527.6 -1679.5 1015.5 radius  2.0  2.0  2.0
004D: jump_if_false @Entrance_marker_3
016A: fade 0 time 1000
0001: wait 1000 ms
04E4: unknown_refresh_game_renderer_at  2494.5 -1679.2
03CB: set_camera  2494.5 -1679.2 13.4
00A1: put_actor $PLAYER_ACTOR at 2494.5 -1679.2 13.4
0860: link_actor $PLAYER_ACTOR to_interior 0
04BB: select_interior 0
0001: wait 500 ms
016A: fade 1 time 1000
0002: jump @Entrance_marker_3

bmb
  • bmb

    "Lots of ideas trying to learn the skills"

  • Members
  • Joined: 02 Feb 2010

#82

Posted 22 July 2010 - 02:49 PM

Zaz, is there any way to select what sign loads on the side of a vehicle? for example the rumpo spawns with random business signs on it or none at all. I changed one of the panels for a cleo I am trying to make and if possible load that graphic every time it spawns. Tried looking at opcode search under rumpo and sign but no luck.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#83

Posted 22 July 2010 - 03:49 PM Edited by ZAZ, 22 July 2010 - 04:14 PM.

QUOTE (bmb @ Jul 22 2010, 14:49)
Zaz, is there any way to select what sign loads on the side of a vehicle? for example the rumpo spawns with random business signs on it or none at all. I changed one of the panels for a cleo I am trying to make and if possible load that graphic every time it spawns. Tried looking at opcode search under rumpo and sign but no luck.

No, not in that kind.
There exist an opcode to choose a model varaition
CODE
0506: set_car_model #PICADOR next_variation 4 4 // first param is useless

you know, the truck trailers are coming in different variations


and in addition every car can have a paintjop if it is made from the modelauthor
CODE
06ED: set_car 1@ paintjob 0

Example:
make the texturing for the Infernus to allow additional textures as paintjop
the basic files would be:
infernus.dff
infernus.txd
the paintjop textures would be:
infernus1.txd = paintjob 0
infernus2.txd = paintjob 1
infernus3.txd = paintjob 2
infernus4.txd = paintjob 3
and so on



another way would be to attach a graffiti object
but it's not recomanded because it requires that the user have exactly that car model which must fit the positioning for the object
furthermore is the positioning an annoying work
script below spawns an BOXVILLE in SF north/west - Esplanade East - and attach the tag_azteca
CODE
{$CLEO .cs}
//1531, tag_azteca, tags_LAazteca, 50, 1048580
thread 'GRFV'

:GRFV_11
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @GRFV_11
if
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere -1558.284 1184.458 7.1875 radius 1.0 1.0 1.0 on_foot
jf @GRFV_11
Model.Load(#BOXVILLE)
Model.Load(1531)

:GRFV_89
wait 0
if and
  Model.Available(#BOXVILLE)
  Model.Available(1531)
jf @GRFV_89
0@ = Car.Create(#BOXVILLE, -1557.747, 1168.721, 7.1875)
Car.Angle(0@) = 90.0
1@ = Object.Create(1531, -1557.747, 1168.721, 7.1875)
Object.RemoveFromMissionCleanupList(1@)
0681: attach_object 1@ to_car 0@ with_offset 1.3 0.0 0.8 rotation 180.0 180.0 0.0
Model.Destroy(#BOXVILLE)
Model.Destroy(1531)

:GRFV_223
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @GRFV_223
if
80FF:   not actor $PLAYER_ACTOR sphere 0 in_sphere -1558.284 1184.458 7.1875 radius 2.0 2.0 2.0 on_foot
jf @GRFV_223
Car.RemoveReferences(0@)
jump @GRFV_11




bmb
  • bmb

    "Lots of ideas trying to learn the skills"

  • Members
  • Joined: 02 Feb 2010

#84

Posted 23 July 2010 - 03:40 PM

Thanks Zaz, you've been an enormous help with this CLEO Script Tutorial.

opcode 0506 looks interesting. The comment is kinda throwing me off though,
QUOTE
// first param is useless

Is that referring to the the first 4, and if so do I just leave it alone or if I wanted to change it would it be something like this:
CODE
0506: set_car_model #PICADOR next_variation 3 3 // first param is useless


opcode 06ED answered another question I had. Thanks.

The boxville script is a great idea, only problem is if you walk into the marker 2 or more times before driving off in it the tag floats in the air. mercie_blink.gif Is there a way to correct it?

In theory if I changed something like the bobo sign and put my texture on it, used its load # it should work right?

Unrelated question
Using your tutorials and other peoples Cleos as examples I was able to have Pulaski and Tenpeni randomly driving around SA in a copcarla and armed them with a colt and shotgun. The problem is they don't act like cops. I get a 1 star wanted level if I try to open the door but they get out and just stand there. Other cops in the area beat the crap out of me but they just watch.I tried using this code:
CODE
$COP2 = Actor.Create(COP, #SPECIAL02, 1@, 2@, 3@)

and this:
CODE
07DD: set_actor $COP2 temper_to 100 // see pedstats.dat

with no luck. But they definitely hate criminals though! lol.gif


ZAZ
  • ZAZ

    Kernlochbohrer

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

#85

Posted 24 July 2010 - 05:42 AM Edited by ZAZ, 24 July 2010 - 07:02 AM.

QUOTE (bmb @ Jul 23 2010, 15:40)
opcode 0506 looks interesting. The comment is kinda throwing me off though,
QUOTE
// first param is useless

Is that referring to the the first 4, and if so do I just leave it alone or if I wanted to change it would it be something like this:
CODE
0506: set_car_model #PICADOR next_variation 3 3 // first param is useless



the comment say, it doesn't matter which value the first param have, just work with the last param

QUOTE
The boxville script is a great idea, only problem is if you walk into the marker 2 or more times before driving off in it the tag floats in the air. mercie_blink.gif Is there a way to correct it?

You're right, the object won't be removed in that script
we need now to keep the spawned BOXVILLE in focus till player drives another vehicle or is going away and gets bigger distance
try the script below

QUOTE
The problem is they don't act like cops.

don't use global variables in cleo scripts like $COP2, it can cause bugs and crashes
only $PLAYER_ACTOR, $PLAYER_CHAR and $ONMISSION are valid
try
CODE
06E4: AS_actor 2@ attempt_to_bust_actor $PLAYER_ACTOR


Graffitionvehicle
the boxville can be spawned in more ways:
-press Tab and G to spawn infront of player
-drive a boxville
-go into red marker

then the code run in a loop to check conditions to cleanup the car and object handle and start the script again from beginning
the conditions are:
-is player driving another vehicle
-is player going away and gets bigger distance than 50.0
-press Tab and G when player is on foot
-is $ONMISSION activ when player is on foot
-is car wrecked
-is player dead or arrested


CODE
{$CLEO .cs}
:Graffitionvehicle//
03A4: name_thread 'GRFV'
//1531, tag_azteca, tags_LAazteca, 50, 1048580

:Grafonveh_1
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Grafonveh_1
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot -1558.2838 1184.4581 7.1875 radius  1.0  1.0  1.0
004D: jump_if_false @Grafonveh_2
11@ = -1557.7474
12@ = 1168.7213
13@ = 7.1875
14@ = 270.0
jump @Grafonveh_4

:Grafonveh_2
if  and
0AB0:   key_pressed 9// TAB
0AB0:   key_pressed 71//  G key
jf @Grafonveh_3
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0 5.5  0.3
0172: 14@ = actor $PLAYER_ACTOR z_angle
000B: 14@ +=  270.0  // floating-point values
jump @Grafonveh_4

:Grafonveh_3
if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #boxville
jf @Grafonveh_1
03C0: 0@ = actor $PLAYER_ACTOR car
11@ = -1557.7474
12@ = 1168.7213
13@ = 7.1875
14@ = 270.0

:Grafonveh_4
0247: request_model #boxville
0247: request_model 1531

:Grafonveh_5
0001: wait  0 ms
if  and
0248:   model #boxville available
0248:   model 1531 available
004D: jump_if_false @Grafonveh_5
if
80DD:   not actor $PLAYER_ACTOR driving_car_with_model #boxville
jf @Grafonveh_6
00A5: 0@ = create_car #boxville at 11@ 12@ 13@
0175: set_car 0@ z_angle_to 90.0

:Grafonveh_6
0107: 1@ = create_object 1531 at  11@ 12@ 180.0
//08D2: object 1@ scale_model  0.5
01C7: remove_object_from_mission_cleanup_list 1@
0681: attach_object 1@ to_car 0@ with_offset 1.3 0.0 0.8 rotation 180.0 180.0 0.0
0249: release_model #boxville
0249: release_model 1531
wait 1000

:Grafonveh_8
0001: wait 30 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Grafonveh_13
if
8119:  not car 0@ wrecked
004D: jump_if_false @Grafonveh_13
if
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false @Grafonveh_9
if
00DB:   actor $PLAYER_ACTOR in_car 0@
004D: jump_if_false @Grafonveh_13
0002: jump @Grafonveh_10

:Grafonveh_9
if  and
0038:   $ONMISSION ==  0  // integer values
0202:   actor $PLAYER_ACTOR near_car 0@ radius  50.0  50.0 unknown  0
004D: jump_if_false @Grafonveh_13
if  and
0AB0:   key_pressed 9// TAB
0AB0:   key_pressed 71//  G key
jf @Grafonveh_8
0002: jump @Grafonveh_13

:Grafonveh_10
0002: jump @Grafonveh_8


:Grafonveh_13
01C4: remove_references_to_object 1@
01C3: remove_references_to_car 0@ // Like turning a car into any random car
00BC: text_highpriority 'fem_off'  2000 ms  1
wait 1000
0002: jump @Grafonveh_1

Millinescence
  • Millinescence

    Eccentric Gamer-girl

  • Members
  • Joined: 13 Dec 2009

#86

Posted 24 July 2010 - 08:17 AM Edited by Millinescence, 25 July 2010 - 05:59 AM.

Nice tutorials, ZAZ. You're doing a great job ^^. I have a question though; I'm trying to make a mod where if the player gets into a pickup truck (bobcat, picador, saddler, etc.) with people that follow you (gang members and the like), that one of them will get into the bed of the truck in turret mode like Ryder from the 'Catalyst' mission. How would you go about doing that?

While searching through that mission in the .scm, I found this little bit of code:
CODE
:RYDER3_14356
if
not Actor.Dead($ACTOR_RYDER)
jf @RYDER3_14409
0465: remove_actor $ACTOR_RYDER from_turret_mode
0464: put_actor $ACTOR_RYDER into_turret_on_car 108@ at_car_offset 0.0 -1.3 0.8 position 2 shooting_angle_limit 15.0 with_weapon 28


EDIT:
Using your tutorials and the code snippet I found as a guide, I now have a test script that creates a GSF and puts him in the bed of a Picador once the player is in the vehicle.
CODE
{$CLEO .cs}

//-------------MAIN---------------
thread 'TRUKTUR'

:TRUKTUR_11
wait 0
if
  Player.Defined($PLAYER_CHAR)
else_jump @TRUKTUR_11
if
  Actor.DrivingVehicleType($PLAYER_ACTOR, #PICADOR)
else_jump @TRUKTUR_11
Model.Load(#FAM1)
Model.Load(#AK47)

:TRUKTUR_59
wait 0
if and
  Model.Available(#FAM1)
  Model.Available(#AK47)
else_jump @TRUKTUR_59
03C0: 1@ = actor $PLAYER_ACTOR car  
009A: 2@ = create_actor_pedtype 8 model #FAM1 at 0.0 0.0 0.0
01B2: give_actor 2@ weapon 30 ammo 99999 // Load the weapon model before using this
Actor.WeaponAccuracy(2@) = 100
Actor.Health(2@) = 1000
0464: put_actor 2@ into_turret_on_car 1@ at_car_offset 0.0 -1.3 0.8 position 2 shooting_angle_limit 30.0 with_weapon 30
Model.Destroy(#FAM1)

:TRUKTUR_170
wait 0
if
  not Actor.Dead(2@)
else_jump @TRUKTUR_216
if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #PICADOR
else_jump @TRUKTUR_216
jump @TRUKTUR_170

:TRUKTUR_216
Actor.RemoveReferences(2@)
jump @TRUKTUR_11

But what I really want to do is make it so that instead of a GSF that appears out of thin air, I want a GSF that you recruit off the street to be put into turret mode instead.
Can you please help? Thanks in advance. Take some cookies cookie.gif cookie.gif cookie.gif :3

ZAZ
  • ZAZ

    Kernlochbohrer

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

#87

Posted 25 July 2010 - 06:16 PM

QUOTE (Millinescence @ Jul 24 2010, 08:17)
I want a GSF that you recruit off the street to be put into turret mode instead.

the gangmembers won't do this job confused.gif
test the script below
recruit a homie and then enter a picador
CODE
{$CLEO .cs}

//-------------MAIN---------------
thread 'TRUKTUR'

:TRUKTUR_11
wait 0
if
 Player.Defined($PLAYER_CHAR)
else_jump @TRUKTUR_11
if
 Actor.DrivingVehicleType($PLAYER_ACTOR, #PICADOR)
else_jump @TRUKTUR_11
07AF: 5@ = player $PLAYER_CHAR group
092B: 2@ = group 5@ member 0
if
056D:   actor 2@ defined
004D: jump_if_false @TRUKTUR_12
if
8118:   not actor 2@ dead
004D: jump_if_false @TRUKTUR_12
jump @TRUKTUR_13

:TRUKTUR_12
wait 1000
jump @TRUKTUR_11

:TRUKTUR_13
Model.Load(#AK47)

:TRUKTUR_59
wait 0
if
 Model.Available(#AK47)
else_jump @TRUKTUR_59
03C0: 1@ = actor $PLAYER_ACTOR car
0687: clear_actor 2@ task
0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 2@ decision_maker_to 32
01B2: give_actor 2@ weapon 30 ammo 99999 // Load the weapon model before using this
Actor.WeaponAccuracy(2@) = 100
Actor.Health(2@) = 1000
wait 1000
0792: disembark_instantly_actor 2@
0464: put_actor 2@ into_turret_on_car 1@ at_car_offset 0.0 -1.3 0.8 position 2 shooting_angle_limit 360.0 with_weapon 30
077A: set_actor 2@ acquaintance 1 to_actors_pedtype 7 // see ped.dat
077A: set_actor 2@ acquaintance 4 to_actors_pedtype 7 // see ped.dat
077A: set_actor 2@ acquaintance 1 to_actors_pedtype 6 // see ped.dat
077A: set_actor 2@ acquaintance 4 to_actors_pedtype 6 // see ped.dat

:TRUKTUR_170
wait 0
if
 Player.Defined($PLAYER_CHAR)
else_jump @TRUKTUR_216
if  and
 not Car.Wrecked(1@)
 not Actor.Dead(2@)
else_jump @TRUKTUR_216
if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #PICADOR
else_jump @TRUKTUR_216
jump @TRUKTUR_170

:TRUKTUR_216
0465: remove_actor 2@ from_turret_mode
Actor.RemoveReferences(2@)
0632: release_group 5@
jump @TRUKTUR_11

Millinescence
  • Millinescence

    Eccentric Gamer-girl

  • Members
  • Joined: 13 Dec 2009

#88

Posted 25 July 2010 - 09:58 PM Edited by Millinescence, 25 July 2010 - 10:14 PM.

QUOTE (ZAZ @ Jul 25 2010, 13:16)
QUOTE (Millinescence @ Jul 24 2010, 08:17)
I want a GSF that you recruit off the street to be put into turret mode instead.

the gangmembers won't do this job confused.gif

That is so weird...once the first homie gets into turret mode, the second one becomes confused as to where to get into the truck when the passenger seat is wide open for them. And when I get out of the truck, they disband dontgetit.gif

I'm also using the Gunslinger Girl CLEO, so I called them up and tried to see if they would get in the truck with me. Triela (blond hair) got into turret mode and Henrietta (brown hair) was confused at first like the homie, but I get out and get back in and then Henrietta managed to get into the passenger seat with me.
EDIT: So then I approach some Ballas in the Picador with the two girls to see what they'll do. Henrietta gets out the truck and shoots them while Triella just watches. dozingoff.gif

I noticed that you also cleared the homie's task (whatever that means) and changed his decision marker. Do you think that might be why?

ZAZ
  • ZAZ

    Kernlochbohrer

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

#89

Posted 26 July 2010 - 03:50 PM

QUOTE (Millinescence @ Jul 25 2010, 21:58)
QUOTE (ZAZ @ Jul 25 2010, 13:16)
QUOTE (Millinescence @ Jul 24 2010, 08:17)
I want a GSF that you recruit off the street to be put into turret mode instead.

the gangmembers won't do this job confused.gif


I noticed that you also cleared the homie's task (whatever that means) and changed his decision marker. Do you think that might be why?

I tried a lot to get them working
try yourself, remove the codes before put_in_turret, make commentslashes infront, play around
CODE
//0687: clear_actor 2@ task
//0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1
//060B: set_actor 2@ decision_maker_to 32  <<<stops the ped-presettings
01B2: give_actor 2@ weapon 30 ammo 99999 // Load the weapon model before using this
//Actor.WeaponAccuracy(2@) = 100
//Actor.Health(2@) = 1000
//wait 1000
//0792: disembark_instantly_actor 2@
0464: put_actor 2@ into_turret_on_car 1@ at_car_offset 0.0 -1.3 0.8 position 2 shooting_angle_limit 360.0 with_weapon 30
//077A: set_actor 2@ acquaintance 1 to_actors_pedtype 7 // see ped.dat
//077A: set_actor 2@ acquaintance 4 to_actors_pedtype 7 // see ped.dat
//077A: set_actor 2@ acquaintance 1 to_actors_pedtype 6 // see ped.dat
//077A: set_actor 2@ acquaintance 4 to_actors_pedtype 6 // see ped.dat

bmb
  • bmb

    "Lots of ideas trying to learn the skills"

  • Members
  • Joined: 02 Feb 2010

#90

Posted 27 July 2010 - 04:34 AM

Ok Zaz I need you expertise again.

First off sorry about the global variables, I was just messing around with another cleo script to see if it would work. I have made my script without them.

your code:
CODE
06E4: AS_actor 2@ attempt_to_bust_actor $PLAYER_ACTOR

works but as I suspected there already out of the car shooting at me before I get anywhere near them.

I tried doing this:
CODE
:GANG_TASK_UNIT_585
if or
Player.WantedLevel($PLAYER_CHAR) = 1
Player.WantedLevel($PLAYER_CHAR) = 2
Player.WantedLevel($PLAYER_CHAR) = 3
Player.WantedLevel($PLAYER_CHAR) = 4
Player.WantedLevel($PLAYER_CHAR) = 5
else_jump @GANG_TASK_UNIT_585  
06E4: AS_actor 7@ attempt_to_bust_actor $PLAYER_ACTOR  
06E4: AS_actor 8@ attempt_to_bust_actor $PLAYER_ACTOR


Game crashes

tried changing above to
CODE
Player.WantedLevel($PLAYER_CHAR) > 0


Game crashes

gave up on that for now and tried this
CODE
if  
8202:   not actor $PLAYER_ACTOR near_car 5@ radius 100.0 100.0 flag 0  
else_jump @GANG_TASK_UNIT_585  
wait 5000  
if  
8202:   not actor $PLAYER_ACTOR near_car 5@ radius 100.0 100.0 flag 0  
else_jump @GANG_TASK_UNIT_585  
Actor.DestroyWithFade(7@)
Actor.DestroyWithFade(8@)
Actor.DestroyWithFade(9@)
Car.Destroy(5@)
jump @GANG_TASK_UNIT_19


Game crashes

This is the part of my script that works
CODE
{$CLEO .cs}
//-------------MAIN---------------
thread 'GANG_TASK_UNIT'  

:GANG_TASK_UNIT_19
wait 0  
if     Player.Defined($PLAYER_CHAR)
else_jump @GANG_TASK_UNIT_19  
if  
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 1555.0 -1520.0 100.0 radius 1275.0 800.0 1000.0  
else_jump @GANG_TASK_UNIT_19  
073E: get_car_in_sphere 1555.0 -1520.0 100.0 radius 400.0 model -1 handle_as 0@  
if    
not 0@ == -1  
else_jump @GANG_TASK_UNIT_19  
if  
8202:   not actor $PLAYER_ACTOR near_car 0@ radius 100.0 100.0 flag 0  
else_jump @GANG_TASK_UNIT_19  
0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 0.0 0.0  
4@ = Car.Angle(0@)
023C: load_special_actor 'TENPEN' as 1 // models 290-299  
023C: load_special_actor 'PULASKI' as 2 // models 290-299  
Model.Load(#COPCARLA)
Model.Load(#DESERT_EAGLE)
Model.Load(#SHOTGSPA)
Model.Load(#BALLAS3)
06E9: load_car_component #WHEEL_GN3  
038B: load_requested_models  
wait 0  
if and
023D:   special_actor 1 loaded  
023D:   special_actor 2 loaded    
Model.Available(#COPCARLA)    
Model.Available(#DESERT_EAGLE)    
Model.Available(#SHOTGSPA)    
Model.Available(#BALLAS3)
else_jump @GANG_TASK_UNIT_19  
Car.Destroy(0@)
5@ = Car.Create(#COPCARLA, 1@, 2@, 3@)
06E7: 6@ = add_car_component #WHEEL_GN3 to_car 5@  
0229: set_car 5@ primary_color_to 0 secondary_color_to 1  
Car.SetMaxSpeed(5@, 20.0)
Car.Angle(5@) = 4@
Car.Health(5@) = 1000
Car.SetToNormalDriver(5@)
Car.SetDriverBehaviour(5@, FollowRoad)
7@ = Actor.Create(Cop, #SPECIAL01, 1@, 2@, 3@)
8@ = Actor.Create(Cop, #SPECIAL02, 1@, 2@, 3@)
9@ = Actor.Create(gang1, #BALLAS3, 1@, 2@, 3@)
01B2: give_actor 7@ weapon 27 ammo 9999 // Load the weapon model before using this  01B9: set_actor 7@ armed_weapon_to 27  01B2: give_actor 8@ weapon 24 ammo 9999 // Load the weapon model before using this  01B9: set_actor 8@ armed_weapon_to 24  081A: set_actor 7@ weapon_skill_to 1  
Actor.WeaponAccuracy(7@) = 95
081A: set_actor 8@ weapon_skill_to 1  
Actor.WeaponAccuracy(8@) = 95
087E: set_actor 7@ weapon_droppable 1  
087E: set_actor 8@ weapon_droppable 1  
07DD: set_actor 7@ temper_to 100 // see pedstats.dat  
07DD: set_actor 8@ temper_to 100 // see pedstats.dat  
0245: set_actor 7@ walk_style_to "SWAT"  
0245: set_actor 8@ walk_style_to "SWAT"  
0245: set_actor 9@ walk_style_to "GANG1"  
072A: put_actor 8@ into_car 5@ driverseat  
0430: put_actor 7@ into_car 5@ passenger_seat 0  
0430: put_actor 9@ into_car 5@ passenger_seat 1  
03FE: set_actor 7@ money 2491  
0249: release_model #SPECIAL01
0249: release_model #SPECIAL01
0249: release_model #BALLAS3


that all works, anything I put after it crashes the game. I don't know if its in the code above or I just Know enough yet. Probably both smile.gif





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users