Quantcast

Jump to content

» «
Photo

[GTA SA] ~ CLEO Script Tutorial ~

631 replies to this topic
EdUaRdO - Brazil
  • EdUaRdO - Brazil

    Brazilian Scripter

  • Members
  • Joined: 14 Nov 2010

#151

Posted 02 December 2010 - 01:15 AM

QUOTE (ZAZ @ Dec 1 2010, 17:16)
QUOTE (EdUaRdO - Brazil @ Dec 1 2010, 01:17)
QUOTE (ZAZ @ Nov 19 2010, 15:26)
QUOTE (EdUaRdO - Brazil @ Nov 14 2010, 02:08)
Awesome work ZAZ....this is very helpfull for all† icon14.gif

thanks EdUaRdO, nice website

Hey ZAZ, you know how to block scripts cleo or prevent it from being decompiled? Why has not some that decompiles Sanny .. was wondering if there's any way to do this .. Tnks

add three unused codelines at the scriptend and then try to find it with hexeditor in the compiled cleo script
you should look for dots before the global variable list start and change one dot with three letters

Thanks. I did. I used the list of upcodes Sanny and SASCM.ini

kmlwin.1996
  • kmlwin.1996

    Hold upô

  • BUSTED!
  • Joined: 11 May 2010

#152

Posted 04 January 2011 - 12:00 PM

Hey! ZAZ!

Please tell me how we need to use collision. I don't understand some codes of yours. It is full of mathematics coding.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#153

Posted 04 January 2011 - 06:53 PM

QUOTE (kmlwin.1996 @ Jan 4 2011, 12:00)
Hey! ZAZ!

Please tell me how we need to use collision. I don't understand some codes of yours. It is full of mathematics coding.

1. Objects which works for collisions-check with builings, ground, cars, peds and objects
there are only a few objects which works for fully collisions check
the others can't check buildings and ground
below the useful objects:


ID number, model name

1598, beachball
3065, BBALL_col
2891, kmb_packet
3054, DYN_WREKING_BALL
1305, dyn_quarryrock01
1582, pizzabox, prop_pizzabox

They have a standart collisionsfunction by default, they are explosion dynamical, throwable, and works for collisionscheck

Take the beachball or the BBALL_col, they have settings in object.dat
you can add an object reference in object.dat if it still not exist there
with the same settings of BBALL_col to give your object the required behavior for full collisions check
CODE
data\object.dat

bball_col  10.0,  10.0  1.00,  0.3,  50.0,  0.0,  0.1, 0, 2, 1,  0, 0, 0.0, 0.0, 0.0,  none


Or use 2 objects, one which should be shown like a rocket and one which works with full collisions check like BBALL_col,
then attach the rocket to the BBALL_col, make BBALL_col unvisible and throw it and do a collisions check for BBALL_col
CODE
if
04DA:   has_object 1@ collided
jf @next


2. moveable object for collisions check need further settings
Mostly it needs to throw the object with 0381: throw_object
furthermore codes to activate collisions check and to make it movable

CODE
04D9: object 1@ set_scripted_collision_check 1

0392: make_object 1@ moveable 1
0381: throw_object 1@ velocity_in_direction 15@ 16@ 18@



3. throw object
As first a simple examplescript to throw an object

CODE
{$CLEO .cs}
:Objectthrow_0
03A4: name_thread 'OTHROW'

:Objectthrow_1
0001: wait  0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Objectthrow_1
if
0AB0:   key_pressed 8//-----------------------------press backspace  
004D: jump_if_false @Objectthrow_1
0247: request_model 3054

:Objectthrow_3
0001: wait  0 ms
00D6: if  0
0248:   model 3054  available
004D: jump_if_false @Objectthrow_3
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset  0.0 5.0  0.0
0107: 1@ = create_object 3054  at  11@ 12@ 13@
0906: set_object 1@ mass_to 300.0 // float
0908: set_object 1@ turn_mass_to 300
04D9: object 1@ set_scripted_collision_check  1
0382: set_object 1@ collision_detection  1
wait  2000
0392: object 1@ toggle_in_moving_list  1
0381: throw_object 1@ distance 0.0  5.0  15.0
wait  5000
Object.Destroy(1@)
0249: release_model 3054
0002: jump @Objectthrow_1



