Jump to content

[SA] ~ CLEO Script Tutorial ~


ZAZ

Recommended Posts

 

04C4: create_coordinate 25@ 26@ 28@ from_actor 0@ offset 0.0 0.0  1.2095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 1.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 3.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 5.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red

 

 

 

I still don't get it dontgetit.gif ! Can you make a example , a scrip can make all ped dead (like blow up all car cheat ) biggrin.gif plz

first tell me to which template belongs your question "when I wanna affect to some ped , I use some opcode like "0321: kill_actor 0@" , "0332: set_actor 0@ bleeding 1" ,..."

and post your current script

Link to comment
Share on other sites

123iamking

 

 

04C4: create_coordinate 25@ 26@ 28@ from_actor 0@ offset 0.0 0.0  1.2095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 1.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 3.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 5.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red

 

 

 

I still don't get it dontgetit.gif ! Can you make a example , a scrip can make all ped dead (like blow up all car cheat ) biggrin.gif plz

first tell me to which template belongs your question "when I wanna affect to some ped , I use some opcode like "0321: kill_actor 0@" , "0332: set_actor 0@ bleeding 1" ,..."

and post your current script

 

:await 0if Player.Defined($PLAYER_CHAR)jf @aif and0AB0: key_pressed 90AB0: key_pressed 76jf @await 00@ = -104C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0//073F: get_actor_in_sphere 1@ 2@ 3@ radius 50.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as 0@08E5: get_actor_in_sphere 1@ 2@ 3@ radius 50.0 handle_as 0@if not 0@ == -1jf @a04ED: load_animation "BSKTBALL" if80DF:   NOT actor $PLAYER_ACTOR drivingjf @c :bwait 0if04EE:   animation "BSKTBALL" loadedjf @b      0639: AS_actor $PLAYER_ACTOR rotate_to_actor 0@0605: actor $PLAYER_ACTOR perform_animation_sequence "BBALL_DEF_LOOP" IFP_file "BSKTBALL" 4.0 loop 0 0 0 0 time 2000 // versionA4@ = Marker.CreateAboveActor(0@) wait 2000:cwait 0if0AB0: key_pressed 76jf @c083C: set_actor 0@ velocity_in_direction_XYZ 0.0 0.0 25.0wait 2000:dwait 0 if0118:   actor 0@ deadjf @cMarker.Disable(4@)Actor.RemoveReferences(0@)04EF: release_animation "BSKTBALL"jump @a 

 

 

 

this is my current mod , and instead of levitating ONE person , I wanna levitate ALL people I can see sly.gif

Edited by 123iamking
Link to comment
Share on other sites

 

this is my current mod , and instead of levitating ONE person , I wanna levitate ALL people I can see  sly.gif

It needs to shift the actors in arrays

 

{$CLEO .cs}:123iamking03A4: name_thread 'A':await 0ifPlayer.Defined($PLAYER_CHAR)jf @aif and0AB0: key_pressed 9//  tab key0AB0: key_pressed 76//  l keyjf @a0006: 0@ = -10006: 1@ = -10006: 2@ = -10006: 3@ = -10006: 4@ = -10006: 5@ = -10006: 6@ = -10006: 7@ = -10006: 8@ = -10006: 9@ = -10006: 10@ = -10006: 11@ = -10006: 12@ = -10006: 13@ = -10006: 28@ = 0:a_1wait 0ifPlayer.Defined($PLAYER_CHAR)jf @l03F0: enable_text_draw 1045A: draw_text_1number 100.0 50.0 GXT 'NUMBER' number 28@  // ~1~if12 > 28@jf @a_304C4: store_coords_to 29@ 30@ 31@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 08E5: get_actor_in_sphere 29@ 30@ 31@ radius 50.0 handle_as 0@(28@,16i)wait 50ifnot 0@(28@,16i) == -1jf @a_114@(28@,16i) = Marker.CreateAboveActor(0@(28@,16i))28@ += 1jump @a_1:a_328@ = 004ED: load_animation "BSKTBALL":bwait 0if04EE:   animation "BSKTBALL" loadedjf @b     0639: AS_actor $PLAYER_ACTOR rotate_to_actor 0@(28@,16i)wait 10000605: actor $PLAYER_ACTOR perform_animation_sequence "BBALL_DEF_LOOP" IFP_file "BSKTBALL" 4.0 loop 0 0 0 0 time 2000 // versionA:cwait 0ifPlayer.Defined($PLAYER_CHAR)jf @j03F0: enable_text_draw 1045A: draw_text_1number 100.0 100.0 GXT 'NUMBER' number 28@  // ~1~if12 > 28@jf @fif   not 0@(28@,16i) == -1 jf @eif8118: not actor 0@(28@,16i) deadjf @d04C4: create_coordinate 29@ 30@ 31@ from_actor 0@(28@,16i) offset 0.0 0.0  1.2095C: create_smoke_at 29@ 30@ 31@ velocity 0.0 0.0 1.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red095C: create_smoke_at 29@ 30@ 31@ velocity 0.0 0.0 3.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red095C: create_smoke_at 29@ 30@ 31@ velocity 0.0 0.0 5.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//redjump @e:dActor.RemoveReferences(0@(28@,16i))Marker.Disable(14@(28@,16i))0@(28@,16i) = -1:e28@ += 1if0AB0: key_pressed 76//  l keyjf @cjump @h:f28@ = 0jump @c:gwait 0ifPlayer.Defined($PLAYER_CHAR)jf @j03F0: enable_text_draw 1045A: draw_text_1number 100.0 150.0 GXT 'NUMBER' number 28@  // ~1~if12 > 28@jf @Jif   not 0@(28@,16i) == -1 jf @hif8118: not actor 0@(28@,16i) deadjf @hif8449: not  actor 0@(28@,16i) in_a_carjf @h083C: set_actor 0@(28@,16i) velocity_in_direction_XYZ 0.0 0.0 25.0wait 0083C: set_actor 0@(28@,16i) velocity_in_direction_XYZ 0.0 0.0 25.0:h28@ += 1jump @g:jwait 25004EF: release_animation "BSKTBALL":l28@ = 0 :mwait 003F0: enable_text_draw 1045A: draw_text_1number 100.0 200.0 GXT 'NUMBER' number 28@  // ~1~ if 12 > 28@ jf @aif   not 0@(28@,16i) == -1 jf @n  Marker.Disable(14@(28@,16i))Actor.RemoveReferences(0@(28@,16i)) :n28@ += 1 jump @m

 

