Quantcast

Jump to content

» «
Photo

[GTA SA] ~ CLEO Script Tutorial ~

631 replies to this topic
ZAZ
  • ZAZ

    Kernlochbohrer

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

#271

Posted 30 May 2011 - 05:36 AM

QUOTE (123iamking @ May 30 2011, 03:49)
QUOTE (ZAZ @ May 29 2011, 12:28)

CODE
04C4: create_coordinate 25@ 26@ 28@ from_actor 0@ offset 0.0 0.0  1.2
095C: 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

achil
  • achil

    Converting the Third Reich into GTA SA

  • Members
  • Joined: 22 Nov 2010

#272

Posted 30 May 2011 - 11:14 AM

Owwww man you are mastermind


123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011

#273

Posted 30 May 2011 - 12:00 PM Edited by 123iamking, 30 May 2011 - 12:03 PM.

QUOTE (ZAZ @ May 30 2011, 05:36)
QUOTE (123iamking @ May 30 2011, 03:49)
QUOTE (ZAZ @ May 29 2011, 12:28)

CODE
04C4: create_coordinate 25@ 26@ 28@ from_actor 0@ offset 0.0 0.0  1.2
095C: 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

CODE
:a
wait 0
if
 Player.Defined($PLAYER_CHAR)
jf @a
if and
0AB0: key_pressed 9
0AB0: key_pressed 76
jf @a
wait 0
0@ = -1
04C4: 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@ == -1
jf @a
04ED: load_animation "BSKTBALL"
if
80DF:   NOT actor $PLAYER_ACTOR driving
jf @c


:b
wait 0
if
04EE:   animation "BSKTBALL" loaded
jf @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 // versionA
4@ = Marker.CreateAboveActor(0@)
wait 2000

:c
wait 0
if
0AB0: key_pressed 76
jf @c
083C: set_actor 0@ velocity_in_direction_XYZ 0.0 0.0 25.0
wait 2000

:d
wait 0
if
0118:   actor 0@ dead
jf @c
Marker.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

ZAZ
  • ZAZ

    Kernlochbohrer

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

#274

Posted 30 May 2011 - 07:25 PM

QUOTE (123iamking @ May 30 2011, 12:00)
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
CODE
{$CLEO .cs}
:123iamking
03A4: name_thread 'A'

:a
wait 0
if
Player.Defined($PLAYER_CHAR)
jf @a
if and
0AB0: key_pressed 9//  tab key
0AB0: key_pressed 76//  l key
jf @a

0006: 0@ = -1
0006: 1@ = -1
0006: 2@ = -1
0006: 3@ = -1
0006: 4@ = -1
0006: 5@ = -1
0006: 6@ = -1
0006: 7@ = -1
0006: 8@ = -1
0006: 9@ = -1
0006: 10@ = -1
0006: 11@ = -1
0006: 12@ = -1
0006: 13@ = -1
0006: 28@ = 0

:a_1
wait 0
if
Player.Defined($PLAYER_CHAR)
jf @l
03F0: enable_text_draw 1
045A: draw_text_1number 100.0 50.0 GXT 'NUMBER' number 28@  // ~1~
if
12 > 28@
jf @a_3
04C4: 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 50
if
not 0@(28@,16i) == -1
jf @a_1
14@(28@,16i) = Marker.CreateAboveActor(0@(28@,16i))
28@ += 1
jump @a_1

:a_3
28@ = 0
04ED: load_animation "BSKTBALL"

:b
wait 0
if
04EE:   animation "BSKTBALL" loaded
jf @b
     
0639: AS_actor $PLAYER_ACTOR rotate_to_actor 0@(28@,16i)
wait 1000
0605: actor $PLAYER_ACTOR perform_animation_sequence "BBALL_DEF_LOOP" IFP_file "BSKTBALL" 4.0 loop 0 0 0 0 time 2000 // versionA


:c
wait 0
if
Player.Defined($PLAYER_CHAR)
jf @j
03F0: enable_text_draw 1
045A: draw_text_1number 100.0 100.0 GXT 'NUMBER' number 28@  // ~1~
if
12 > 28@
jf @f
if
  not 0@(28@,16i) == -1
