Quantcast

Jump to content

» «
Photo

[SA] ~ CLEO Script Tutorial ~

871 replies to this topic
pug103
  • pug103

    Player Hater

  • Members
  • Joined: 01 Apr 2014
  • United-Kingdom

#631

Posted 07 May 2014 - 10:53 PM

hi is there a way you could create a script I have the knight rider v0.4b and could you make a script where you press a button like s and a marker comes on your map and it is the semi driving around the city and the player has the choice of opening or closing the ramp and could you add a attachment script so kitt will not fall out thanks


6Four9
  • 6Four9

    Crackhead

  • Members
  • Joined: 27 Oct 2013
  • Indonesia

#632

Posted 01 June 2014 - 04:25 PM

Wow Nice Tutorial :lol:

thank's for make this Tutorial :santa:

 

i wiil learn it :colgate:


LucassBR
  • LucassBR

    Just testing...

  • Members
  • Joined: 06 Oct 2014
  • Brazil

#633

Posted 06 October 2014 - 10:11 AM Edited by LucassBR, 06 October 2014 - 10:13 AM.

ZAZ, what is this:
0000: NOP

Silent
  • Silent

    Chief Fixing Officer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#634

Posted 06 October 2014 - 03:37 PM

It's a command. Dummy one, doing nothing.

LucassBR
  • LucassBR

    Just testing...

  • Members
  • Joined: 06 Oct 2014
  • Brazil

#635

Posted 12 November 2014 - 12:53 PM

I'm trying to create a small mission
where some actors attack the player on Las Venturas abandoned airport. I used arrays to the actors and give them weapons.
I created this script:
 
{$CLEO .cs}
//Mission "Strangers"
thread 'AIRPORT_MISION'
 
var
0@: array 6 of Integer
end
 
:AIR_1
wait 0
if
Player.Defined($PLAYER_CHAR)
else_jump @AIR_1
 