Link to comment
Share on other sites

geiv.tomco

Hello! How can I get the handle of an actor who is attacking the player?

Link to comment
Share on other sites

Read dword from $PLAYER_ACTOR's CPed +0x764, and then convert it to handle (it's a struct). It should do the trick.

Link to comment
Share on other sites

geiv.tomco
Read dword from $PLAYER_ACTOR's CPed +0x764, and then convert it to handle (it's a struct). It should do the trick.

thanks smile.gif That worked smile.gif

Link to comment
Share on other sites

Attach_particle "" to actor bone

The supportive opcode 0883: changes the attachment of opcode 0669: from actor center to a bone

ceedj figured out the bone values and made a list

 

066A: 0@ = attach_particle "flamethrower" to_actor $PLAYER_ACTOR with_offset 0.0  0.0  0.0 rotation 0.0  13.0  0.0 flag 1  0883: attach_particle 0@ to_actor $PLAYER_ACTOR mode <?>Attach Particle To Actor Flag:0 - Root 11 - Root 22 - Spine 13 - Spine 24 - Neck5 - Head6 - Head 27 - Head 38 - Head 4 (2,3, 4 - eyes or brow maybe?)21 - Chest Area22 - Right Shoulder23 - Right Elbow24 - Right Wrist25 - Right Hand26 - Right Hand/Finger?31 - Chest Area32 - Left Shoulder33 - Left Elbow34 - Left Wrist35 - Left Hand36 - Left Hand/Finger?41 - Left Hip42 - Left Knee43 - Left Heel44 - Left Foot51 - Right Hip52 - Right Knee53 - Right Heel54 - Right Foot

 

 

opcode 066A: supports rotation parameter which allows to give the particle a direction

This requires an effect which moves in a direction like the "flamethrower"

Attached to bones show the particles moving in different direction

because the bones have different oriention of it's x,y,z-axis in relation to the actor center

Watch to the results by using the testscript below

The flamethrower moves allways to offset 13.0 of Y direction of the bone

The script starts with 0 - Root 1 and add 1 after key_press for the bone value till 60

 

 

{$CLEO .cs}:Flamethrower_at_Actor_bone03A4: name_thread 'FLAMEPB'1@ = 0:FLAMEPB_010001: wait  0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @FLAMEPB_01if0AB0:   key_pressed 8//-----------------------press Backspace004D: jump_if_false @FLAMEPB_01066A: 0@ = attach_particle "flamethrower" to_actor $PLAYER_ACTOR with_offset 0.0  0.0  0.0 rotation 0.0  13.0  0.0 flag 1  0883: attach_particle 0@ to_actor $PLAYER_ACTOR mode 1@064C: make_particle 0@ visible0001: wait  1000 ms:FLAMEPB_030001: wait  0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @FLAMEPB_0303F0: enable_text_draw 1045A: text_draw_1number  250.0  80.0 'NUMBER' 1@    // valueif0AB0:   key_pressed 8//-----------------------press Backspace004D: jump_if_false @FLAMEPB_030976: destroy_particle 0@  0001: wait  500 ms1@ += 1if1@ > 60004D: jump_if_false @FLAMEPB_011@ = 00002: jump @FLAMEPB_01

 

Link to comment
Share on other sites

  • 3 weeks later...

This is really confusing, can somebody explain something to me?

 

What exactly are these things and how do people find out what they do? Is there a list somewhere? I'm sure im missing something!

 

