Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

[SA] ~ CLEO Script Tutorial ~


Recommended Posts

I have never used this opcode

 

0494: get_joystick 0 data_to $MOVE_AXIS_X $MOVE_AXIS_Y $SPECIAL_AXIS_X $SPECIAL_AXIS_Y 

 

so I do not know how to use the arrows on the screen to be able to scroll right to the left

http://img848.imageshack.us/i/99130826.jpg/

I explained 0494 above

the arrows in your screenshot are just a grafic help to press left/right

left/right means the left/right controle which can be changed in the controler setup

Link to post
Share on other sites
  • 2 weeks later...
kal-el5676

A quick question if you would be so kind Zaz. A friend and i have been trying to implement the tlaser2 effect done by funtion x to a cleo laser vision mod as a superman add on. I suggested this in Funtion x's effect topic as well. I'd like it to have a masterspark effect, but without the coronas or animation. At first we tried editing the masterspark code to no avail. Now we have just this simple code my friend did, and i fine tuned the placement of the particle. The code works, but the damage it inflicts seems to be all around the player and not focusable, nor aimable. Any suggestions of assisting in this would be amazing.

Also, the particle is attached to the player, can it be attached to the head bone?

 

Also if you happen to know what value in the effects.fxp defines the distance between the two lasers that would also be helpful. Here's a video and some pics of the effect, and also the code.

 

 

// 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---------------thread 'SUPERMAAAAAAN' :SUPERMAAAAAAN_19wait 0 if and0AB0:   key_pressed 101   not Actor.Driving($PLAYER_ACTOR)else_jump @SUPERMAAAAAAN_19 0669: [email protected] = attach_particle "TLASER2" to_actor $PLAYER_ACTOR with_offset 0.25 12.1 0.8 flag 1 0669: [email protected] = attach_particle "TLASER2" to_actor $PLAYER_ACTOR with_offset -0.25 12.1 0.8 flag 1 064C: make_particle [email protected] visible 064C: make_particle [email protected] visible wait 500 Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])[email protected] = Actor.Angle($PLAYER_ACTOR)[email protected] += 180.0 02F6: [email protected] = sine [email protected] // (float) 02F7: [email protected] = cosine [email protected] // (float) [email protected] = 50 :SUPERMAAAAAAN_195 [email protected] >= 0 else_jump @SUPERMAAAAAAN_291 wait 1 005B: [email protected] += [email protected] // (float) 005B: [email protected] += [email protected] // (float) if 86BD:   not no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 1 actor 1 object 1 particle 0 else_jump @SUPERMAAAAAAN_277 jump @SUPERMAAAAAAN_291 :[email protected] -= 1 jump @SUPERMAAAAAAN_195 :SUPERMAAAAAAN_2910565: create_soundless_explosion_at [email protected] [email protected] [email protected] type 7 0565: create_soundless_explosion_at [email protected] [email protected] [email protected] type 7 0565: create_soundless_explosion_at [email protected] [email protected] [email protected] type 7 wait 1000 jump @SUPERMAAAAAAN_19 0A93: end_custom_thread 

 

 

 

user posted image

 

Need to move the lasers closer together.

user posted image

 

Also not sure why, but after using it about a dozen times, the particles switches to only 1 laser o_O

Link to post
Share on other sites

 

A quick question if you would be so kind Zaz. A friend and i have been trying to implement the tlaser2 effect done by funtion x to a cleo laser vision mod as a superman add on. I suggested this in Funtion x's effect topic as well. I'd like it to have a masterspark effect, but without the coronas or animation. At first we tried editing the masterspark code to no avail. Now we have just this simple code my friend did, and i fine tuned the placement of the particle. The code works, but the damage it inflicts seems to be all around the player and not focusable, nor aimable. Any suggestions of assisting in this would be amazing.

Also, the particle is attached to the player, can it be attached to the head bone?

 

Also if you happen to know what value in the effects.fxp defines the distance between the two lasers that would also be helpful. Here's a video and some pics of the effect, and also the code.

 

 

The effect havn't a source or target. It have only a size because it's a stretched image.