jf @e
if
8118: not actor 0@(28@,16i) dead
jf @d
04C4: create_coordinate 29@ 30@ 31@ from_actor 0@(28@,16i) offset 0.0 0.0  1.2
095C: 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//red
095C: 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//red
095C: 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//red
jump @e

:d
Actor.RemoveReferences(0@(28@,16i))
Marker.Disable(14@(28@,16i))
0@(28@,16i) = -1

:e
28@ += 1
if
0AB0: key_pressed 76//  l key
jf @c
jump @h

:f
28@ = 0
jump @c


:g
wait 0
if
Player.Defined($PLAYER_CHAR)
jf @j
03F0: enable_text_draw 1
045A: draw_text_1number 100.0 150.0 GXT 'NUMBER' number 28@  // ~1~
if
12 > 28@
jf @J
if
  not 0@(28@,16i) == -1
jf @h
if
8118: not actor 0@(28@,16i) dead
jf @h
if
8449: not  actor 0@(28@,16i) in_a_car
jf @h
083C: set_actor 0@(28@,16i) velocity_in_direction_XYZ 0.0 0.0 25.0
wait 0
083C: set_actor 0@(28@,16i) velocity_in_direction_XYZ 0.0 0.0 25.0

:h
28@ += 1
jump @g


:j
wait 250
04EF: release_animation "BSKTBALL"

:l
28@ = 0

:m
wait 0
03F0: enable_text_draw 1
045A: draw_text_1number 100.0 200.0 GXT 'NUMBER' number 28@  // ~1~
if
12 > 28@
jf @a
if
  not 0@(28@,16i) == -1
jf @n  
Marker.Disable(14@(28@,16i))
Actor.RemoveReferences(0@(28@,16i))

:n
28@ += 1
jump @m

123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011

#275

Posted 31 May 2011 - 03:04 AM

thank you , you 're awesome inlove.gif

geiv.tomco
  • geiv.tomco

    Player Hater

  • Members
  • Joined: 31 May 2011

#276

Posted 31 May 2011 - 08:05 PM

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

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#277

Posted 31 May 2011 - 08:37 PM

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

geiv.tomco
  • geiv.tomco

    Player Hater

  • Members
  • Joined: 31 May 2011

#278

Posted 01 June 2011 - 04:01 PM

QUOTE (SilentPL @ May 31 2011, 20:37)
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

ZAZ
  • ZAZ

    Kernlochbohrer

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

#279

Posted 02 June 2011 - 05:20 AM

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
CODE

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 1
1 - Root 2
2 - Spine 1
3 - Spine 2
4 - Neck
5 - Head
6 - Head 2
7 - Head 3
8 - Head 4 (2,3, 4 - eyes or brow maybe?)
21 - Chest Area
22 - Right Shoulder
23 - Right Elbow
24 - Right Wrist
25 - Right Hand
26 - Right Hand/Finger?
31 - Chest Area
32 - Left Shoulder
33 - Left Elbow
34 - Left Wrist
35 - Left Hand
36 - Left Hand/Finger?
41 - Left Hip
42 - Left Knee
43 - Left Heel
44 - Left Foot
51 - Right Hip
52 - Right Knee
53 - Right Heel
54 - 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

CODE
{$CLEO .cs}
:Flamethrower_at_Actor_bone
03A4: name_thread 'FLAMEPB'
1@ = 0

:FLAMEPB_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @FLAMEPB_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @FLAMEPB_01

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 1@
064C: make_particle 0@ visible
0001: wait  1000 ms

:FLAMEPB_03
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @FLAMEPB_03
03F0: enable_text_draw 1
045A: text_draw_1number  250.0  80.0 'NUMBER' 1@    // value
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @FLAMEPB_03
0976: destroy_particle 0@  
0001: wait  500 ms
1@ += 1
if
1@ > 60
004D: jump_if_false @FLAMEPB_01
1@ = 0
0002: jump @FLAMEPB_01