(04E4: unknown_refresh_game_renderer_at 1126.3 -2037.1)

 

I mean how am I supposed to know what that does? Its not just that its everything!

Link to comment
Share on other sites

At first, it isn't unknown since ages. Update your sascm.ini from GTAG Opcode Database.

Link to comment
Share on other sites

pringston2010
Good job! thanks for tutorial need a tutorial for make a cleo teleport in spheres.

 

Hi , again... need a codding with me scm how to make with start my sa with the mpack in the screen view a text

Good job! thanks for tutorial need a tutorial for make a cleo teleport in spheres.

 

Hi , again... need a codding with me scm how to make with start my sa with the mpack in the screen view a text

Link to comment
Share on other sites

 

This is really confusing, can somebody explain something to me?

 

What exactly are these things and how do people find out what they do? Is there a list somewhere? I'm sure im missing something!

 

(04E4: unknown_refresh_game_renderer_at 1126.3 -2037.1)

 

I mean how am I supposed to know what that does? Its not just that its everything!

 

 

Good job! thanks for tutorial need a tutorial for make a cleo teleport in spheres.

Hi , again... need a codding with me scm how to make with start my sa with the mpack in the screen view a text

 

It's hard to understand for beginners because their are a lot of codes.

Newbies need praxis by writing tiny simple scripts.

They should read and understand the first chapter of this tutorial.

Also important is to learn for yourself how to find informations in forum topics, with Google, in main.scm, in Sannybuilder HELP, etc....

 

If you search for any code which you need for your idea

then think about when it happens in SA Story and

then look in main.scm for examples of opcodes or methods

 

Fourthermore can you find all opcodes in sascm.ini but in ini-format

sascm.ini is the file which use sannybuilder for (de)compilation,

to translate codes in codelines with description.

Find sascm.ini in Sannybuilder install dir\data\sa\sascm.ini

Find links for more opcode-databases at the end of this tutorial INDEX

 

 

jaky2008 @:

 

04E4: unknown_refresh_game_renderer_at 1126.3 -2037.1

 

supports the game rendering by player location change

the opcode description means, it's unknown because it's not really shure what it does

This opcode is used in the start codes of main.scm as well in scripts to teleport player into interior

Teleport into interior

 

 

pringston2010 @:

Dutchy3010 made a detailed descritiption of the text-opcodes in her generell mission coding tut

You can use GXT entries of american.gxt as well of any-custom.fxt in the script.

Read here about Create a FXT file to show your own text message

 

 

Edited by ZAZ
Link to comment
Share on other sites

pringston2010
This is really confusing, can somebody explain something to me?

 

What exactly are these things and how do people find out what they do? Is there a list somewhere? I'm sure im missing something!

 

(04E4: unknown_refresh_game_renderer_at 1126.3 -2037.1)

 

I mean how am I supposed to know what that does? Its not just that its everything!

 

 

Good job! thanks for tutorial need a tutorial for make a cleo teleport in spheres.

Hi , again... need a codding with me scm how to make with start my sa with the mpack in the screen view a text

 

It's hard to understand for beginners because their are a lot of codes.

Newbies need praxis by writing tiny simple scripts.

They should read and understand the first chapter of this tutorial.

Also important is to learn for yourself how to find informations in forum topics, with Google, in main.scm, in Sannybuilder HELP, etc....

 

If you search for any code which you need for your idea

then think about when it happens in SA Story and

then look in main.scm for examples of opcodes or methods

 

Fourthermore can you find all opcodes in sascm.ini but in ini-format

sascm.ini is the file which use sannybuilder for (de)compilation,

to translate codes in codelines with description.

Find sascm.ini in Sannybuilder install dir\data\sa\sascm.ini

Find links for more opcode-databases at the end of this tutorial INDEX

 

 

jaky2008 @:

 

04E4: unknown_refresh_game_renderer_at 1126.3 -2037.1

 

supports the game rendering by player location change

the opcode description means, it's unknown because it's not really shure what it does

This opcode is used in the start codes of main.scm as well in scripts to teleport player into interior

Teleport into interior

 

 

pringston2010 @:

Dutchy3010 made a detailed descritiption of the text-opcodes in her generell mission coding tut

You can use GXT entries of american.gxt as well of any-custom.fxt in the script.

Read here about Create a FXT file to show your own text message

Yes i view the topic of dutchi3010

 

and no comprend.

 

need a with gxt editor open and open me american.gxt and create entry.

 

and later edit this line

 

00BC: show_text_highpriority GXT 'MTIME3' time 3000 flag 1

 

With ej

 

00BC: show_text_highpriority GXT 'CARL_JONHSON' time 3000 flag 1

 

Need a entry in a gxt editor?

Link to comment
Share on other sites

 

This is really confusing, can somebody explain something to me?

 

What exactly are these things and how do people find out what they do? Is there a list somewhere? I'm sure im missing something!

 

(04E4: unknown_refresh_game_renderer_at 1126.3 -2037.1)

 