And the spawnpoint in the script is the center of the image. The values of the size are written in the size part of the effect.

 

The most exactly method to find the target where the laser could hit anything is Wessers method, integrated in his Laser sight script

But it's depending to the camera view, it's means it works fine by aiming because the player will have the same orientation like the camera if he aims with a weapon.

 

If the script should ignore the camera view and work without aiming like in your vid there is only one chance:

It needs to throw an object which collide on the way of the laserbeam

read Object - COLLISION - check

 

To attach an effect to actor bone needs the supportive opcode 0883:

 

066A: [email protected] = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.301  -0.2  0.17 rotation -5.5  -3.5  0.0 flag 1  0883: attach_particle [email protected] to_actor $PLAYER_ACTOR on_bone 26064C: make_particle [email protected] visible

 

You must find out yourself the number for the head

Link to post
Share on other sites

What are the bones to particles?

 

what is the number of the:

 

left hand

 

right hand

 

left foot

 

right foot

 

i want to attach a particle in that zones

 

can you help me?

Link to post
Share on other sites

 

 

See Coding Bible II. It's here.

the numbers for hands are not listed

 

 

 

 

What are the bones to particles?

 

what is the number of the:

 

left hand

 

right hand

 

left foot

 

right foot

 

i want to attach a particle in that zones

 

can you help me?

test this:

 

{$CLEO .cs}:Spraycan_at_Actor_bone03A4: name_thread 'SPRAYWP':SPRAYWP_010001: wait  0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @SPRAYWP_01if0AB0:   key_pressed 48//-----------------------press 0004D: jump_if_false @SPRAYWP_01066A: [email protected] = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.1  -0.22  0.13 rotation -1.5  -3.5  0.0 flag 1  0883: attach_particle [email protected] to_actor $PLAYER_ACTOR mode 26// right hand064C: make_particle [email protected] visible0001: wait  2000 ms{066A: [email protected] = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset 0.0  -0.5  0.0 rotation 0.0  -3.5  0.0 flag 1  0883: attach_particle [email protected] to_actor $PLAYER_ACTOR mode 23// right hand064C: make_particle [email protected] visible0001: wait  2000 ms066A: [email protected] = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset 0.0  0.5  0.0 rotation 0.0  3.5  0.0 flag 1  0883: attach_particle [email protected] to_actor $PLAYER_ACTOR mode 24//left Hand064C: make_particle [email protected] visible0001: wait  2000 ms066A: [email protected] = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset 0.0  0.5  0.0 rotation 0.0  3.5  0.0 flag 1  0883: attach_particle [email protected] to_actor $PLAYER_ACTOR mode 25//?064C: make_particle [email protected] visible0001: wait  2000 ms}:SPRAYWP_030001: wait  0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @SPRAYWP_03if0AB0:   key_pressed 48//-----------------------press 0004D: jump_if_false @SPRAYWP_030976: destroy_particle [email protected]  0001: wait  1000 ms0002: jump @SPRAYWP_01

 

Link to post
Share on other sites
EdUaRdO - Brazil

Hello ZAZ, I was watching your tutorial about memory addresses, and saw some examples of CHEATS,

how to spawn a car, etc ... you use hexadecimal characters. Has the following:

 

 

0A8D: $CHEAT = read_memory 0x00969110 size 4 virtual_protect 0if04A4:   $CHEAT == 0x4A554D50 //JUMP

 

 

My question is: What is the address 0x00969110?

And another example (Ramp Jump) use another address 0x00969114 with 0x00969110.

 

 

 

0A8D: [email protected] = read_memory 0x00969110 size 4 virtual_protect 0 //0A8D: [email protected] = read_memory 0x00969114 size 4 virtual_protect 0 //if  and04A4:   [email protected] == 0x52414D50 //checks if [email protected] = RAMP04A4:   [email protected] == 0x4A554D50 //checks if [email protected] = JUMP004D: jump_if_false @Cheatcode_1  // example03E5: text_box 'CHEAT1'0109: player $PLAYER_CHAR money += 10000000A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0 //clear the buffer0A8C: write_memory 0x00969114 size 4 value 0 virtual_protect 0 //clear the buffer.....// script funtions

 

 