the throw-object-opcode
0381: throw_object 1@ distance 0.0 5.0 15.0
requires x,y,z, float values which gives the orientation in relation to the object for the throwing
but the orientation itself of the object is ignored
so the example above (0.0 5.0 15.0) let the object move 5.0 in direction north and 15.0 in the height

to get the values for the throw_object opcode needs to read the player z-angle and calculate it with sin and cosin


The script below throws the beachball which keeps the position by collision for 1 second
press right mouse button to throw it
CODE
{$CLEO .cs}
:Objectthrow_0
03A4: name_thread 'OTHROW'
//1598, beachball

:Objectthrow_1
wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Objectthrow_1
if
0AB0:   key_pressed 2//-----------------------------press right mouse button
004D: jump_if_false @Objectthrow_1
0247: request_model 1598

:Objectthrow_3
wait  0 ms
if
0248:   model 1598  available
004D: jump_if_false @Objectthrow_3
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset  0.0 2.0  0.5
0107: 1@ = create_object 1598  at  11@ 12@ 13@
0750: set_object 1@ visibility 1
04D9: object 1@ set_scripted_collision_check 1
0382: set_object 1@ collision_detection 1
0906: set_object 1@ mass_to 30000.0 // float
0908: set_object 1@ turn_mass_to 30000.0 // float

0172: 19@ = actor $PLAYER_ACTOR Z_angle
0453: set_object 1@ XY_rotation 0.0 0.0 angle 19@
02F6: 15@ = sine 19@ // (float)
02F7: 16@ = cosine 19@ // (float)
15@ *= 60.0 // (float)
16@ *= 60.0 // (float)
15@ *= -1.0
0819: 18@ = actor $PLAYER_ACTOR distance_from_ground
18@ += 3.0 // (float)
0392: make_object 1@ moveable 1
0381: throw_object 1@ velocity_in_direction 15@ 16@ 18@
33@ = 0

:Objectthrow_5
wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Objectthrow_13
0400: store_coords_to 11@ 12@ 13@ from_object 1@ with_offset 0.0 -2.0 0.0
0381: throw_object 1@ velocity_in_direction 15@ 16@ 18@
if or
04DA:   has_object 1@ collided
8474:   not actor $PLAYER_ACTOR near_object_in_cube 1@ radius 200.0 200.0 200.0 flag 0
0019:   33@ > 7000
004D: jump_if_false @Objectthrow_5
0392: make_object 1@ moveable 0
0382: set_object 1@ collision_detection 0
00A1: put_actor $PLAYER_ACTOR at 11@ 12@ 13@
wait  1000 ms
0392: make_object 1@ moveable 1
0382: set_object 1@ collision_detection 1
wait  1000 ms

:Objectthrow_13
0108: destroy_object 1@
0249: release_model 1598
0002: jump @Objectthrow_1





one more example, the Missilescript, below
press backspace to throw bball_col with attached missile
if bball_col collide, the script let the engine read the position of the object and do explosions at this point


CODE
{$CLEO .cs}
:Missile
thread 'MISSILE'

:MISSILE_11
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @MISSILE_11
if
0AB0:   key_pressed 8
jf @MISSILE_11
Model.Load(3065)
Model.Load(3786)

:MISSILE_56
wait 0
if and
  Model.Available(3065)
  Model.Available(3786)
jf @MISSILE_56
2@ = Actor.Angle($PLAYER_ACTOR)
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 1.0 -0.5 1.3
1@ = Object.Create(3065, 11@, 12@, 13@)
2@ += 270.0
Object.Angle(1@) = 2@
0750: set_object 1@ visibility 0
19@ = Object.Create(3786, 0.0, 0.0, 0.0)
Object.Angle(19@) = 2@
04D9: object 1@ set_scripted_collision_check 1
Object.CollisionDetection(1@) = True
0906: set_object 1@ mass_to 30000.0 // float
0908: set_object 1@ turn_mass_to 30000.0 // float
069A: attach_object 19@ to_object 1@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0
Object.CollisionDetection(19@) = False
2@ = Actor.Angle($PLAYER_ACTOR)
0819: 18@ = actor $PLAYER_ACTOR distance_from_ground
4@ = 80.1
02F6: 5@ = cosine 2@ // (float)
02F7: 6@ = sine 2@ // (float)
006B: 5@ *= 4@ // (float)
006B: 6@ *= 4@ // (float)
5@ *= -1.0
18@ += 1.0
Object.ToggleInMovingList(1@) = True
Object.Throw(1@, 5@, 6@, 18@)
33@ = 0