I mean how am I supposed to know what that does? Its not just that its everything!

 

 

Good job! thanks for tutorial need a tutorial for make a cleo teleport in spheres.

Hi , again... need a codding with me scm how to make with start my sa with the mpack in the screen view a text

 

It's hard to understand for beginners because their are a lot of codes.

Newbies need praxis by writing tiny simple scripts.

They should read and understand the first chapter of this tutorial.

Also important is to learn for yourself how to find informations in forum topics, with Google, in main.scm, in Sannybuilder HELP, etc....

 

If you search for any code which you need for your idea

then think about when it happens in SA Story and

then look in main.scm for examples of opcodes or methods

 

Fourthermore can you find all opcodes in sascm.ini but in ini-format

sascm.ini is the file which use sannybuilder for (de)compilation,

to translate codes in codelines with description.

Find sascm.ini in Sannybuilder install dir\data\sa\sascm.ini

Find links for more opcode-databases at the end of this tutorial INDEX

 

 

jaky2008 @:

 

04E4: unknown_refresh_game_renderer_at 1126.3 -2037.1

 

supports the game rendering by player location change

the opcode description means, it's unknown because it's not really shure what it does

This opcode is used in the start codes of main.scm as well in scripts to teleport player into interior

Teleport into interior

 

 

pringston2010 @:

Dutchy3010 made a detailed descritiption of the text-opcodes in her generell mission coding tut

You can use GXT entries of american.gxt as well of any-custom.fxt in the script.

Read here about Create a FXT file to show your own text message

Yes i view the topic of dutchi3010

 

and no comprend.

 

need a with gxt editor open and open me american.gxt and create entry.

 

and later edit this line

 

00BC: show_text_highpriority GXT 'MTIME3' time 3000 flag 1

 

With ej

 

00BC: show_text_highpriority GXT 'CARL_JONHSON' time 3000 flag 1

 

Need a entry in a gxt editor?

You should read and not overfly!

I also gave a link to "Create a FXT file" and i wrote that a gxt- entry can have max. 7 charackters.

 

Ok, i try it again.

 

GXT file

The scripts use gxt entries to show text

The american.gxt have several chapters and includes gxt entries as well as the text which should be shown.

The german.gxt have also chapters and includes the same gxt entries as well as german text to show

 

The gxt files are not textbased, it needs to decompile, hack or translate the content

Use a gxt editor to edit the content of gxt files

 

GXT Editor

download and install X GXT Editor made by xmen

then open american.gxt

It shows 2 windows

The first window shows the overview of the chapters. We call the chapters tables.

 

GXT Content

The first table is the main table which includes the general messages

The other tables are mission tables which include the mission messages

 

click on the main table to view the general gxt entries and the textmessages

sort the the content of the second window by names

use search funktion and search for VO_AF, select Option: Item's name

You should find this line:

 

VO_AF   ~z~Grove Street - Home.

 

Use the gxt entry VO_AF to show the textmessage "Grove Street - Home."

try the script below

 

{$CLEO .cs}:DEMOTEXT03A4: name_thread "DEMO":DEMOTEXT_1wait 0if0256:   player $PLAYER_CHAR defined 004D: jump_if_false @DEMOTEXT_100BA: text_styled 'VO_AF'  30000 ms  10A93: end_custom_thread

 

 

Mission Tables

Click on the table "CAT" to view the gxt entries and the textmessages of Catalina missions

At this time it needs to give the mission table name to show a text with this code: 054C: use_GXT_table 'CAT'

try the script below

 

{$CLEO .cs}:DEMOTEXT03A4: name_thread "DEMO":DEMOTEXT_1wait 0if0256:   player $PLAYER_CHAR defined 004D: jump_if_false @DEMOTEXT_1054C: use_GXT_table 'CAT'00BA: text_styled 'CATX_VK'  30000 ms  10A93: end_custom_thread

 

 

GXT -Textdocument: GTASA.text

Open GTASA.text to find gxt entries of a translated textfile, if you only want to show messages of gxt file

Find GTASA.text in Sannybuilder install directory, in subfolder help\GXT Strings

Sanny Builder 3\help\GXT Strings\GTASA.text

It's content looks like that:

 

 

[MAIN]

 

10LS  // Los Santos

10LS2  // Los Santos

10LS3  // Los Santos

10LS4  // Los Santos

10LS5  // Los Santos

10OG  // O.G.

10WEED  // Weed

10_R_20  // ~z~10 or 20

11DICE  // Dice

11DICE2  // Dice

11GGIFT  // Gods Gift

11GROV2  // Grove

[Table name]

 

GXT Entry // textmessage

 

 

 

FXT file

GXT means Gta Text, FXT means Fake Text

The FXT files are textbased and can be edited with simple texteditor(notepad.exe)

The FXT files requires the cleo library and the GXTHOOK.cleo in cleo folder to work.

It doesn't need to registrate a FXT file in any way

Cleo loads the content of a FXT file if it exist in Cleo\CLEO_TEXT folder

 