jaky2008
  • jaky2008

    Mack Pimp

  • Members
  • Joined: 13 May 2009

#280

Posted 21 June 2011 - 09:00 PM

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!

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#281

Posted 22 June 2011 - 05:07 PM

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

pringston2010
  • pringston2010

    Player Hater

  • Members
  • Joined: 02 Oct 2010

#282

Posted 23 June 2011 - 01:32 AM

QUOTE (pringston2010 @ Thursday, May 12 2011, 01:57)
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

ZAZ
  • ZAZ

    Kernlochbohrer

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

#283

Posted 23 June 2011 - 05:57 AM Edited by ZAZ, 23 June 2011 - 06:09 AM.

QUOTE (jaky2008 @ Tuesday, Jun 21 2011, 21:00)
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!


QUOTE (pringston2010 @ Thursday, Jun 23 2011, 01:32)
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 @:
CODE
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


pringston2010
  • pringston2010

    Player Hater

  • Members
  • Joined: 02 Oct 2010

#284

Posted 23 June 2011 - 11:48 AM

QUOTE (ZAZ @ Thursday, Jun 23 2011, 05:57)
QUOTE (jaky2008 @ Tuesday, Jun 21 2011, 21:00)
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!


QUOTE (pringston2010 @ Thursday, Jun 23 2011, 01:32)
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 @:
CODE
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?

ZAZ
  • ZAZ

    Kernlochbohrer

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

#285

Posted 24 June 2011 - 04:59 AM Edited by ZAZ, 24 June 2011 - 05:19 AM.

QUOTE (pringston2010 @ Thursday, Jun 23 2011, 11:48)
QUOTE (ZAZ @ Thursday, Jun 23 2011, 05:57)
QUOTE (jaky2008 @ Tuesday, Jun 21 2011, 21:00)
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!


QUOTE (pringston2010 @ Thursday, Jun 23 2011, 01:32)
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 @:
CODE
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:
QUOTE
VO_AF   ~z~Grove Street - Home.


Use the gxt entry VO_AF to show the textmessage "Grove Street - Home."
try the script below
CODE
{$CLEO .cs}
:DEMOTEXT
03A4: name_thread "DEMO"

:DEMOTEXT_1
wait 0
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @DEMOTEXT_1
00BA: text_styled 'VO_AF'  30000 ms  1
0A93: 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
CODE
{$CLEO .cs}
:DEMOTEXT
03A4: name_thread "DEMO"

:DEMOTEXT_1
wait 0
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @DEMOTEXT_1
054C: use_GXT_table 'CAT'
00BA: text_styled 'CATX_VK'  30000 ms  1
0A93: 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:

QUOTE
[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
CODE
TXT_01 This is text of Cleo fxt file

Then use the script below to show the text
CODE
{$CLEO .cs}
:DEMOTEXT
03A4: name_thread "DEMO"

:DEMOTEXT_1
wait 0
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @DEMOTEXT_1
00BA: text_styled 'TXT_01'  30000 ms  1
0A93: end_custom_thread



jayd00
  • jayd00

    Rat

  • Members
  • Joined: 24 May 2008

#286

Posted 04 July 2011 - 10:30 PM

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;
CODE
{$CLEO}
0000:

while true
if and
0AB0:  key_pressed 0x8 //backspace
0AB0:  key_pressed 0x9 //tab
then
   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
   end

end
wait 0
end


thanks for help!

ZAZ
  • ZAZ

    Kernlochbohrer

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

#287

Posted 05 July 2011 - 04:26 PM

QUOTE (jayd00 @ Monday, Jul 4 2011, 22:30)
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

BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#288

Posted 06 July 2011 - 03:53 PM Edited by BnB, 06 July 2011 - 06:06 PM.

QUOTE (jayd00 @ Tuesday, Jul 5 2011, 00:30)
**

Just use 09C7 and use an empty model.

jayd00
  • jayd00

    Rat

  • Members
  • Joined: 24 May 2008

#289

Posted 07 July 2011 - 05:01 AM Edited by jayd00, 07 July 2011 - 05:03 AM.

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

CODE
{$CLEO}
0000:

while true
if and
0AB0:  key_pressed 0x8 // backspace
0AB0:  key_pressed 0x9 // tab
then
   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 1000

end
wait 0
end


controls:
J - left
K - right
O - zoom out
L - zoom in
U - up
I - down

thanks! icon14.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#290

Posted 07 July 2011 - 04:08 PM

QUOTE (jayd00 @ Thursday, Jul 7 2011, 05:01)
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
QUOTE
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:
CODE
067C: put_camera_on_actor 0@ with_offset 0.0 0.3 0.5 rotation 0.0 0.5 30@ 0.0 2
first 3param(x,y,z)-camposition, second3param(x,y,z)camtarget, last 2param: angle, mode
x,y,z is in relation to actor center

and the user can move the ped

or just use your 067E: and insert the pedhandle

jayd00
  • jayd00

    Rat

  • Members
  • Joined: 24 May 2008

#291

Posted 08 July 2011 - 03:21 AM Edited by jayd00, 08 July 2011 - 03:24 AM.

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;
CODE
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;
CODE
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.

CODE
{$CLEO}
0000:

while true
if
   Player.Defined(0) // $PLAYER_CHAR == 0
then
   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        
   end
else
   if and
   056D:   actor 26@ defined
   03CA:   object 25@ exists
   then
       009B: destroy_actor 26@
       0108: destroy_object 25@
   end    
end

wait 0
end

:ATEST_ATTACH
0A9F: 6@ = current_thread_pointer
000A: 6@ += 0x44
0A96: 7@ = actor 0@ struct
0085: 0@ = 7@ // (int)
000A: 0@ += 0x18
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0AA7: call_function 0x734A40 num_params 1 pop 1 0@ 0@ // _clumpGetFirstSkinAtomicHAnimHierarchy
0012: 5@ *= 0x4
000A: 5@ += 0x488
005A: 5@ += 7@ // (int)
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
000A: 5@ += 0x14
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
0A8D: 7@ = read_memory 0x7C51E0 size 4 virtual_protect 1
00D6: if
0039: 7@ == 0x0424548B
jf @ATEST_ATTACH_1
0AA7: call_function 0x7C51E0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex
0AA7: call_function 0x7C5160 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray
0012: 5@ *= 0x40
005A: 5@ += 0@ // (int)
0AA5: call 0x7EDDD0 num_params 4 pop 4 5@ 1 6@ 6@
jump @ATEST_ATTACH_2

:ATEST_ATTACH_1
0AA7: call_function 0x7C51A0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex
0AA7: call_function 0x7C5120 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray
0012: 5@ *= 0x40
005A: 5@ += 0@ // (int)
0AA5: call 0x7EDD90 num_params 4 pop 4 5@ 1 6@ 6@

:ATEST_ATTACH_2
0177: set_object 1@ Z_angle_to 0.0
0A98: 1@ = object 1@ struct
000A: 1@ += 0x14
0A8D: 0@ = read_memory 1@ size 4 virtual_protect 0
000A: 1@ += -0x14
0AA6: call_method 0x411990 struct 1@ num_params 0 pop 0 // sub_411990
0AA6: call_method 0x59AD20 struct 0@ num_params 1 pop 0 5@ // _CMatrix__copyTo
0AA6: call_method 0x4241C0 struct 1@ num_params 1 pop 0 6@ // sub_4241C0
000A: 1@ += 0x18
0A8D: 7@ = read_memory 1@ size 4 virtual_protect 0
if
8039:   not  7@ == 0
jf @ATEST_ATTACH_3
000A: 7@ += 0x4
0A8D: 7@ = read_memory 7@ size 4 virtual_protect 0
000A: 7@ += 0x10
0AA6: call_method 0x59AD70 struct 0@ num_params 1 pop 0 7@ // _CMatrix__copyTo

:ATEST_ATTACH_3
000A: 1@ += -0x18
0AA6: call_method 0x532B00 struct 1@ num_params 0 pop 0 // _RwFrameUpdateObject
0AB2: ret 0


thanks for help! wink.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#292

Posted 08 July 2011 - 02:29 PM

QUOTE (jayd00 @ Friday, Jul 8 2011, 03:21)
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
CODE
{$CLEO .cs}
:Mod_Actor_Overlay_Cam
thread 'ALAYCAM'

:ALAYCAM_11
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @ALAYCAM_11
if and
0AB0:   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_14
wait 0
if and
0248:   model #wmoice available
0248:   model 3045 available
jf @ALAYCAM_14

:ALAYCAM_15
wait 0
84EE:   not animation "PARACHUTE" loaded
jf @ALAYCAM_17
04ED: load_animation "PARACHUTE"
jump @ALAYCAM_15

:ALAYCAM_17
009A: 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 1
0619: enable_actor 0@ collision_detection 0
0249: release_model #wmoice
069B: 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_50
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @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 values
0173: set_actor $PLAYER_ACTOR Z_angle_to 9@
if or
0611:  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_53
if
 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_55
if
 31@ == 0
jf @ALAYCAM_70
if or
 30@ > 1.0
 22@ > 0.0
jf @ALAYCAM_60
22@ /= 200.0
005B: 30@ += 22@ // (float)

:ALAYCAM_60
067C: 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_70
067C: 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_80
009B: 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_jumpcut
jump @ALAYCAM_11

jayd00
  • jayd00

    Rat

  • Members
  • Joined: 24 May 2008

#293

Posted 09 July 2011 - 03:44 AM

QUOTE (ZAZ @ Friday, Jul 8 2011, 08:29)
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.gif cookie.gif

RelatedAbyss
  • RelatedAbyss

    Player Hater

  • Members
  • Joined: 03 Jun 2011

#294

Posted 09 July 2011 - 02:09 PM

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.)