:MISSILE_376
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @MISSILE_376
0400: store_coords_to 11@ 12@ 13@ from_object 1@ with_offset 0.0 0.0 0.0
095C: create_smoke_at 11@ 12@ 13@ velocity 0.0 0.0 0.0 RGBA 1.0 1.0 1.0 1.0 size 0.5 last_factor 0.1
if or
04DA:   has_object 1@ collided
 33@ > 7000
jf @MISSILE_376
0400: store_coords_to 11@ 12@ 13@ from_object 1@ with_offset 0.0 0.0 0.0
020C: create_explosion_with_radius 3 at 11@ 12@ 13@
0565: create_soundless_explosion_at 11@ 12@ 13@ type 5
0400: store_coords_to 11@ 12@ 13@ from_object 1@ with_offset 5.0 0.0 0.0
020C: create_explosion_with_radius 3 at 11@ 12@ 13@
0565: create_soundless_explosion_at 11@ 12@ 13@ type 5
0400: store_coords_to 11@ 12@ 13@ from_object 1@ with_offset -5.0 0.0 0.0
020C: create_explosion_with_radius 3 at 11@ 12@ 13@
0565: create_soundless_explosion_at 11@ 12@ 13@ type 5
0400: store_coords_to 11@ 12@ 13@ from_object 1@ with_offset 0.0 5.0 0.0
020C: create_explosion_with_radius 3 at 11@ 12@ 13@
0565: create_soundless_explosion_at 11@ 12@ 13@ type 5
0400: store_coords_to 11@ 12@ 13@ from_object 1@ with_offset 0.0 -5.0 0.0
020C: create_explosion_with_radius 3 at 11@ 12@ 13@
0565: create_soundless_explosion_at 11@ 12@ 13@ type 5
Model.Destroy(3065)
Model.Destroy(3786)
095C: create_smoke_at 11@ 12@ 13@ velocity 0.0 0.0 0.0 RGBA 0.0 0.0 0.0 0.2 size 3.0 last_factor 0.1
0682: detach_object 19@ 0.0 0.0 0.0 collision_detection 1
Object.Destroy(1@)
Object.Destroy(19@)
jump @MISSILE_11



The script checks the collision and the time
CODE
if or
04DA:   has_object 1@ collided
 33@ > 7000
jf @MISSILE_376


If the object don't collide, the timer 33@ let the script end and restart after 7 seconds


kmlwin.1996
  • kmlwin.1996

    Hold upô

  • BUSTED!
  • Joined: 11 May 2010

#154

Posted 05 January 2011 - 04:32 AM

Great Tut. smile.gif biggrin.gif cool.gif inlove.gif

Sometimes, I wonder how you can write a lot of codes. I want to do that like you but I cannot. Sometimes, I write some codes. Sometimes, they work. Sometimes, they crash. I want to be like you. But I am from Myanmar, you are from Germany. We are sooo... far. I want to be your pupil. If I can. sad.gif Plz tell me how you write a lot of codes. Explain me!

Ops! One thing, how to put missions into scm?


<<by patrickW: merged tripple post>>

ZAZ
  • ZAZ

    Kernlochbohrer

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

#155

Posted 05 January 2011 - 04:33 PM Edited by ZAZ, 16 January 2011 - 04:49 AM.

QUOTE (kmlwin.1996 @ Jan 5 2011, 04:32)
Great Tut.  smile.gif   biggrin.gif   cool.gif   inlove.gif

Sometimes, I wonder how you can write a lot of codes. I want to do that like you but I cannot. Sometimes, I write some codes. Sometimes, they work. Sometimes, they crash. I want to be like you. But I am from Myanmar,  you are from Germany.  We are sooo... far. I want to be your pupil. If I can.  sad.gif   Plz tell me how you write a lot of codes. Explain me!

Ops! One thing, how to put missions into scm?


<<by patrickW: merged tripple post>>


I do that since 5 years, reading informations like tutorials, posts of mission coding as well as the scripts of main.scm and find methods by trial and error. It need the mood to do it.
I had very often problems and was going mad because i could not find the failure. But instead asking in the forum i tried it the next day and then it was easy to solve a simple problem.