To create a fxt file needs to insert an entry name for the script and the real text to show, in a normal txt file

Then rename the file by chaning the extension from .txt into .fxt

Or create it directly with Sannybuilder and save it as .fxt , choose Any file (*.*) as extension

 

Entry name for the script and the real text to show must be done in this way:

<Entryname><space><text message>

only 1 space between Entryname and text message

Important:

only 1 space between words of the text message are allowed and NO space at the end

Maximum 7 symbols as entry name are allowed

 

Exemble:

Copy this line into a blanc page and save it as anyname.fxt

 

TXT_01 This is text of Cleo fxt file

 

Then use the script below to show the text

 

{$CLEO .cs}:DEMOTEXT03A4: name_thread "DEMO":DEMOTEXT_1wait 0if0256:   player $PLAYER_CHAR defined 004D: jump_if_false @DEMOTEXT_100BA: text_styled 'TXT_01'  30000 ms  10A93: end_custom_thread

 

 

 

Edited by ZAZ
Link to comment
Share on other sites

  • 2 weeks later...

how can I make $player_actor invisible? no, this is not a request, I'm asking because the opcode 0337: doesn't work with $player_actor, is only working for peds.

 

I only want to hide the $player_actor, I want to be able to move the mouse around the new ped, created next to the player.

 

something like;

 

{$CLEO}0000:while trueif and0AB0:  key_pressed 0x8 //backspace0AB0:  key_pressed 0x9 //tabthen   0ACA: show_text_box "ON"   Actor.LockInCurrentPosition($PLAYER_ACTOR) = True   0337: set_actor $PLAYER_ACTOR visibility 0       ////// this opcode doesn't work   #BMOST.Load      while not #BMOST.Available    wait 0   end    04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.9 0.0   009A: 29@ = create_actor_pedtype 4 model #BMOST at 1@ 2@ 3@    0249: release_model #BMOST    wait 2000      while true   if and       0AB0:  key_pressed 0x8       0AB0:  key_pressed 0x9   then       009B: destroy_actor 29@        Actor.LockInCurrentPosition($PLAYER_ACTOR) = False       0337: set_actor $PLAYER_ACTOR visibility 1        break   end    wait 0   endendwait 0end

 

 

thanks for help!

Link to comment
Share on other sites

 

how can I make $player_actor invisible? no, this is not a request, I'm asking because the opcode 0337: doesn't work with $player_actor, is only working for peds.

 

I only want to hide the $player_actor, I want to be able to move the mouse around the new ped, created next to the player.

 

 

 

thanks for help!

yes, the unvisible opcode works for the player just partialy

with bodypart codes I can only make head and torso unvisible

just put player 5m above or below of the actor or of cam position and make his col to 0, so nobody can see him while cam mode

Link to comment
Share on other sites

 

**

Just use 09C7 and use an empty model.

Edited by BnB
Link to comment
Share on other sites

thanks for answer...

@Zaz

yes, I tried but the camera is always around $player_actor. So, doesn't looks as should be, and sometimes you look below the ground or too high above.

 

@BnB

I also thought in that, but sometimes I got a bug with that opcode. the player deforms confused.gif

 

 

Is there any way to put the camera on other actors? with mouse movement?

 

I did a script for camera movement, but it needs 5 variables, and I have no longer more variables. (in other script)

I don't know if this is the "better" way to do something like this, but this script is working... wink.gif

 

 

{$CLEO}0000:while trueif and0AB0:  key_pressed 0x8 // backspace0AB0:  key_pressed 0x9 // tabthen   0ACA: show_text_box "ON"   wait 1000   01B4: set_player $PLAYER_CHAR can_move 0    7@ = 360.0   6@ = 5.4   27@ = 1.85           while true   if   0AB0:  key_pressed 74   // J  - left   then       000B: 7@ += 3.0       if       7@ > 360.0       then           7@ = 0.0       end   end   if   0AB0:  key_pressed 75   // K  - right   then       000B: 7@ += -3.0       if       0.0 > 7@       then           7@ = 360.0       end   end   if   0AB0:  key_pressed 79   // O - zoom out   then       000B: 6@ += 0.15       if       6@ > 7.0       then           6@ = 7.0       end   end   if   0AB0:  key_pressed 76   // L - zoom in   then       000B: 6@ += -0.15       if       2.0 > 6@       then           6@ = 2.0       end   end   if   0AB0:  key_pressed 85  // U - up   then       000B: 27@ += 0.1       if       27@ > 2.2       then           27@ = 2.2       end   end   if   0AB0:  key_pressed 73   // I - down   then       000B: 27@ += -0.1       if       0.5 > 27@       then           27@ = 0.5       end   end   02F6: 25@ = sine 7@   02F7: 26@ = cosine 7@   0013: 25@ *= 6@    0013: 26@ *= 6@    067E: put_camera_on_actor $PLAYER_ACTOR with_offset 25@ 26@ 27@ point_to_actor $PLAYER_ACTOR 0.0 mode 2    //067C: put_camera_on_actor $PLAYER_ACTOR with_offset 25@ 26@ 0.7 rotation 0.0 3.0 0.75 0.0 2    if and   0AB0:  key_pressed 0x8   0AB0:  key_pressed 0x9   then       Camera.Restore()       Camera.Restore_WithJumpCut()       01B4: set_player $PLAYER_CHAR can_move 1        0ACA: show_text_box "OFF"       break   end    wait 0   end   wait 1000endwait 0end

 

 