jayd00
  • jayd00

    Rat

  • Members
  • Joined: 24 May 2008

#295

Posted 09 July 2011 - 09:39 PM

QUOTE (RelatedAbyss @ Saturday, Jul 9 2011, 08:09)
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
CODE
00DD:   actor $PLAYER_ACTOR driving_car_with_model #LEVIATHN
80DD:   not actor $PLAYER_ACTOR driving_car_with_model #LEVIATHN


only remember to use the opcode search wink.gif

juarez
  • juarez

    Memory Hacking

  • Members
  • Joined: 11 Jun 2011

#296

Posted 11 July 2011 - 03:31 PM Edited by juarez, 11 July 2011 - 05:13 PM.

Hello. I have a problem with this code, the game crash after loading the game.
CODE
//health bar
0007: 6@ = 400.0    
0AC7: 5@ = var 6@ offset
0A8C: write_memory 0x58EE66 size 4 value 5@ virtual_protect 1


I am writing this code in main.scm.

BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#297

Posted 11 July 2011 - 05:33 PM

Put this code on a separate cleo script.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#298

Posted 12 July 2011 - 05:13 PM Edited by ZAZ, 12 July 2011 - 05:18 PM.

QUOTE (juarez @ Monday, Jul 11 2011, 15:31)
Hello. I have a problem with this code, the game crash after loading the game.
CODE
//health bar
0007: 6@ = 400.0    
0AC7: 5@ = var 6@ offset
0A8C: 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?

BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#299

Posted 12 July 2011 - 05:26 PM

Health Bar Y Pos.

juarez
  • juarez

    Memory Hacking

  • Members
  • Joined: 11 Jun 2011

#300

Posted 13 July 2011 - 07:59 AM Edited by juarez, 13 July 2011 - 08:02 AM.

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.
CODE

{$CLEO}
0000: NOP
4@ = 32.0
0AC7: 5@ = var 4@ offset
5@ *= 0x9090
0A8C: write_memory 0x58F91C    size 6 value 5@ virtual_protect 1     //weapon icon X
0A93: end_custom_thread




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users