how to put missions into scm isn't a cleo theme, read Dutchys Tut or ask in mission coding forum

gtasite1
  • gtasite1

    Player Hater

  • Members
  • Joined: 24 Dec 2010

#156

Posted 18 January 2011 - 01:31 PM

And I have a question, how to build a script to use one button to fly the car and the two buttons to control the amount of eg 1-down, 2-up to not have to type the code RIPAZHA?

ZAZ
  • ZAZ

    Kernlochbohrer

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

#157

Posted 18 January 2011 - 04:17 PM

QUOTE (gtasite1 @ Jan 18 2011, 13:31)
And I have a question, how to build a script to use one button to fly the car and the two buttons to control the amount of eg 1-down, 2-up to not have to type the code RIPAZHA?

cheat RIPAZHA = Cars Fly

memadress
0x969160 - Cars can Fly
it needs to find and set the working value into this memadress

read the theme read memory

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#158

Posted 18 January 2011 - 06:57 PM

QUOTE (ZAZ @ Jan 18 2011, 17:17)
0x969160 - Cars can Fly
it needs to find and set the working value into this memadress

It should be a bool, so values are 0 and 1 tounge.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#159

Posted 18 January 2011 - 09:43 PM

QUOTE (SilentPL @ Jan 18 2011, 18:57)
QUOTE (ZAZ @ Jan 18 2011, 17:17)
0x969160 - Cars can Fly
it needs to find and set the working value into this memadress

It should be a bool, so values are 0 and 1 tounge.gif

Thx, i didn't try it. Do all cheat-mems work with bool?

gtasite1
  • gtasite1

    Player Hater

  • Members
  • Joined: 24 Dec 2010

#160

Posted 20 January 2011 - 09:12 AM

OK. I am using this code
QUOTE
0A8C: write_memory 9867616 size 4 value 10.0 virtual_protect 1
, but I like trying to fly a car, nothing happens. But it' s something you try to think. And I have a question about the pager from GTA 3 to GTA SA in the sense of a script in cleo I use this code

QUOTE
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder....files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
thread 'PAGER'
0000: NOP
wait 5000
0@ = -64.0
1@ = 64.0
0390: load_txd_dictionary 'PAGER'
038F: load_texture "PAGER" as 1 // Load dictionary with 0390 first
Audiostream.Load($PAGER, "CLEO\GTA3PAGER.MP3")
Audiostream.PerformAction($PAGER, PLAY)

:PAGER_92
03F0: enable_text_draw 1
038D: draw_texture 1 position 0@ 60.67 size 128.0 119.47 RGBA 255 255 255 255
03E3: set_texture_to_be_drawn_antialiased 1

:PAGER_134
wait 0
if
  not 0@ > 64.0
jf @PAGER_181
0@ += 2.0
jump @PAGER_92
0AB2: ret 0

:PAGER_181
wait 0
if
  not 0@ == 64.0
jf @PAGER_218
jump @PAGER_92
0AB2: ret 0

:PAGER_218
jump @PAGER_134
0A93: end_custom_thread

, but when the pager is able to spot flashes and do not know what to do. We tried to fix it with a friend but it was even worse. And here a link to the entire module
http://www.przeklej.pl/plik/pulpit-rar-0025tk6177tb

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#161

Posted 20 January 2011 - 03:41 PM

QUOTE (ZAZ @ Jan 18 2011, 22:43)
Thx, i didn't try it. Do all cheat-mems work with bool?

Some are function calls, the rest should work as a bool.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#162

Posted 20 January 2011 - 03:59 PM

QUOTE (SilentPL @ Jan 20 2011, 15:41)
QUOTE (ZAZ @ Jan 18 2011, 22:43)
Thx, i didn't try it. Do all cheat-mems work with bool?

Some are function calls, the rest should work as a bool.

well, i changed the gravity-mem to 2 and everything was hovering
then i tried a float and caused a crazy world where the trees has bended very much
and to restore the gravity to normal world needs to change it to 1006834287

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#163

Posted 20 January 2011 - 04:01 PM Edited by SilentPL, 20 January 2011 - 04:45 PM.

Well, I never tested that memory adress in single player, but (according to SA-MP and MTA) it is a float, and default gravity is 0.008.

Edit:
Checked it now, and it is a float, default is 0.008 smile.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#164

Posted 21 January 2011 - 12:13 PM