controls:

J - left

K - right

O - zoom out

L - zoom in

U - up

I - down

 

thanks! icon14.gif

Edited by jayd00
Link to comment
Share on other sites

 

thanks for answer...

@Zaz

yes, I tried but the camera is always around $player_actor. So, doesn't looks as should be, and sometimes you look below the ground or too high above.

 

 

Why attaching cam to player?

You wrote about a second ped, attach cam to ped

 

I want to be able to move the mouse around the new ped, created next to the player.

check out my Free Moving Camera

it attach the cam to a ped using this cam code:

 

067C: put_camera_on_actor 0@ with_offset 0.0 0.3 0.5 rotation 0.0 0.5 30@ 0.0 2first 3param(x,y,z)-camposition, second3param(x,y,z)camtarget, last 2param: angle, modex,y,z is in relation to actor center

 

and the user can move the ped

 

or just use your 067E: and insert the pedhandle

Link to comment
Share on other sites

hoo, I see now... nice trick. Thanks!

 

and what about to attach actor to actor?..

I did it, but I have a bug, the actor attached, is shaking while moving.

 

with this opcode;

 

069B: attach_object 25@ to_actor $PLAYER_ACTOR with_offset -0.088 0.29 0.3 rotation 0.0 0.0 0.0 

 

there is no problem, but the attached object doesn't move with actor when him is running or crouching, because the object isn't attached to the bones.

 

but if I use this opcode;

 

070A: AS_actor 358@ attach_to_object 359@ offset 0.0 0.0 0.0 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 1 

 

the object is attached to the bone, but the actor into turret is shaking, something like the actor attached is left behind a little bit.

 

I also tried with ryosuke function, to attach objects, but I got the same bug as the opcode 070A:

and I need to fix the shaking actor, becasue this $actor will be something like wings for my mod.

 

 

{$CLEO}0000:while trueif    Player.Defined(0) // $PLAYER_CHAR == 0then   if   044B:   actor $PLAYER_ACTOR on_foot    then       if and       00E1:   player 0 pressed_key 4 // action       00E1:   player 0 pressed_key 11 // conversation yes       then           if and           856D:   not actor 26@ defined            83CA:   not object 25@ exists            then               023C: load_special_actor 'CLAUDE' as 6 // models 290-299                0247: load_model 1582                038B: load_requested_models                               while true                if and               823D:   not special_actor 6 loaded                8248:   not model 1582 available                jf break                wait 0               end               0172: 8@ = actor $PLAYER_ACTOR Z_angle               04C4: store_coords_to 27@ 28@ 29@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 -18.6                009A: 26@ = create_actor_pedtype 8 model #SPECIAL06 at 27@ 28@ 29@                02AB: set_actor 26@ immunities BP 1 FP 1 EP 1 CP 1 MP 1                0619: enable_actor 26@ collision_detection 0                0489: set_actor 26@ muted 1                0296: unload_special_actor 6                       0107: 25@ = create_object 1582 at 27@ 28@ -25.0                0382: set_object 25@ collision_detection 0                04D9: object 25@ set_scripted_collision_check 0                08D2: object 25@ scale_model 0.01                0177: set_object 25@ Z_angle_to 8@                0249: release_model 1582                       0177: set_object 25@ Z_angle_to 8@                04F4: put_actor 26@ into_turret_on_object 25@ offset_from_object_origin 0.0 0.0 -0.5 orientation 0 both_side_angle_limit 0.0 lock_weapon 1                wait 500           else               009B: destroy_actor 26@                0108: destroy_object 25@               wait 500           end       end       if and       056D:   actor 26@ defined        03CA:   object 25@ exists        then           0172: 8@ = actor $PLAYER_ACTOR Z_angle           0AB1: call_scm_func @ATEST_ATTACH 6 AS_actor $PLAYER_ACTOR attach_to_object 25@ offset 0.0 -1.0 0.0 on_bone 17           0177: set_object 25@ Z_angle_to 8@        end       else       if       00DF:   actor $PLAYER_ACTOR driving        then           if and           056D:   actor 26@ defined            03CA:   object 25@ exists            then               009B: destroy_actor 26@                0108: destroy_object 25@           end           end           endelse   if and   056D:   actor 26@ defined    03CA:   object 25@ exists    then       009B: destroy_actor 26@        0108: destroy_object 25@   end    endwait 0end:ATEST_ATTACH0A9F: 6@ = current_thread_pointer000A: 6@ += 0x44 0A96: 7@ = actor 0@ struct0085: 0@ = 7@ // (int) 000A: 0@ += 0x18 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 00AA7: call_function 0x734A40 num_params 1 pop 1 0@ 0@ // _clumpGetFirstSkinAtomicHAnimHierarchy0012: 5@ *= 0x4000A: 5@ += 0x488 005A: 5@ += 7@ // (int) 0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0000A: 5@ += 0x140A8D: 5@ = read_memory 5@ size 4 virtual_protect 00A8D: 7@ = read_memory 0x7C51E0 size 4 virtual_protect 1 00D6: if 0039: 7@ == 0x0424548B jf @ATEST_ATTACH_10AA7: call_function 0x7C51E0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex0AA7: call_function 0x7C5160 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray0012: 5@ *= 0x40005A: 5@ += 0@ // (int) 0AA5: call 0x7EDDD0 num_params 4 pop 4 5@ 1 6@ 6@jump @ATEST_ATTACH_2:ATEST_ATTACH_10AA7: call_function 0x7C51A0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex0AA7: call_function 0x7C5120 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray0012: 5@ *= 0x40005A: 5@ += 0@ // (int) 0AA5: call 0x7EDD90 num_params 4 pop 4 5@ 1 6@ 6@:ATEST_ATTACH_20177: set_object 1@ Z_angle_to 0.0 0A98: 1@ = object 1@ struct000A: 1@ += 0x140A8D: 0@ = read_memory 1@ size 4 virtual_protect 0000A: 1@ += -0x140AA6: call_method 0x411990 struct 1@ num_params 0 pop 0 // sub_4119900AA6: call_method 0x59AD20 struct 0@ num_params 1 pop 0 5@ // _CMatrix__copyTo0AA6: call_method 0x4241C0 struct 1@ num_params 1 pop 0 6@ // sub_4241C0000A: 1@ += 0x180A8D: 7@ = read_memory 1@ size 4 virtual_protect 0if8039:   not  7@ == 0jf @ATEST_ATTACH_3 000A: 7@ += 0x40A8D: 7@ = read_memory 7@ size 4 virtual_protect 0000A: 7@ += 0x100AA6: call_method 0x59AD70 struct 0@ num_params 1 pop 0 7@ // _CMatrix__copyTo:ATEST_ATTACH_3000A: 1@ += -0x180AA6: call_method 0x532B00 struct 1@ num_params 0 pop 0 // _RwFrameUpdateObject0AB2: ret 0

 

 