if
0102:   actor $PLAYER_ACTOR in_sphere 379.6704 2591.3435 16.4844 radius 2.0 2.0 3.0 sphere 1 stopped_on_foot
else_jump @AIR_1
Model.Load(#MAFFA)
Model.Load(#MAFFB)
Model.Load(#M4)
038B: load_models
 
:AIR_2
wait 0
if and
Model.Available(#MAFFA)
Model.Available(#MAFFB)
Model.Available(#M4)
else_jump @AIR_2
 
:AIR_3
fade 0 1000
01B4: set_player $PLAYER_CHAR can_move 0
wait 2000
Actor.PutAt($PLAYER_ACTOR, 255.4008, 2526.3406, 16.7773)
Actor.SetImmunities($PLAYER_ACTOR, 1, 1, 1, 1, 1)
015F: set_camera_position 219.4995 2544.8337 20.852 rotation 0.0 0.0 0.0
0160: set_camera_point_at 216.3297 2571.1814 16.3241 switchstyle 2
fade 1 1000
 
:AIR_4
30@ = 0
29@ = 219.6152 
Actor.Create(0@[30@], 7, #MAFFA, 29@, 2575.9685, 16.3008)
01B2: give_actor 0@[30@] weapon 31 ammo 80000
30@ += 1
29@ -= 2.0
Actor.Create(0@[30@], 7, #MAFFB, 29@, 2575.9685, 16.3008)
01B2: give_actor 0@[30@] weapon 31 ammo 80000
30@ += 1
29@ -= 2.0
Actor.Create(0@[30@], 7, #MAFFA, 29@, 2575.9685, 16.3008)
01B2: give_actor 0@[30@] weapon 31 ammo 80000
30@ += 1
29@ -= 2.0
Actor.Create(0@[30@], 7, #MAFFB, 29@, 2575.9685, 16.3008)
01B2: give_actor 0@[30@] weapon 31 ammo 80000
30@ += 1
29@ -= 2.0
Actor.Create(0@[30@], 7, #MAFFA, 29@, 2575.9685, 16.3008)
01B2: give_actor 0@[30@] weapon 31 ammo 80000
30@ += 1
29@ -= 2.0
Actor.Create(0@[30@], 7, #MAFFB, 29@, 2575.9685, 16.3008)
01B2: give_actor 0@[30@] weapon 31 ammo 80000
 
:AIR_5
30@ = 0
05D3: AS_actor 0@[30@] goto_point 220.5723 2560.1841 16.3672 mode 4 time 6000 ms
30@ += 1
05D3: AS_actor 0@[30@] goto_point 223.6664 2560.9375 16.3672 mode 4 time 6000 ms
30@ += 1
05D3: AS_actor 0@[30@] goto_point 226.49 2561.502 16.3672 mode 4 time 6000 ms
30@ += 1
05D3: AS_actor 0@[30@] goto_point 229.1032 2562.0244 16.3672 mode 4 time 6000 ms
30@ += 1
05D3: AS_actor 0@[30@] goto_point 232.0985 2561.1917 16.3672 mode 4 time 6000 ms
30@ += 1
05D3: AS_actor 0@[30@] goto_point 235.6245 2560.6245 16.3672 mode 4 time 6000 ms
wait 5000
fade 0 1000
wait 1500
01B4: set_player $PLAYER_CHAR can_move 1
02EB: restore_camera_with_jumpcut
Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)
30@ = 0
0634: AS_actor 0@[30@] attack_using_weapon_actor $PLAYER_ACTOR flags 4 perform_actions_after_time 2000 chance_of_action 100
30@ += 1
0634: AS_actor 0@[30@] attack_using_weapon_actor $PLAYER_ACTOR flags 4 perform_actions_after_time 2000 chance_of_action 100
30@ += 1
0634: AS_actor 0@[30@] attack_using_weapon_actor $PLAYER_ACTOR flags 4 perform_actions_after_time 2000 chance_of_action 100
30@ += 1
0634: AS_actor 0@[30@] attack_using_weapon_actor $PLAYER_ACTOR flags 4 perform_actions_after_time 2000 chance_of_action 100
30@ += 1
0634: AS_actor 0@[30@] attack_using_weapon_actor $PLAYER_ACTOR flags 4 perform_actions_after_time 2000 chance_of_action 100
30@ += 1
0634: AS_actor 0@[30@] attack_using_weapon_actor $PLAYER_ACTOR flags 4 perform_actions_after_time 2000 chance_of_action 100
fade 1 1000
Model.Destroy(#MAFFA)
Model.Destroy(#MAFFB)
Model.Destroy(#M4)
 
:AIR_6
wait 0
30@ = 0
if
Actor.Dead(0@[30@])
else_jump @AIR_7
jump @END
 
:AIR_7
30@ = 1
if
Actor.Dead(0@[30@])
else_jump @AIR_8
jump @END
 
:AIR_8
30@ = 2
if
Actor.Dead(0@[30@])
else_jump @AIR_9
jump @END
 
:AIR_9
30@ = 3
if
Actor.Dead(0@[30@])
else_jump @AIR_10
jump @END
 
:AIR_10
30@ = 4
if
Actor.Dead(0@[30@])
else_jump @AIR_11
jump @END
 
:AIR_11
30@ = 5
if
Actor.Dead(0@[30@])
else_jump @AIR_12
jump @END
 
:AIR_12
30@ = 6
if
Actor.Dead(0@[30@])
else_jump @AIR_6
jump @END
 
:END
30@ = 0
01C2: remove_references_to_actor 0@[30@]
30@ += 1
01C2: remove_references_to_actor 0@[30@]
30@ += 1
01C2: remove_references_to_actor 0@[30@]
30@ += 1
01C2: remove_references_to_actor 0@[30@]
30@ += 1
01C2: remove_references_to_actor 0@[30@]
30@ += 1
01C2: remove_references_to_actor 0@[30@]
jump @AIR_1
 
the problem is that after just a short video, the actors do not attack CJ.
Apparently they are released from the script. Can anyone help me with this problem?

 


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#636

Posted 12 November 2014 - 06:12 PM Edited by ZAZ, 12 November 2014 - 06:17 PM.

there's one dead.actor check too much

:AIR_12
30@ = 6
if
Actor.Dead(0@[30@])
else_jump @AIR_6
jump @END

the code jumps to the cleanup as soon as one of the actors dies

there're 6 actor created by arrays with index from 30@ = 0 till 30@ = 5

there're 7 dead.actor checks with index from 30@ = 0 till 30@ = 6

a none existing actor will be emitted as dead actor

 

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

 

my tip for the next time:

add text messages to see what happens

in this case, for example, the code below to the cleanup block

00BA: show_text_styled GXT 'fem_off' time 1000 style 4

then you can make shure that they're released from the script


_RJSingh_
  • _RJSingh_

    RJSanModder

  • Members
  • Joined: 08 Nov 2014
  • India

#637

Posted 08 December 2014 - 10:26 AM

Can someone give me tutorial on how to place machineguns to a rhino!


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#638

Posted 11 December 2014 - 04:13 PM

Can someone give me tutorial on how to place machineguns to a rhino!

try the request topic


GCh4X3
  • GCh4X3

    Player Hater

  • New Members
  • Joined: 17 Dec 2014
  • Australia

#639

Posted 18 December 2014 - 06:02 AM Edited by GCh4X3, 18 December 2014 - 06:52 AM.

-Removed-


GCh4X3
  • GCh4X3

    Player Hater

  • New Members
  • Joined: 17 Dec 2014
  • Australia

#640

Posted 18 December 2014 - 06:22 AM Edited by GCh4X3, 18 December 2014 - 06:52 AM.

-Removed-


GCh4X3
  • GCh4X3

    Player Hater

  • New Members
  • Joined: 17 Dec 2014
  • Australia

#641

Posted 18 December 2014 - 06:51 AM

ZAZ Can you teach me or show me how to delete a  Cleo file, I followed your tut and now i wnat to remove the file i cnat find it anywhere but when i load Sanny Builder and look in the folder i see the fie


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#642

Posted 22 December 2014 - 10:07 AM Edited by ZAZ, 22 December 2014 - 10:13 AM.

ZAZ Can you teach me or show me how to delete a  Cleo file, I followed your tut and now i wnat to remove the file i cnat find it anywhere but when i load Sanny Builder and look in the folder i see the fie

That's a really strange request. Do i understand right that a cleo script appears again and again in your GTA SA\cleo folder? even if you delete it ?
That's not normal
The normal ways to get a cleo script in your cleo folder:
- by installing a mod
- copy or move a file manually
- use sannybuilder, open a script source txt and click on "compile+copy" (or "compile" in case if the source text is alreadfy placed in the cleo folder)

which file does appear by unknown way?
what's your OS?
what's your game version?
what's the install directory of your gta sa?

Kafonix
  • Kafonix

    Furry pride!

  • Members
  • Joined: 16 Jul 2014
  • Germany

#643

Posted 10 January 2015 - 04:07 PM Edited by Wavesittich, 10 January 2015 - 04:09 PM.

First tutorial, the OK script you provided f*cked up my save game and bluescreen'd my computer.

 

Thank you.  

 

nvm, it was the recording program


65536
  • 65536

    Trick

  • Members
  • Joined: 07 Sep 2012
  • Bulgaria

#644

Posted 17 January 2015 - 08:30 PM Edited by 65536, 17 January 2015 - 08:34 PM.

Hey, @ZAZ, I want to make a CLEO that have a two FXT panels aligned horizontally that acts as two separate CLEO menus with 12 lines each and I do can move between them with left / right arrow key navigate and to press Enter / F to exit them. Please say how to do this because I'm working on mod where one panel only won't be enough... I've read your tutorial for making a CLEO menu but couldn't get how to do this...


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#645

Posted 24 January 2015 - 08:01 PM

You can only show one active and one inactiv menue at same time, that's maximum, otherwise you get heavy menue bug -> needs to restart game, same if you make menue failures
08D4: 0@ = create_panel_with_title 'VSPW11' position  230.0 180.0 width  170.0 columns  1 interactive  1 background  1 alignment  0
interactive 1
08D4: 1@ = create_panel_with_title 'VSPW11' position  425.0 180.0 width  170.0 columns  1 interactive  0 background  1 alignment  1
interactive 0
Note: A menue can also have columnes,
can't remember if interactive still worked then,
but i got better results by one active and one inactiv menue like in that
script, study the script of Vehicle Spawner Premium
it's made by one active and one inactiv menue
 
:VehSpawn_MnL_0011
08D4: 0@ = create_panel_with_title 'VSPW10' position  230.0 180.0 width  170.0 columns  1 interactive  1 background  1 alignment  0
08D6: set_panel 0@ column 0 alignment 1
08DB: set_panel 0@ column  0 header 'VSPW10' data 'BF400' 'BIKE' 'BMX' 'MTBIKE' 'FAGGIO' 'FREEWAY' 'FCR900' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy'
09DB: set_panel 0@ column 0 width 170 
08D4: 1@ = create_panel_with_title 'VSPW10' position  425.0 180.0 width  170.0 columns  1 interactive  0 background  1 alignment  1
08D6: set_panel 1@ column 0 alignment 1
08DB: set_panel 1@ column  0 header 'VSPW10' data 'HPV1000' 'NRG500' 'PCJ600' 'PIZZABO' 'QUAD' 'SANCHEZ' 'WAYFARE' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy'
09DB: set_panel 1@ column 0 width 170
090E: set_panel 0@ active_row  0
067C: $PLAYER_ACTOR  0.0  -1.0 3.5  0.0  2.2 0.0 0.0  2//put_camera_on_actor
jump @VehSpawn_MnL_Z

:VehSpawn_MnL_Z
0051: return

mzauqiefs
  • mzauqiefs

    Player Hater

  • Members
  • Joined: 05 Nov 2014
  • Indonesia

#646

Posted 24 January 2015 - 10:12 PM

Hey, @ZAZ, I want to make a CLEO that have a two FXT panels aligned horizontally that acts as two separate CLEO menus with 12 lines each and I do can move between them with left / right arrow key navigate and to press Enter / F to exit them. Please say how to do this because I'm working on mod where one panel only won't be enough... I've read your tutorial for making a CLEO menu but couldn't get how to do this...

how create new opcode?? 


65536
  • 65536

    Trick

  • Members
  • Joined: 07 Sep 2012
  • Bulgaria

#647

Posted 25 January 2015 - 09:51 AM

You can only show one active and one inactiv menue at same time, that's maximum, otherwise you get heavy menue bug -> needs to restart game, same if you make menue failures

08D4: 0@ = create_panel_with_title 'VSPW11' position  230.0 180.0 width  170.0 columns  1 interactive  1 background  1 alignment  0
interactive 1
08D4: 1@ = create_panel_with_title 'VSPW11' position  425.0 180.0 width  170.0 columns  1 interactive  0 background  1 alignment  1
interactive 0
Note: A menue can also have columnes,
can't remember if interactive still worked then,
but i got better results by one active and one inactiv menue like in that
script, study the script of Vehicle Spawner Premium
it's made by one active and one inactiv menue
 
:VehSpawn_MnL_0011
08D4: 0@ = create_panel_with_title 'VSPW10' position  230.0 180.0 width  170.0 columns  1 interactive  1 background  1 alignment  0
08D6: set_panel 0@ column 0 alignment 1
08DB: set_panel 0@ column  0 header 'VSPW10' data 'BF400' 'BIKE' 'BMX' 'MTBIKE' 'FAGGIO' 'FREEWAY' 'FCR900' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy'
09DB: set_panel 0@ column 0 width 170 
08D4: 1@ = create_panel_with_title 'VSPW10' position  425.0 180.0 width  170.0 columns  1 interactive  0 background  1 alignment  1
08D6: set_panel 1@ column 0 alignment 1
08DB: set_panel 1@ column  0 header 'VSPW10' data 'HPV1000' 'NRG500' 'PCJ600' 'PIZZABO' 'QUAD' 'SANCHEZ' 'WAYFARE' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy'
09DB: set_panel 1@ column 0 width 170
090E: set_panel 0@ active_row  0
067C: $PLAYER_ACTOR  0.0  -1.0 3.5  0.0  2.2 0.0 0.0  2//put_camera_on_actor
jump @VehSpawn_MnL_Z

:VehSpawn_MnL_Z
0051: return

 

I tried this unfortunatelly my game shows two menus, but the second menu is still non-selectable and when iI choose anything from the first menu, the second remains on screen and I can't put the focus on it, so can't close it at all. I still don't know what opcode sets the shortcuts to activates navigating in multi-menus! I might have

 

This is my object spawner script:

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

{$VERSION 3.1.0027}
{$CLEO .CS}

//-------------MAIN---------------
0000: NOP 

:NONAME_6
wait 0 
if 
   Player.Defined(0)
0ADC:   test_cheat "WIDEBRIDGE1"
jf @NONAME_6 
Player.CanMove($PLAYER_CHAR) = False
08D4: 1@ = create_panel_with_title 'WIDEBRI' position 20.0 20.0 width 300.0 columns 1 interactive 1 background 1 alignment 0 
08DB: set_panel 1@ column 0 header 'DUMMY' data 'WIDEBR0' 'WIDEBR1' 'WIDEBR2' 'WIDEBR3' 'WIDEBR4' 'WIDEBR5' 'WIDEBR6' 'WIDEBR7' 'WIDEBR8' 'WIDEBR9' 'WIDEB10' 'BUINEX'  
jump @NONAME_190 
        
:NONAME_190
wait 0 
if 
00E1:   player 0 pressed_key 16 
jf @NONAME_190 
08D7: 1@ = panel 0@ active_row 
if 
  1@ == 0 
jf @NONAME_5282 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 638 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5282
wait 0 
if 
  1@ == 1 
jf @NONAME_5343 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 640 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5343
wait 0 
if 
  1@ == 2 
jf @NONAME_5404 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 1597 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5404
wait 0 
if 
  1@ == 3 
jf @NONAME_5465 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 3660 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5465
wait 0 
if 
  1@ == 4 
jf @NONAME_5526 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 3811 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5526
wait 0 
if 
  1@ == 5 
jf @NONAME_5587 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 3806 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5587
wait 0 
if
  1@ == 11 
jf @NONAME_634 
00BE: text_clear_all 
08DA: remove_panel 0@ 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_6 

:NONAME_634
wait 0 
if  
  1@ == 6 
jf @NONAME_5691 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 10821
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5691
wait 0 
if 
  1@ == 7 
jf @NONAME_5752 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 10820 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5752
wait 0 
if 
  1@ == 8 
jf @NONAME_5813 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 17003 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5813
wait 0 
if 
  1@ == 9 
jf @NONAME_5874 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 17629 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

:NONAME_5874
wait 0 
if 
  1@ == 10 
jf @NONAME_939 
00BE: text_clear_all 
08DA: remove_panel 0@ 
10@ = 17622 
29@ = 1.0 
Player.CanMove($PLAYER_CHAR) = True
jump @NONAME_939 

wait 0 
if 
:NONAME_939
wait 0 
Model.Load(10@)
038B: load_requested_models 
jump @NONAME_957 

:NONAME_957
wait 0 
if 
   Model.Available(10@)
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 40.0 0.0 
14@ = Object.Init(10@, 11@, 12@, 13@)
wait 500 
Object.Indestructibility(14@) = False
071F: set_object 14@ health_to 1 
Model.Destroy(10@)
jump @NONAME_1047 

:NONAME_1047
wait 0 
if 
0AB0:   key_pressed 107 
jf @NONAME_1101  
Object.StorePos(14@, 20@, 21@, 22@)
22@ += 0.2 
Object.PutAt(14@, 20@, 21@, 22@)
jump @NONAME_1101 

:NONAME_1101
wait 0 
if 
0AB0:   key_pressed 109 
jf @NONAME_1175 
Object.StorePos(14@, 20@, 21@, 22@)
22@ -= 0.2 
Object.PutAt(14@, 20@, 21@, 22@)
jump @NONAME_1175 

:NONAME_1175
wait 0 
if 
0AB0:   key_pressed 106 
jf @NONAME_1191  
jump @NONAME_6 

:NONAME_1191
wait 0 
if 
0AB0:   key_pressed 102 
jf @NONAME_1283 
Object.StorePos(14@, 20@, 21@, 22@)
20@ += 0.2 
Object.PutAt(14@, 20@, 21@, 22@)
jump @NONAME_1283 

:NONAME_1283
wait 0 
if 
0AB0:   key_pressed 100 
else_jump @NONAME_1417 
Object.StorePos(14@, 20@, 21@, 22@)
20@ -= 0.2 
Object.PutAt(14@, 20@, 21@, 22@)
jump @NONAME_1417 

:NONAME_1417
wait 0 
if
0AB0:   key_pressed 104 
else_jump @NONAME_1471 
Object.StorePos(14@, 20@, 21@, 22@)
21@ += 0.2 
Object.PutAt(14@, 20@, 21@, 22@)
jump @NONAME_1471 

:NONAME_1471
wait 0 
if 
0AB0:   key_pressed 98 
jf @NONAME_1546 
Object.StorePos(14@, 20@, 21@, 22@)
21@ -= 0.2 
Object.PutAt(14@, 20@, 21@, 22@)
jump @NONAME_1546 

:NONAME_1546
wait 0 
if 
0AB0:   key_pressed 101 
jf @NONAME_1535 
28@ = Object.Angle(14@)
28@ += 1.0 
Object.Angle(14@) = 28@
jump @NONAME_1535 

:NONAME_1535
wait 0 
if 
0AB0:   key_pressed 103 
jf @NONAME_1597 
28@ = Object.Angle(14@)
28@ += -1.0 
Object.Angle(14@) = 28@
jump @NONAME_1597 

:NONAME_1597
wait 0 
if 
0AB0:   key_pressed 111 
jf @NONAME_1047 
Object.Destroy(14@)
jump @NONAME_6 

I found way to put many objects, but I have to put every category of objects spawner in separate script most likely... :facedesk:  I was able to get two columns via your instructions, unfortunatelly I still can't access second menu upon activating - I still can select the first one only...


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#648

Posted 26 January 2015 - 06:31 PM

how create new opcode??

You can make new opcodes using the CLEO 4 SDK
download cleo+sdk at sannybuilder com
then ask in sannybuilder forum


I tried this unfortunatelly my game shows two menus, but the second menu is still non-selectable and when iI choose anything from the first menu, the second remains on screen and I can't put the focus on it, so can't close it at all. I still don't know what opcode sets the shortcuts to activates navigating in multi-menus! I might have

are you kidding me? you're talking about two menus but the script creates only one menue, furthermore did you post a decompilied script that means that it isn't your work ...
... so, i assume, you didn't wrote anything

mzauqiefs
  • mzauqiefs

    Player Hater

  • Members
  • Joined: 05 Nov 2014
  • Indonesia

#649

Posted 26 January 2015 - 06:40 PM

 

how create new opcode??

You can make new opcodes using the CLEO 4 SDK
download cleo+sdk at sannybuilder com
then ask in sannybuilder forum


I tried this unfortunatelly my game shows two menus, but the second menu is still non-selectable and when iI choose anything from the first menu, the second remains on screen and I can't put the focus on it, so can't close it at all. I still don't know what opcode sets the shortcuts to activates navigating in multi-menus! I might have

are you kidding me? you're talking about two menus but the script creates only one menue, furthermore did you post a decompilied script that means that it isn't your work ...
... so, i assume, you didn't wrote anything

 

how to make camera rotation?? sorry bad english


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#650

Posted 26 January 2015 - 11:30 PM

how to make camera rotation?? sorry bad english

with math coding and camera related opcodes

LucassBR
  • LucassBR

    Just testing...

  • Members
  • Joined: 06 Oct 2014
  • Brazil

#651

Posted 25 February 2015 - 03:34 PM

Someone can help me with some questions?
For why exists the NOP opcodes?
How i can find the objects ID for use in game?
How to change the player clothes?

Sorry my bad english. I am braziliam.
Se alguem brasileiro puder me ajudar seria ótimo.

Thnks.

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#652

Posted 26 February 2015 - 06:14 PM

NOP = No Operation, mostly codes that have been used for debugging, showing messages to see if script works correct and later they removed the references in the exe
.
Use MapEditor to search and find objects ID and show the objects in 3d
.
use 087B: to call cloth models and then 070D: to apply the changes
087B: set_player $PLAYER_CHAR clothes_texture "HAWAIIRED" model "HAWAII" body_part 0 
087B: set_player $PLAYER_CHAR clothes_texture "BASK2HEATBAND" model "BASK1" body_part 3 
087B: set_player $PLAYER_CHAR clothes_texture "GLASSES05DARK" model "GLASSES03" body_part 15 
087B: set_player $PLAYER_CHAR clothes_texture "LEATHERTR" model "LEATHERTR" body_part 2 
087B: set_player $PLAYER_CHAR clothes_texture "4SPIDER" model "4SPIDER" body_part 4 
087B: set_player $PLAYER_CHAR clothes_texture "5CROSS" model "5CROSS" body_part 5 
087B: set_player $PLAYER_CHAR clothes_texture "6CLOWN" model "6CLOWN" body_part 6 
087B: set_player $PLAYER_CHAR clothes_texture "7CROSS3" model "7CROSS3" body_part 7 
070D: rebuild_player $PLAYER_CHAR 
first entry = TXD, second entry = DFF
087B: set_player $PLAYER_CHAR clothes_texture "TXD name" model "DFF name" body_part 15
087B: set_player $PLAYER_CHAR clothes_texture "GLASSES05DARK" model "GLASSES03" body_part 15
look into shopping.dat to see the allocations
.
 
bodypart 17 gives special clothes
087B: set_player $PLAYER_CHAR clothes_texture "POLICETR" model "POLICETR" body_part 17
070D: rebuild_player $PLAYER_CHAR
0784: to remove clothes
0784: set_player $PLAYER_CHAR textureCRC 0 modelCRC 0 bodypart 2
070D: rebuild_player $PLAYER_CHAR
.

you can save clothes
0793: save_player_clothes
then change it and after that can you restore it to the previous clothes with following code
0794: restore_player_clothes 
070D: rebuild_player $PLAYER_CHAR

LucassBR
  • LucassBR

    Just testing...

  • Members
  • Joined: 06 Oct 2014
  • Brazil

#653

Posted 27 February 2015 - 03:10 PM

Right, i got it. Thanks Zaz!

LucassBR
  • LucassBR

    Just testing...

  • Members
  • Joined: 06 Oct 2014
  • Brazil

#654

Posted 09 March 2015 - 03:18 PM Edited by LucassBR, 09 March 2015 - 03:19 PM.

Zaz, i need your help again. I make a script that modify the 'dead style' of the game, like the GTA 5 Wasted Scene.
But a have a little problem. When the CJ dies, the script works, the game's speed stay slow and the MP3 of GTA 5 wasted is playing, and after the fade to 0, the screen dont fade to 1 again. Wath is weird is that is: the pause menu stay working, and, if you exit the pause menu is possible hear the game sounds like ambient and peds, with very low pitch. Looks like the game stay running on background of the fade.

 

My script:

 

{$CLEO .cs}
//New GTA wasted style
thread 'NWASTED'
 
:NWASTED_1
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @NWASTED_1
 
if
0118:  actor $PLAYER_ACTOR dead
jf @NWASTED_1
 
0AAC: 0@ = load_mp3 "cleo\sndLibrary\gta5wastedsong.mp3"
0AAD: set_mp3 0@ perform_action 1
0924: enable_screen_darkness 1 with_value 0 
052C: set_player $PLAYER_CHAR drunk_visuals 80
015D: set_gamespeed 0.2
wait 400
015D: set_gamespeed 0.05
067C: put_camera_on_actor $PLAYER_ACTOR offset 0.0 -0.5 4.0 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
0922: set_camera_zoom_from 70.0 to 100.0 timelimit 200 smooth_transition 1
32@ = 0
03F0: enable_text_draw 1
 
:NWASTED_155
wait 0
gosub @DRAW_WASTED_SUB
if
32@ > 80
jf @NWASTED_155
 
fade 0 100
32@ = 0
 
:NWASTED_156
wait 0
gosub @DRAW_WASTED_SUB
if
32@ > 80
jf @NWASTED_156
 
03F0: enable_text_draw 0
0AAD: set_mp3 0@ perform_action 0
0AAE: release_mp3 0@
015D: set_gamespeed 1.0
02EB: restore_camera_with_jumpcut
 
:NWASTED_2
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @NWASTED_2
 
if
8118: not actor $PLAYER_ACTOR dead
jf @NWASTED_2
wait 500
jump @NWASTED_1
 
:DRAW_WASTED_SUB
038E: draw_box_position 300.0 220.0 size 600.0 64.0 RGBA 150 150 150 110
0342: set_text_draw_centered 1
0340: set_text_draw_RGBA 255 255 255 255
0344: set_text_draw_linewidth 320.0 for_centered_text
033F: set_text_draw_letter_size 2.0 3.0
033E: set_draw_text_position 320.0 200.0 GXT 'DEAD'
0051: return
 
 
Another queston: The thread has to have 7 characters max ?
Again, thanks for the last help.

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#655

Posted 09 March 2015 - 05:50 PM Edited by ZAZ, 09 March 2015 - 05:54 PM.

You wanna manipulate the wasted feature, not a good idea,
it's managed by exe and all of R* scripts of main.scm and script.img will be canceld or switched into pause mode
cleo scripts should do the same ... game must create new player... that's difficult, i can't help, sorry

but please ask for such help in the coding section


"The thread has to have 7 characters max ?" ...
...thread_name you mean, max 7 characters are valid

03A4: name_thread 'DEALER'

thread_name isn't very important and nothing happens, if you write there much more charakter or leave the script without name
but there're also some codes with thread_name as input

0459: end_thread_named 'INT'// - R* opcode  - 

0ABA: end_custom_thread_named 'TRAIN' // - cleo  opcode  -

0AAA: 10@ = thread 'SMOKE3' pointer // - cleo  opcode  -

these codes only work with max 7 characters as thread_name

as well as some more codes with string input, like gxt codes, special actor names, zone names, interior names (enex), garage names


LucassBR
  • LucassBR

    Just testing...

  • Members
  • Joined: 06 Oct 2014
  • Brazil

#656

Posted 09 March 2015 - 08:02 PM

Ummm... I have fogot one thing: the mod works if doesnt have fade to black. Then, the original wasted is showed after my mod... Whatever, thanks for the help and extra info!
About the player clotes the body_part in the 087B opcode is the same of the attach_object 0@ on_actor $actor body_part 1 opcode?
Where i can found the texture name of the player s clothes?

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#657

Posted 10 March 2015 - 04:22 PM Edited by ZAZ, 10 March 2015 - 04:31 PM.

About the player clotes the body_part in the 087B opcode is the same of the attach_object 0@ on_actor $actor body_part 1 opcode?

No, bodypart numbers and Bone ID's for attach objects are different things
Find bodypart number in Sannybuilder Help: SCM Documentation: GTA SA > Clothes, Haircut
Look also in data\shopping.dat
and scroll down to section Clothes

there's a description for the columnes:
 
	section Clothes
		#texturename,	nametag,	modelname,	type,	stats to change,	price
glasses03 as example
		glasses03red		GLASS8		glasses03	15		respect 1	sexy 1		200
		glasses03blue		GLASS9		glasses03	15		respect 1	sexy 1		220
		glasses03dark		GLASS7		glasses03	15		respect 2	sexy 2		500
		glasses05dark		GLASS10		glasses03	15		respect 1	sexy 2		600
glasglasses03red = txd
glasglasses03blue = txd
glasglasses03dark = txd
glasglasses05dark = txd

GLASS7,GLASS8,GLASS9,GLASS10 = gxt entry to submit name for text display

glasses03 = dff

15 = bodypart number

respect 1 = increase CJ's respect by 1 when carrying this glasses
sexy 2 = increase CJ's sex appeal by 2 when carrying this glasses
600 = price
 
as you can see, one model (glasses03.dff) can have 4 different textures

LucassBR
  • LucassBR

    Just testing...

  • Members
  • Joined: 06 Oct 2014
  • Brazil

#658

Posted 13 April 2015 - 02:04 PM

Well... Thanks again... And sorry so many questions...

 

Is possible 'cath' all the peds arround CJ? Cause I want use these peds in a script...

And then make everyone kill CJ...


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#659

Posted 13 April 2015 - 05:20 PM

Well... Thanks again... And sorry so many questions...

Is possible 'cath' all the peds arround CJ? Cause I want use these peds in a script...
And then make everyone kill CJ...


Yes, but it's not an easy theme.
There exist several opcodes, made by R*, to get the handle of an existing ped.
But it don't work for mission actors or other actors, created by script. They also work just rarely with cops.
Cleo 4 came up with this new opcode
0AE1: 7@ = random_actor_near_point 10@ 11@ 12@ in_radius 8.0 find_next 0 pass_deads 1
so cleo4 is required

Another method is, to check a specific amount of values, if one of these value exist in memory as ped handle.
A nice method for advanced coders

Okay, then we know how to get a random actor.
But then we get the problem, that we can't catch more random actors, because the game always finds the same ped again instead a new one.
To solve this problem needs the ability to work with arrays.

Study the scripts below.

First one is a simple template that uses opcode 0AE1:
Aim to a ped and the ped dies

Second script use arrays, but the result is not the best.
The founded peds get red smoke above their heads

Best result i got with the method to check a specific amount of values, of course together with arrays.
And here can you download an old cleo mod of me that use R* opcodes to get random actors in arrays, a feature like your request.
 
{$CLEO .cs}
:RandomActor_Cleo4
thread 'RANDACT'

while true
wait 0
    if
        0256:   player $PLAYER_CHAR defined 
    then
        if   and
            044B:   actor $PLAYER_ACTOR on_foot
            00E1:   player 0 pressed_key 6//--- aim key
        then    
            04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.0
            if
                0AE1:   7@ = random_actor_near_point 10@ 11@ 12@ in_radius 8.0 find_next 0 pass_deads 1 // CLEO 4 opcode
            then
                if
                    8118:   not actor 7@ dead 
                then    
                    if
                        0457:   player $PLAYER_CHAR aiming_at_actor 7@
                    then
                        0321: AS_actor 7@ die_headshotted
                    end
                end
            end
        end
    end
end
{$CLEO .cs}
:RandomActor_Cleo4
thread 'RAFSTEP'
wait 5000

while true
wait 0
    if
        0256:   player $PLAYER_CHAR defined 
    then
        gosub @restore
        gosub @RandomActor_sub
        gosub @RACTSMK_freeSUB
    end
end

:restore
for 27@ = 0 to 20 step 1
0@(27@,32i) = -1
    //03F0: enable_text_draw 1
    //045A: text_draw_1number  150.0  130.0 'NUMBER' 0    // value
end
27@ = 0
23@ = 24
0@(23@,32i) = 0
return



:RandomActor_sub
for 27@ = 0 to 20
00A0: store_actor $PLAYER_ACTOR position_to 29@ 30@ 31@
    if
        0AE1:   0@(27@,32i) = random_actor_near_point 29@ 30@ 31@ in_radius 50.0 find_next 0 pass_deads 1
    then

        if
            803B:  not 0@(27@,32i) == 0@(23@,32i) // (int) 
        then
                0085: 23@ = 27@ // (int)
                04C4: create_coordinate 25@ 26@ 28@ from_actor 0@(27@,32i) 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 
        end
    end
end
return



:RACTSMK_freeSUB
27@ = 0 

for 27@ = 0 to 20 step 1
//wait 0
    if 
        not 0@(27@,32i) == -1 
    then  
        01C2: remove_references_to_actor 0@(27@,32i) // Like turning an actor into a random pedestrian 
    end
    //03F0: enable_text_draw 1
    //045A: text_draw_1number  50.0  50.0 'NUMBER' 27@    // value
    0@(27@,32i) = -1
end

23@ = 24
0@(23@,32i) = 0 
27@ = 0
return

LucassBR
  • LucassBR

    Just testing...

  • Members
  • Joined: 06 Oct 2014
  • Brazil

#660

Posted 14 April 2015 - 12:59 PM

Allright, Thanks!

This 'type' of programming language in sanny builder is very similar to another language I use...

There is another ways to write scrips in sanny?

 

I know what is the command 'for' but for why the parameter 'step'?





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users