QUOTE (SilentPL @ Jan 20 2011, 16:01)
Well, I never tested that memory adress in single player, but (according to SA-MP and MTA) it is a float, and default gravity is 0.008.

Edit:
Checked it now, and it is a float, default is 0.008 smile.gif

question: are you the reincarnation of plpython?

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#165

Posted 21 January 2011 - 02:06 PM

QUOTE (ZAZ @ Jan 21 2011, 13:13)
question: are you the reincarnation of plpython?

Hmm, you're the third (fourth?) guy that asks me that. No, I'm not PLPynton tounge.gif

The main difference:

QUOTE (My profile)
Birthday: 5 March 1995


QUOTE (PLPynton's profile)
Birthday: 31 May 1978

rieman
  • rieman

    Player Hater

  • Members
  • Joined: 21 Jan 2011

#166

Posted 21 January 2011 - 02:51 PM

hey, i was just wandering wether this cleo thing would be able to help me script a vehicle so it cau use the wepons that i have put onto it. if so i was wondering wether i could find any 1 who would be willing to have 60% of the credit for me releasing a vehicle with working weapons.

achil
  • achil

    Converting the Third Reich into GTA SA

  • Members
  • Joined: 22 Nov 2010

#167

Posted 22 January 2011 - 01:13 PM

jesus pretty big but usefull tounge2.gif

you have much future at your life

gtasite1
  • gtasite1

    Player Hater

  • Members
  • Joined: 24 Dec 2010

#168

Posted 22 January 2011 - 07:55 PM

sh*t f*ck me

gtasite1
  • gtasite1

    Player Hater

  • Members
  • Joined: 24 Dec 2010

#169

Posted 25 January 2011 - 09:54 AM Edited by gtasite1, 25 January 2011 - 09:57 AM.

I use this main.scm in Open Vice, but my game is crashed I goto to Tommy hotel

http://www.sendspace...c2658ffcd193c70

Please help me. Please help me cryani.gif

EdUaRdO - Brazil
  • EdUaRdO - Brazil

    Brazilian Scripter

  • Members
  • Joined: 14 Nov 2010

#170

Posted 09 February 2011 - 01:55 AM

How do I remove any money from CJ. I made the following way, did the first confirmation of the amount of money, then put the opcode 0109 is as follows:

CODE
010B: $TOTAL_MONEY = player $PLAYER_CHAR money
0038:  $TOTAL_MONEY _2 == $TOTAL_MONEY
000C: $TOTAL_MONEY -= $TOTAL_MONEY _2  
0109: player $PLAYER_CHAR money += $TOTAL_MONEY


But I think this error in the values of the calculations, and tried to use the opcode 0AD3, but failed, thus: suicidal.gif
CODE

010B: $TOTAL_MONEY = player $PLAYER_CHAR money
0038:   $TOTAL_MONEY _2 == $TOTAL_MONEY  
000C: $TOTAL_MONEY -= $TOTAL_MONEY _2  
0AD3: $TOTAL_MONEY _3 = format "$TOTAL_MONEY _2 + $TOTAL_MONEY = $TOTAL_MONEY _4" 2 2 4
0109: player $PLAYER_CHAR money += $TOTAL_MONEY_4


If you can help me, I'll be grateful icon14.gif

martincho
  • martincho

    Player Hater

  • Members
  • Joined: 12 Jan 2011

#171

Posted 09 February 2011 - 02:17 AM

I want to create a flashlight for weapons like the mod Ryosuke "accesory" And that can be activated by pressing the letter "Y" can you help me?
sorry I'm noob ...

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#172

Posted 09 February 2011 - 11:36 AM Edited by SilentPL, 09 February 2011 - 11:40 AM.

QUOTE (EdUaRdO - Brazil @ Feb 9 2011, 02:55)
How do I remove any money from CJ. I made the following way, did the first confirmation of the amount of money, then put the opcode 0109 is as follows:

CODE
010B: $TOTAL_MONEY = player $PLAYER_CHAR money
0038: †$TOTAL_MONEY _2 == $TOTAL_MONEY
000C: $TOTAL_MONEY -= $TOTAL_MONEY _2 †
0109: player $PLAYER_CHAR money += $TOTAL_MONEY


But I think this error in the values of the calculations, and tried to use the opcode 0AD3, but failed, thus: suicidal.gif
CODE

010B: $TOTAL_MONEY = player $PLAYER_CHAR money
0038: † $TOTAL_MONEY _2 == $TOTAL_MONEY †
000C: $TOTAL_MONEY -= $TOTAL_MONEY _2 †
0AD3: $TOTAL_MONEY _3 = format "$TOTAL_MONEY _2 + $TOTAL_MONEY = $TOTAL_MONEY _4" 2 2 4
0109: player $PLAYER_CHAR money += $TOTAL_MONEY_4


If you can help me, I'll be grateful icon14.gif

You did it a bit wrong.

CODE
010B: 0@ = player 0 money
0012: 0@ *= -1
0109: player 0 money += 0@



QUOTE
I want to create a flashlight for weapons like the mod Ryosuke "accesory" And that can be activated by pressing the letter "Y" can you help me?
sorry I'm noob ...


Tricky business, which need tons of calculations and ATAN function in SCM.


@ZAZ
Sorry for topic steal, I can surely stop doing that smile.gif

EdUaRdO - Brazil
  • EdUaRdO - Brazil

    Brazilian Scripter

  • Members
  • Joined: 14 Nov 2010

#173

Posted 09 February 2011 - 09:39 PM Edited by EdUaRdO - Brazil, 09 February 2011 - 10:32 PM.

wow.gif wow.gif wow.gif
Very thanks SilentPL....is very simple,,,, and i making totally wrong sad.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#174

Posted 10 February 2011 - 09:01 PM

QUOTE (martincho @ Feb 9 2011, 02:17)
I want to create a flashlight for weapons like the mod Ryosuke "accesory" And that can be activated by pressing the letter "Y" can you help me?
sorry I'm noob ...

Ryosukes methods are for advanced coding. If you're a noob so start >here<

martincho
  • martincho

    Player Hater

  • Members
  • Joined: 12 Jan 2011

#175

Posted 11 February 2011 - 12:30 AM

QUOTE (ZAZ @ Feb 10 2011, 21:01)
QUOTE (martincho @ Feb 9 2011, 02:17)
I want to create a flashlight for weapons like the mod Ryosuke "accesory" And that can be activated by pressing the letter "Y" can you help me?
sorry I'm noob ...

Ryosukes methods are for advanced coding. If you're a noob so start >here<

ok thanks!

gtasite1
  • gtasite1

    Player Hater

  • Members
  • Joined: 24 Dec 2010

#176

Posted 12 February 2011 - 02:33 PM

@ZAZ main.scm or you can create that will contain all the side missions, all mini-games but without the main story for GTA SA, or can I use your module if you do so main.scm without a main thread. I asked because I do not have too much head as clear is how you do it send me this file to the PM. Thanks in advance. biggrin.gif

EdUaRdO - Brazil
  • EdUaRdO - Brazil

    Brazilian Scripter

  • Members
  • Joined: 14 Nov 2010

#177

Posted 13 February 2011 - 12:15 AM Edited by EdUaRdO - Brazil, 13 February 2011 - 12:17 AM.

QUOTE (gtasite1 @ Feb 12 2011, 14:33)
@ZAZ main.scm or you can create that will contain all the side missions, all mini-games but without the main story for GTA SA, or can I use your module if you do so main.scm without a main thread. I asked because I do not have too much head as clear is how you do it send me this file to the PM. Thanks in advance.† biggrin.gif

Yes there is a way to remove the missions and maintain the external scripts ... follow the example below:

CODE

DEFINE MISSIONS 0 † //thi define zero missions in main
DEFINE EXTERNAL_SCRIPTS 78 // here put the external script number....original †is 78
DEFINE UNKNOWN_EMPTY_SEGMENT 0

DEFINE UNKNOWN_THREADS_MEMORY 574
{$VERSION 3.0.0000}

//-------------MAIN---------------
03A4: name_thread 'MAIN'
01F0: set_max_wanted_level_to 6
0111: toggle_wasted_busted_check 0
00C0: set_current_time_hours_to 8 minutes_to 0
04E4: unknown_refresh_game_renderer_at 2488.56 -1666.84
03CB: set_rendering_origin_at 2488.56 -1666.84 13.38
0053: $PLAYER_CHAR = create_player #NULL at 2488.56 -1666.84 13.38
01F5: $PLAYER_ACTOR = create_player_actor $PLAYER_CHAR
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
0373: set_camera_directly_behind_player
01B6: set_weather 0
0001: wait 0 ms
087B: set_player $PLAYER_CHAR clothes_texture "PLAYER_FACE" model "HEAD" body_part 1
087B: set_player $PLAYER_CHAR clothes_texture "JEANSDENIM" model "JEANS" body_part 2
087B: set_player $PLAYER_CHAR clothes_texture "SNEAKERBINCBLK" model "SNEAKER" body_part 3
087B: set_player $PLAYER_CHAR clothes_texture "VEST" model "VEST" body_part 0
070D: rebuild_player $PLAYER_CHAR
01B4: toggle_player $PLAYER_CHAR can_move 1
016A: fade 1 time 0
04BB: select_interior 0
0629: change_integer_stat 181 to 4
016C: restart_if_wasted_at 2027.77 -1420.52 15.99 angle 137.0 town_number 0
016D: restart_if_busted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0
0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here
0004: $DEFAULT_WAIT_TIME = 250
03E6: remove_text_box

// put your create_thread commands here

:MISSAO_PRINCIPAL
0001: wait 0 ms
0256: † player $PLAYER_CHAR defined
004D: jump_if_false @MISSAO_PRINCIPAL
0001: wait 0 ms
0002: jump @MISSAO_PRINCIPAL


// put your mods (threads) here


//-------------Mission 0---------------
// put your missions here



//-------------External script 0---------------
// It lets you down like the original, it is here that have the external scripts
//ex:
//-------------External script 1 (WARDROBE)---------------

:WARROBE
//comands here


The script will be so great, why not post it in full here
That was your question?
biggrin.gif

gtasite1
  • gtasite1

    Player Hater

  • Members
  • Joined: 24 Dec 2010

#178

Posted 13 February 2011 - 10:27 AM Edited by gtasite1, 13 February 2011 - 10:50 AM.

ok tkanks. I am found this file http://zazmahall.de/.....Stripped Main

But my question is how to edit the sannybuilder main.scm 3.04 and play on the old record of the game? mercie_blink.gif mercie_blink.gif mercie_blink.gif mercie_blink.gif mercie_blink.gif

AND how to use this array with spawn actors
CODE
$2701 = 0

:INITIAL_19059
if
 6 > $2701
jf @INITIAL_19159
$2671($2701,6i) = Object.Create(#PORTAKABIN, $2677($2701,6f), $2683($2701,6f), $2689($2701,6f))
Object.Angle($2671($2701,6i)) = $2695($2701,6f)
Object.ToggleInMovingList($2671($2701,6i)) = False
Object.RemoveFromMissionCleanupList($2671($2701,6i))
$2701 += 1
jump @INITIAL_19059

:INITIAL_19159

EdUaRdO - Brazil
  • EdUaRdO - Brazil

    Brazilian Scripter

  • Members
  • Joined: 14 Nov 2010

#179

Posted 13 February 2011 - 04:34 PM Edited by EdUaRdO - Brazil, 13 February 2011 - 05:03 PM.

QUOTE (gtasite1 @ Feb 13 2011, 10:27)
ok tkanks. I am found this file http://zazmahall.de/.....Stripped Main

But my question is how to edit the sannybuilder main.scm 3.04 and play on the old record of the game?† mercie_blink.gifmercie_blink.gifmercie_blink.gifmercie_blink.gifmercie_blink.gif

AND how to use this array with spawn actors
CODE
$2701 = 0

:INITIAL_19059
if
†6 > $2701
jf @INITIAL_19159
$2671($2701,6i) = Object.Create(#PORTAKABIN, $2677($2701,6f), $2683($2701,6f), $2689($2701,6f))
Object.Angle($2671($2701,6i)) = $2695($2701,6f)
Object.ToggleInMovingList($2671($2701,6i)) = False
Object.RemoveFromMissionCleanupList($2671($2701,6i))
$2701 += 1
jump @INITIAL_19059

:INITIAL_19159

Play with the old records, I think it is not be done

This is part of creating objects, you need to create actors use other opcodes:

CODE
009A: @TEST_ACTOR = create_actor_pedtype 8 model #FAM2 at 2483.1711 -1650.733 13.4687
0223: set_actor @TEST_ACTOR health_to 250
0173: set_actor @TEST_ACTOR Z_angle_to 177.6617


You want to create objects near the ped?
So looks like this:
CODE

0107: $2671($2701,6i) = create_object #PORTAKABIN at $2677($2701,6f) $2683($2701,6f) $2689($2701,6f)
0177: set_object $2671($2701,6i) Z_angle_to $2695($2701,6f)
0392: make_object $2671($2701,6i) moveable 0
01C7: remove_object_from_mission_cleanup_list $2671($2701,6i)
0400: store_coords_to 20@ 21@ 22@ from_object $2671($2701,6i) with_offset 0.0 4.0 0.0
01C7: remove_object_from_mission_cleanup_list $2671($2701,6i)
009A: $ACTOR_TEST = create_actor_pedtype 8 model #FAM2 at 20@ 21@ 22@
0223: set_actor $ACTOR_TEST health_to 250
0173: set_actor $ACTOR_TEST Z_angle_to 177.6617


but before you need to set the coordinates to create the object
You need put the ID of object, not the name...
but this is a hard way to do this, you can try this way:
(This is one example of create object and ped at Groove, and the actor dancing)



CODE
//-------------MAIN---------------
03A4: name_thread 'OBJECT_PED'
0007: $COORD_X = 2491.2278
0007: $COORD_Y = -1672.2573
0007: $COORD_Z = 13.3359
0007: $RADIUS = 80.0
0007: $ANGULO = 0.0  

:OBJECT_PED_69
0001: wait 0 ms
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @OBJECT_PED_69
0001: wait 0 ms
00D6: if
0038:   $ONMISSION == 0
004D: jump_if_false @OBJECT_PED_69
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @OBJECT_PED_69
00D6: if
0007: $COORD_X = 2491.2278
0007: $COORD_Y = -1672.2573
0007: $COORD_Z = 13.3359
0007: $RADIUS = 80.0
0007: $ANGULO = 0.0
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere $COORD_X $COORD_Y $COORD_Z radius $RADIUS $RADIUS $RADIUS
004D: jump_if_false @OBJECT_PED_69
0247: load_model 1684
0247: load_model #FAM2
04ED: load_animation "DANCING"


:OBJECT_PED_171
0001: wait 0 ms
00D6: if and
0248:   model 1684 available
0248:   model #FAM2 available
04EE:   animation "DANCING" loaded
0007: $COORD_X = 2491.2278
0007: $COORD_Y = -1672.2573
0007: $COORD_Z = 12.3359
0007: $RADIUS = 80.0
0007: $ANGULO = 0.0
004D: jump_if_false @OBJECT_PED_171
0107: $OBJECT = create_object 1684 at $COORD_X $COORD_Y $COORD_Z
0177: set_object $OBJECT Z_angle_to $ANGULO
0392: make_object $OBJECT moveable 0
01C7: remove_object_from_mission_cleanup_list $OBJECT
0400: store_coords_to 20@ 21@ 22@ from_object $OBJECT with_offset $ANGULO $ANGULO 5.0
01C7: remove_object_from_mission_cleanup_list $2671($2701,6i)
009A: $ACTOR_TEST = create_actor_pedtype 8 model #FAM2 at 20@ 21@ 22@
0223: set_actor $ACTOR_TEST health_to 250
0173: set_actor $ACTOR_TEST Z_angle_to $ANGULO
0812: AS_actor $ACTOR_TEST perform_animation "DAN_Loop_A" IFP_file "DANCING" 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB
0001: wait 5000 ms
0249: release_model 1684
0249: release_model #FAM2
04EF: release_animation "DANCING"

:OBJECT_PED_311
0001: wait 0 ms
00D6: if
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere $COORD_X $COORD_Y $COORD_Z radius $RADIUS $RADIUS $RADIUS
004D: jump_if_false @OBJECT_PED_384
0001: wait 0 ms
00D6: if
0038:   $ONMISSION == 0
004D: jump_if_false @OBJECT_PED_384
0001: wait 0 ms
0002: jump @OBJECT_PED_311

:OBJECT_PED_384
0108: destroy_object $OBJECT
009B: destroy_actor $ACTOR_TEST
0002: jump @OBJECT_PED_69


I hope I have helped you
Sorry my english lol.gif

gtasite1
  • gtasite1

    Player Hater

  • Members
  • Joined: 24 Dec 2010

#180

Posted 13 February 2011 - 05:59 PM

ok tkanks




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users