thanks for help! wink.gif

Edited by jayd00
Link to comment
Share on other sites

and what about to attach actor to actor?..

I did it, but I have a bug, the actor attached, is shaking while moving.

 

...becasue this $actor will be something like wings for my mod.

So it's another situation now

Please describe your plan

 

you wanna attach a modactor to player and now you need to imitate the default playercam while player isn't visible?

 

It's not possible to imitate the default playercam and keep the default player controling

but it's possible to do it partialy which could be fine for that mod

 

Try the script below, it attaches object to player and actor to object

the cam to player with 067C:

opcode 0A4A: to set playerangle to steer with mousemove and move with forward button

 

{$CLEO .cs}:Mod_Actor_Overlay_Camthread 'ALAYCAM' :ALAYCAM_11wait 0 if 0256:   player $PLAYER_CHAR definedjf @ALAYCAM_11 if and0AB0:   key_pressed 48//-- 0 (zero) 0AB0:   key_pressed 8//--Backspace jf @ALAYCAM_11 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0 0992: set_player $PLAYER_CHAR weapons_scrollable 0 0247: load_model #wmoice 0247: load_model 3045:ALAYCAM_14wait 0 if and0248:   model #wmoice available0248:   model 3045 availablejf @ALAYCAM_14 :ALAYCAM_15wait 0 84EE:   not animation "PARACHUTE" loaded jf @ALAYCAM_17 04ED: load_animation "PARACHUTE" jump @ALAYCAM_15 :ALAYCAM_17009A: 0@ = create_actor_pedtype 24 model #wmoice at 100.5 10.5 10.5 0107: 1@ = create_object 3045 at 100.5 10.5 100.5 0223: set_actor 0@ health_to 2000 02AB: set_actor 0@ immunities BP 1 FP 1 EP 1 CP 1 MP 10619: enable_actor 0@ collision_detection 0 0249: release_model #wmoice069B: attach_object 1@ to_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.5 rotation 0.0 0.0 0.0 04F4: put_actor 0@ into_turret_on_object 1@ offset_from_object_origin 0.0 2.0 0.5 orientation 0 both_side_angle_limit 0.0 lock_weapon 0 0812: AS_actor 0@ perform_animation "FALL_SKYDIVE" IFP_file "PARACHUTE" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -2 // versionB 8@ = -1.0 30@ = 0.4 31@ = 0 :ALAYCAM_50wait 0 if 0256:   player $PLAYER_CHAR definedjf @ALAYCAM_80 if 80E1:   not player 0 pressed_key 15 jf @ALAYCAM_80 0A4A: store_joystick_X_offset_to 21@ Y_offset_to 22@ 0172: 9@ = actor $PLAYER_ACTOR Z_angle 0063: 9@ -= 21@  // floating-point values0173: set_actor $PLAYER_ACTOR Z_angle_to 9@if or0611:  actor $PLAYER_ACTOR animation == "WEAPON_crouch"0611:  actor $PLAYER_ACTOR animation == "RIFLE_crouchfire"jf @ALAYCAM_53 if  31@ == 0 jf @ALAYCAM_55 069B: attach_object 1@ to_actor $PLAYER_ACTOR with_offset 0.0 0.0 -1.0 rotation 0.0 0.0 0.0 31@ = 1 jump @ALAYCAM_55 :ALAYCAM_53if  31@ == 1 jf @ALAYCAM_55 069B: attach_object 1@ to_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.5 rotation 0.0 0.0 0.0 31@ = 0 jump @ALAYCAM_55 :ALAYCAM_55if  31@ == 0 jf @ALAYCAM_70 if or 30@ > 1.0  22@ > 0.0 jf @ALAYCAM_60 22@ /= 200.0 005B: 30@ += 22@ // (float) :ALAYCAM_60067C: put_camera_on_actor $PLAYER_ACTOR with_offset 0.0 0.5 1.5 rotation 0.0 1.5 30@ 0.0 2 jump @ALAYCAM_50 :ALAYCAM_70067C: put_camera_on_actor $PLAYER_ACTOR with_offset 0.0 0.5 0.0 rotation 0.0 1.5 0.0 0.0 2 jump @ALAYCAM_50 :ALAYCAM_80009B: destroy_actor 0@0108: destroy_object 1@0992: set_player $PLAYER_CHAR weapons_scrollable 1 0373: set_camera_directly_behind_player 02EB: restore_camera_with_jumpcutjump @ALAYCAM_11 

 