Their function would only differentiate digits or give different variables and to use the same address?

What would be the function of the addresses 0x00969110 and 0x00969114, because both serve the same purpose for check keys?

 

And what is the function of upcode 0A8C address 0x00969110 with the value 0? It would be like releasing the address or something?

 

Sorry so many questions, and make you lose your time, but do I script a long time, but do not have much knowledge about memory addresses

Tnks icon14.gif

 

Edited by EdUaRdO - Brazil
Link to post
Share on other sites

 

Hello ZAZ, I was watching your tutorial about memory addresses, and saw some examples of CHEATS,

how to spawn a car, etc ... you use hexadecimal characters. Has the following:

 

0A8D: $CHEAT = read_memory 0x00969110 size 4 virtual_protect 0if04A4:   $CHEAT == 0x4A554D50 //JUMP

 

 

no, not a car but an object

 

 

 

What is the address 0x00969110?

And another example (Ramp Jump) use another address 0x00969114 with 0x00969110.

it's the memadress which stores the keypresses

the adress can store 4 bytes

a letter like M will be 4D in hex charackter of ASCII Table and needs 1 byte

so you can check for one key in this way:

 

//size 1 of adress 0x009691100A8D: $CHEAT = read_memory 0x00969110 size 1 virtual_protect 0if04A4:   $CHEAT == 0x4D //M

 

if you wanna check 8 keys you need 2 memadresses which store 8 bytes alltogether

this 0x00969110 and this 0x00969114 adress but the order will be inverted then

these adresses are working for GTASA V1

for V1.1 i know only this adress: 0x96B790

 

 

And what is the function of upcode 0A8C address 0x00969110 with the value 0? It would be like releasing the address or something?

yes, otherwise it will still store the pressed keys and let the code pass for the next time

 

 

I script a long time, but do not have much knowledge about memory addresses

i also not and i don't like it tounge2.gif

Link to post
Share on other sites
EdUaRdO - Brazil

 

no, not a car but an object

 

It is possible to do spawn car, look at this script I made:

 

cookie.gif

 

 

{$CLEO .cs}03A4: name_thread 'Spawn_test':Spawn_test0001: wait 0 ms 0A8D: $CHEAT = read_memory 0x00969110 size 4 virtual_protect 0  00D6: if 1                  04A4:   $CHEAT == 0x42494B45 // Type BIKE 004D: jump_if_false @Spawn_test 0247:  request_model #NRG500:check0001: wait 0 ms00D6: if and0248:   model #NRG500 availablejf @check 03E5: text_box 'CHEAT1'  // Cheat Ativado04C4: store_coords_to $COORD_X $DCOORD_Y $COORD_Z from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 00A5: $CAR = create_car #NRG500 at $COORD_X $DCOORD_Y $COORD_Z0172: $ANGLE = actor $PLAYER_ACTOR Z_angle if0175: set_car $CAR Z_angle_to $ANGLE0224: set_car $CAR health_to 3500 wait 20000249: release_model #NRG500 0A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0 end_thread  

 

 

 

Or use the ddresses, for example, 0x969141, 0x969147, 0x969146, 0x969144, to spawn other cars

without the upcodes 0247, 00A5, but I could not make it work sad.gif

 

 

icon14.gif But I understand

Very Thanks man and keep working

 

cookie.gif

Link to post
Share on other sites
Silent

Nah, you just read from 0x969110 all the time.

 

 

to spawn other cars

without the upcodes 0247, 00A5, but I could not make it work

 

You mean spawning a car like a cheat does? Well, you can make it by CLEO4 opcode:

 

 

0ADD: spawn_car_with_model #RHINO like_a_cheat

 

 

It don't need 0247 and 00A5, just spawns a car.

 

Also, if you want to do it in CLEO3, use function call:

 

 

0AA5: call 0x43A0B0 num_params 1 pop 0 #RHINO

 

Link to post
Share on other sites

or in this way

i think he means with Function_Memory_Addresses

0x0043A4A0

CCheat::CreateCar432

 

 

{$CLEO}thread 'MEMCAR' :MEMCAR_1wait 0 if   Player.Defined($PLAYER_CHAR)jf @MEMCAR_10A8D: [email protected] = read_memory 0x0043A4A0 size 4 virtual_protect 103F0: enable_text_draw 1045A: draw_text_1number 250.0 40.0 GXT 'NUMBER' number [email protected]  // ~1~ if 0AB0:   key_pressed 8//-backspace jf @MEMCAR_1 if 0AA9:   is_game_version_original jf @MEMCAR_1 0AA5: call 0x0043A4A0 1 pop 1 1 wait 1000 jump @MEMCAR_1

 

 

 

 

but EdUaRdO, your conditional check is wrong

 

00D6: if and<-----------------------------

0248: model #NRG500 available

jf @check

 

00D6: if 1<---------------------------- if 1 means if and

04A4: $CHEAT == 0x42494B45 // Type BIKE

Edited by ZAZ
Link to post
Share on other sites
EdUaRdO - Brazil

 

but EdUaRdO, your conditional check is wrong  00D6: if and<----------------------------- 0248: model #NRG500 available jf @check  00D6: if 1<---------------------------- if 1 means if and 04A4: $CHEAT == 0x42494B45 // Type BIKE

 

Oh yes, I use if 1, but I post IF AND biggrin.gif

 

I tried another script using 0x00407851, which is not an expensive model set, and it worked tounge.gif , like this:

 

 

 