Link to comment
Share on other sites

 

Please describe your plan

you wanna attach a modactor to player and now you need to imitate the default playercam while player isn't visible?

 

blush.gif sorry, I didn't explained too much, the moving camera is for another script, thanks for your advices... thats really an interesting script, is usefull for me wink.gif

 

well, I'm making wings for the $player, the new actor in the object, will be the wings of $palyer, due the animations... (wings moving)

I have the models and everything, but I got a bug with the attach_object, as I said before.

 

when I attach the object to one bone, the new actor(wings) in the object is shaking when the $player walk or run or is moving.

 

there is no problem in the script, I already did it.

I only have problems with the attach part.

Because the new actor shakes, or is left behind when the $player is moving.

 

If I attach the object with the 069B there is no problem, the actor didn't shakes. But the actor(wings) is static, I meant doesn't move with the back, when actor is running or walking, is only following the $player.

 

 

thanks for help cookie.gifcookie.gif

Link to comment
Share on other sites

RelatedAbyss

I'm slightly confused, but all I want to know is can I put "driving_leviathn" instead of "driving_heli" because I want to slightly change a mod I downloaded. (leviathn referring to the gta3.img name for the leviathan.)

Link to comment
Share on other sites

I'm slightly confused, but all I want to know is can I put "driving_leviathn" instead of "driving_heli" because I want to slightly change a mod I downloaded. (leviathn referring to the gta3.img name for the leviathan.)

this should help, there is positive condition and negative

 

00DD:   actor $PLAYER_ACTOR driving_car_with_model #LEVIATHN80DD:   not actor $PLAYER_ACTOR driving_car_with_model #LEVIATHN 

 

 

only remember to use the opcode search wink.gif

Link to comment
Share on other sites

Hello. I have a problem with this code, the game crash after loading the game.

 

//health bar 0007: 6@ = 400.0    0AC7: 5@ = var 6@ offset0A8C: write_memory 0x58EE66 size 4 value 5@ virtual_protect 1

 

 

I am writing this code in main.scm.

Edited by juarez
Link to comment
Share on other sites

 

Hello. I have a problem with this code, the game crash after loading the game.

 

//health bar 0007: 6@ = 400.0    0AC7: 5@ = var 6@ offset0A8C: write_memory 0x58EE66 size 4 value 5@ virtual_protect 1

 

 

I am writing this code in main.scm.

yo man, you add code into main.scm and now the game crash because you added code into main.scm

why did you do that?

it's a cleo script tutorial, show me your cleo script

what's the function of the memadress?

Edited by ZAZ
Link to comment
Share on other sites

Okay I gave to CLEO and added 2 bytes. I wanted to move the weapon Icon to another place, but after calling and changing the float in the 4@ icon is in the same place.

 

{$CLEO}0000: NOP4@ = 32.0 0AC7: 5@ = var 4@ offset5@ *= 0x90900A8C: write_memory 0x58F91C    size 6 value 5@ virtual_protect 1     //weapon icon X0A93: end_custom_thread

 

Edited by juarez
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.