{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'ROMERO' :ROMERO_110001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @ROMERO_11 00D6: if 0AB0:   key_pressed 9     // -------TAB004D: jump_if_false @ROMERO_11 0247: load_model #ROMERO    //---model:ROMERO_510001: wait 0 ms 00D6: if and0248:   model #ROMERO available //---model004D: jump_if_false @ROMERO_51 0AA5: call 4225105 1 pop 1 442  // Addresses :CreateCar0001: wait 1000 ms 0002: jump @ROMERO_11 

 

 

I made another (I think it is not the right way), without the 0247 and 0248, using the direct 0AA5, and works perfectly

 

 

{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'ROMERO' :ROMERO_110001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @ROMERO_11 00D6: if 0AB0:   key_pressed 9     // -------TAB004D: jump_if_false @ROMERO_11 0AA5: call 4225105 1 pop 1 442  // Addresses :CreateCar0001: wait 1000 ms 0002: jump @ROMERO_11 

 

 

And thanks for script example

This is very helpful for me icon14.gificon14.gif

Edited by EdUaRdO - Brazil
Link to post
Share on other sites

again a failure in your check

 

00D6: if and <-------------------------------- you have only one condition!0248:   model #ROMERO available //---model004D: jump_if_false @ROMERO_51

 

and please write in normal fond otherwise it looks like a book for children

Link to post
Share on other sites
EdUaRdO - Brazil

Sorry again .. I forgot to change IF AND to IF biggrin.gif

Thanks again icon14.gif

But my question is: I need to load model (0247 and 0248) when I use 0AA5??Because of two ways works...

 

I look like a noob suicidal.gif

Link to post
Share on other sites
Silent

Nah, you don't have to. This function (at least this shown by me) loads model by itself.

Link to post
Share on other sites
  • 3 weeks later...
pringston2010

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

Link to post
Share on other sites
EdUaRdO - Brazil

 

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

This is one example for teleport:

 

 

{$CLEO .cs}:MODLSUB_103A4: name_thread 'TELEPORT':Teleport_Example0001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @Teleport_Example00D6: if  000FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot X Y Z radius  1.0  1.0  1.0 //<===put your coords here004D: jump_if_false @Teleport_Example016A: fade 0 time 1500// <=== fade effect0050: jump @Teleport_Example2:Teleport_Example20001: wait 2000 msif04E4: unknown_refresh_game_renderer_at X Y Z // <=== out here the exit coords03CB: set_rendering_origin_at X Y Z // <=== out here the exit coords00A1: put_actor $PLAYER_ACTOR at X Y Z // <=== out here the exit coords0001: wait 2000 msif016A: fade 1 time 1500jump @Teleport_Example

 

 

 

The lines:

 

 

00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot X Y Z radius  1.0  1.0  1.0 

 

1 st parameter: The actor ($PLAYER_ACTOR)

2 nd parameter: Enable sphere 1 or off 0

3º rd parameter: The entrance maker (red maker) Coords X, Y and Z

4º th parameter: Sphere Radius

 

 

04E4: unknown_refresh_game_renderer_at X Y Z // <=== out here the exit coords03CB: set_rendering_origin_at X Y Z // <=== out here the exit coords

 

 

These lines are used to load the map when the CJ is teleported to the new coordinate

Note: Use the same coordinates output

 

 

00A1: put_actor $PLAYER_ACTOR at X Y Z // <=== out here the exit coords

 

 

Finally, in the second parameter, the coordinate that will appear CJ

Edited by EdUaRdO - Brazil
Link to post
Share on other sites

 

Teleport, Sphere (red marker), Location Check

 

Simple example,

red marker in Grovestreet teleports on to roof of CJ's house

{$CLEO .cs}
thread 'TELE'

:Teleport_2
wait 0// <--- max. 0 ms wait time
if
0256:   player $PLAYER_CHAR defined
jf @Teleport_2
if
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 1.0 1.0 1.0 on_foot
jf @Teleport_2
00A1: put_actor $PLAYER_ACTOR at 2524.5  -1677.5  19.95
jump @Teleport_2

The red marker (sphere) will be displayed by opcode 00FF:, 2. parameter: sphere 1(sphere 0 don't show a red sphere)

 

 

Furthermore is it very important to have 0 ms wait time as maximum in the Loop

With more than 0 ms wait time it won't display a red sphere, example:

:Teleport_2
wait 10
now the sphere won't be shown

 

 

Also is it important to know that there are limits for spheres

Look in Sanny Builder Help: SCM Documentation: GTA Limits

 

 

 

There are several opcodes which show a sphere

 

Just to create a sphere

 

03BC: 1@ = create_sphere_at 2493.5  -1682.5  13.35 radius 1.0
//eventual needs to remove the sphere at any time
03BD: destroy_sphere 1@

 

Radarmarker with sphere

 

02A7: 0@ = create_icon_marker_and_sphere 35 at 2493.5  -1682.5  13.35
//as well as
0570: 1@ = create_asset_radar_marker_with_icon  35 at -2007.8 189.1 27.5
//eventual needs to remove the marker at any time
0164: disable_marker 0@0164: disable_marker 1@

Location checks for actor

 

00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 15.0 15.0 15.0
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 1.0 1.0 2.0 on_foot
0100:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 4.0 sphere 1 in_car
0101:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 5.0 5.0 3.0 sphere 1 stopped
0102:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 1.2 1.2 3.0 sphere 1 stopped_on_foot
0103:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 6.0 sphere 1 stopped_in_car
0104:   actor $PLAYER_ACTOR near_actor 1@ radius 15.0 15.0 15.0 sphere 1
0105:   actor $PLAYER_ACTOR near_actor 1@ radius 5.0 5.0 2.0 sphere 1 on_foot

Location checks for car

 

01AD:   car 1@ sphere 1 near_point 2493.5  -1682.5 radius 6.0 6.0
01AE:   car 1@ sphere 1 near_point 2493.5  -1682.5 radius 3.0 3.0 stopped
01AF:   car 1@ sphere 1 in_sphere 2493.5  -1682.5 radius 0.2 0.2 1.0
01B0:   car 1@ sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 4.0 stopped

The location checks with integrated sphere parameter are more useful in praxis but consider to have 0 ms wait time as maximum in the Loop

 

Now we can extend the simple script from above to have more teleports in the script by binding the location checks in a chain

4 teleports in Grovestreet:

 

{$CLEO .cs}
thread 'TELE'

:Teleport_2
wait 0// <--- max. 0 ms wait time
if
0256:   player $PLAYER_CHAR defined
jf @Teleport_2
if
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 1.0 1.0 1.0 on_foot
jf @Teleport_3
00A1: put_actor $PLAYER_ACTOR at 2524.5  -1677.5  19.95
jump @Teleport_2

:Teleport_3
if
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2530.5 -1678.5 19.95 radius 1.0 1.0 1.0 on_foot
jf @Teleport_4
00A1: put_actor $PLAYER_ACTOR at 2512.5  -1670.5  13.5
jump @Teleport_2

:Teleport_4
if
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2507.5 -1673.5 13.4 radius 1.0 1.0 1.0 on_foot
jf @Teleport_5
00A1: put_actor $PLAYER_ACTOR at 2490.5  -1717.5  18.6
jump @Teleport_2

:Teleport_5
if
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2504.5 -1719.5 18.6 radius 1.0 1.0 1.0 on_foot
jf @Teleport_2
00A1: put_actor $PLAYER_ACTOR at 2497.5  -1681.5  13.4
jump @Teleport_2

 

 

 

Again, reason why the red sphere won't be shown, can be:

- because of limits, look in Sanny Builder Help: SCM Documentation: GTA Limits

- because sphere parameter of location check is disabled

- because there's more than 0 ms wait time inside the loop

 

 

 

 

Last not least, a script example in high level

Spoiler
{$CLEO .cs}
:Actor_1
03A4: name_thread 'Actor'

while true
wait 0
 if
     0256:   player $PLAYER_CHAR defined
 then

     if
         00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5
     then
         0247: request_model #VBFYCRP
         0247: request_model #1520
        04ED: load_animation "GANGS"

         repeat
         wait 0
             if  and
                 0248:   model #VBFYCRP available
                 0248:   model #1520 available
                 04EE:   animation "GANGS" loaded

             then
                 break
             end
         until false

         009A: 0@ = create_actor  4 #VBFYCRP at  -2347.7383 639.5254 42.07
         0173: set_actor 0@ Z_angle_to 180.0
         0249: release_model #VBFYCRP

         while   0256:   player $PLAYER_CHAR defined
         wait 0
     
             if  and
                 8118: not  actor 0@ dead
                  00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  85.5  85.5  85.5
             then
                 if
                    00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  2.5  2.5  2.5
                then
                wait 0
                If
                0AB0:   key_pressed 89
                then
                    00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1

             else
                 break
             end
         end

         01C2: remove_references_to_actor 0@
          repeat
         wait 0
         until 80EC: not  actor $PLAYER_ACTOR 0 near_point -2347.7383 639.5254 42.07 radius 85.5 85.5

     end
 end
end

 

 

 

 

 

Edited by ZAZ
  • Like 1
Link to post
Share on other sites

Teleport into interior:

 

The Entrances with yellow triangle are done by Enex lines in the IPL files

read here about that method:

gtamodding-ENEX

 

 

 

enex
823.629, -1588.9, 12.5764, 0, 2, 2, 8, 822.629, -1590.4, 12.5784, -1297.58, 0, 4, "BARBER2", 0, 2, 0, 24

To modify or add enex entries requires to start a new game otherwise you will get buggy interior accesses

Or use the GTASA SaveGame ENEX Updater tool

 

With script is it possible to simulate it.

The simpliest way is make a red marker and teleport the player to the desired location when the player is gone into the red marker.

Additional you can also show a yellow trinangle and disable the red marker.

 

 

Interior teleport very simple, just one way

find the red entrance spot in Grovestreet

 

{$CLEO .cs}
:Interior_entrance_verysimple
thread 'INTENTS'

:INTENTS_2
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @INTENTS_2
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  2.0  2.0  2.0
jf @INTENTS_2
016A: fade 0 time 1000
wait 1000
04BB: select_interior 3
04E4: unknown_refresh_game_renderer_at 962.17 -48.8
03CB: set_rendering_origin_at 962.17 -48.8 1001.2
0860: link_actor $PLAYER_ACTOR to_interior 3
00A1: put_actor $PLAYER_ACTOR at 962.356 -53.17 1001.2
0173: set_actor $PLAYER_ACTOR Z_angle_to 84.0
wait 500
016A: fade 1 time 1000
jump @INTENTS_2

Interior teleport and back teleport

 

{$CLEO .cs}
:Interior_entrance_Exit_simple
thread 'INTENTS'

:INTENTS_2
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @INTENTS_2
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  2.0  2.0  2.0
jf @INTENTS_2
016A: fade 0 time 50 
wait 100
04BB: select_interior 3 
04E4: unknown_refresh_game_renderer_at 962.17 -48.8 
03CB: set_rendering_origin_at 962.17 -48.8 1001.2
0860: link_actor $PLAYER_ACTOR to_interior 3 
00A1: put_actor $PLAYER_ACTOR at 962.356 -53.17 1001.2 
0173: set_actor $PLAYER_ACTOR Z_angle_to 84.0 
wait 500 
016A: fade 1 time 1000
//jump @INTENTS_2 //----- moved to scriptend

:EXIT_3
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @EXIT_3
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 965.5  -53.2  1001.2 radius  2.0  2.0  2.0
jf @EXIT_3
016A: fade 0 time 50
wait 100
04BB: select_interior 0//--------------------- outside world is interior 0
04E4: unknown_refresh_game_renderer_at 2495.1416 -1695.2909
03CB: set_rendering_origin_at 2495.1416 -1695.2909 23.3581
0860: link_actor $PLAYER_ACTOR to_interior 0//------------ link player to interior 0
00A1: put_actor $PLAYER_ACTOR at 2495.1416 -1695.2909 23.5
0173: set_actor $PLAYER_ACTOR Z_angle_to 348.7
wait 500
016A: fade 1 time 1000
jump @INTENTS_2//-- jumps to scriptbeginn

 

Interior teleport needs to insert the interior number

This don't means a room number but a identifier for the interior level

look for interior numbers and names at list of interiors

 

 

Make an interior teleport and create therefor an entrance_marker

opcode to show a yelleow triangle

 

0A40: 1@ = create_entrance_marker_at 2493.5  -1682.5  13.35 color 14//eventual needs to remove the entrance_marker at any time0A41: destroy_entrance_marker [email protected]

Try script below then go to Grovestreet to find the entrance_marker with teleport

 

{$CLEO .cs}:Entrance_marker_103A4: name_thread 'ENTRMK'0A95: enable_thread_saving0A40: 1@ = create_entrance_marker_at 2493.9 -1670.8 14.5 color 60A40: 2@ = create_entrance_marker_at 2527.6 -1679.5 1016.5 color 6:Entrance_marker_30001: wait 0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @Entrance_marker_3if00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2493.9 -1670.8 13.4 radius  2.0  2.0  2.0004D: jump_if_false @Entrance_marker_5016A: fade 0 time 10000001: wait 1000 ms04E4: unknown_refresh_game_renderer_at  2535.8301 -1674.675303CB: set_camera  2535.8301 -1674.6753 1015.498600A1: put_actor $PLAYER_ACTOR at 2535.8301 -1674.6753 1015.49860860: link_actor $PLAYER_ACTOR to_interior 104BB: select_interior 10001: wait 500 ms016A: fade 1 time 10000002: jump @Entrance_marker_3:Entrance_marker_5if00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2527.6 -1679.5 1015.5 radius  2.0  2.0  2.0004D: jump_if_false @Entrance_marker_3016A: fade 0 time 10000001: wait 1000 ms04E4: unknown_refresh_game_renderer_at  2494.5 -1679.203CB: set_camera  2494.5 -1679.2 13.400A1: put_actor $PLAYER_ACTOR at 2494.5 -1679.2 13.40860: link_actor $PLAYER_ACTOR to_interior 004BB: select_interior 00001: wait 500 ms016A: fade 1 time 10000002: jump @Entrance_marker_3
Edited by ZAZ
  • Like 1
Link to post
Share on other sites
Sasukers

HELLO ZAZ

 

i want to throw MULTIPLE objects

 

but

 

I want throw Infinite objects and create explosions when objects collided (sorry for my English)

 

can you help me?

 

before object collided i want to throw another object and Infinite objects

 

Link to post
Share on other sites

 

HELLO ZAZ

 

i want to throw MULTIPLE objects

 

but

 

I want throw Infinite objects and create explosions when objects collided (sorry for my English)

 

can you help me?

 

before object collided i want to throw another object and Infinite objects

Have you read this chapter: Object - COLLISION - check?

So you could post your throw object script

 

Anyway, how to throw multible objects

 

One method is to create objects in arrays like i did for the GrenadeFireweapon mod

Read here about arrays

Such a script requires a lot of local vars which are limited in threads of an *.cs file, so the GrenadeFireweapon mod throws max 3 objects at same time

With cleo4 is it possible to create more locals or you could write a mission script as *.cm file

 

Another method is to start multible threads inside the same *.cs file like i did for the SMGshootRockets mod

Opcode 0A92: create_custom_thread with parameter can start another thread inside the same cleo script with *.cs extension

The method:

 

// this script must become this name: MultiThread.cs{$CLEO .cs}:[email protected] == 0jf @MultiThread_2003A4: name_thread 'MULTHRD'0A92: create_custom_thread "MultiThread.cs" 1  :MultiThread_11wait 0jump @MultiThread_11:MultiThread_2003A4: name_thread 'SECONDT':MultiThread_50wait 0jump @MultiThread_50

 

 

The example below starts a second thread by keypress Backspace

and displays the values of [email protected], [email protected], [email protected], [email protected]

 

// this script must become this name: MultiThread.cs{$CLEO .cs}:MultiThread//-- [email protected] = 0 by [email protected] == 0jf @MultiThread_2003A4: name_thread 'MULTHRD'  :MultiThread_10wait 003F0: enable_text_draw 1  045A: draw_text_1number 200.0 40.0 GXT 'NUMBER' number [email protected]  // ~1~  if 0AB0:   key_pressed 8//---------------------- Backspace 004D: jump_if_false @MultiThread_10 0A92: create_custom_thread "MultiThread.cs" 1 2 3 4 //The started(second)thread assignes now the first param of 0A92: to [email protected], the second param to [email protected] and so on// the second thread beginns also with//:MultiThread//-- but [email protected] = 1 because of the  first param of 0A92://if//[email protected] == 0//jf @MultiThread_20:MultiThread_11wait 003F0: enable_text_draw 1  045A: draw_text_1number 200.0 40.0 GXT 'NUMBER' number [email protected]  // ~1~  jump @MultiThread_11 /////////////////////////////////////////////////////////////// second thread:[email protected] == 1jf @MultiThread_5003A4: name_thread 'SECONDT':MultiThread_21wait 003F0: enable_text_draw 1  045A: draw_text_1number 200.0 60.0 GXT 'NUMBER' number [email protected]  // ~1~ 045A: draw_text_1number 240.0 60.0 GXT 'NUMBER' number [email protected]  // ~1~ 045A: draw_text_1number 260.0 60.0 GXT 'NUMBER' number [email protected]  // ~1~ 045A: draw_text_1number 280.0 60.0 GXT 'NUMBER' number [email protected]  // ~1~ jump @MultiThread_21:MultiThread_500A93: end_custom_thread

 

Edited by ZAZ
Link to post
Share on other sites
Sasukers

 

 

--

 

OK i'm understand

I can use the arrays for the multiples objects biggrin.gif its more easy

 

THANK YOU ZAZ

Link to post
Share on other sites

QUOTE (Sasukers @ May 15 2011, 20:54)

 

 

 

 

I can use the arrays for the multiples objects biggrin.gifits more easy

 

 

 

 

multithreading is easier

Edited by ZAZ
Link to post
Share on other sites
Sasukers

Now

 

I use the throw beachball example

 

then

 

I want to throw the beachball and When the beachball collides, the beach ball is attached in ANY surface

 

I want to throw an object... an attach the objects in the walls ( like the remote control bombs )

 

SOMETHING EXACTLY LIKE THIS

 

|

|

V

 

http://media.moddb.com/cache/images/mods/1...0x150/Kunai.jpg

 

http://www.instructables.com/image/FUH228J...rowing-star.jpg

 

I have this to create a ninja star script

 

 

Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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