IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules Attention:

This is for the discussion and releasing of tutorials for modifying GTA. Anything that isn't a tutorial will be deleted without notification.

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (31) « First ... 10 11 [12] 13 14 ... Last »  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [GTA SA] ~ CLEO Script Tutorial ~

 
EdUaRdO - Brazil  
Posted: Friday, Apr 22 2011, 21:09
Quote Post


Brazilian Scripter
Group Icon
Group: Members
Joined: Nov 14, 2010

ba.gif

XXXXX



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:


CODE

0A8D: $CHEAT = read_memory 0x00969110 size 4 virtual_protect 0
if
04A4:   $CHEAT == 0x4A554D50 //JUMP


My question is: What is the address 0x00969110?
And another example (Ramp Jump) use another address 0x00969114 with 0x00969110.



CODE

0A8D: 1@ = read_memory 0x00969110 size 4 virtual_protect 0 //
0A8D: 2@ = read_memory 0x00969114 size 4 virtual_protect 0 //
if  and
04A4:   1@ == 0x52414D50 //checks if 1@ = RAMP
04A4:   2@ == 0x4A554D50 //checks if 2@ = JUMP
004D: jump_if_false @Cheatcode_1  // example
03E5: text_box 'CHEAT1'
0109: player $PLAYER_CHAR money += 1000000
0A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0 //clear the buffer
0A8C: 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


This post has been edited by EdUaRdO - Brazil on Friday, Apr 22 2011, 21:11
Users WebsitePMMSN
  Top
 

 
ZAZ  
Posted: Saturday, Apr 23 2011, 04:36
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (SilentPL @ Apr 22 2011, 15:56)
Okay, I didn't know what these IDs are different.

np, you're always welcome to help me here
Users WebsitePM
  Top
 

 
ZAZ  
Posted: Saturday, Apr 23 2011, 10:54
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (EdUaRdO - Brazil @ Apr 22 2011, 21:09)
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:
CODE

0A8D: $CHEAT = read_memory 0x00969110 size 4 virtual_protect 0
if
04A4:   $CHEAT == 0x4A554D50 //JUMP

no, not a car but an object


QUOTE
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:
CODE
//size 1 of adress 0x00969110
0A8D: $CHEAT = read_memory 0x00969110 size 1 virtual_protect 0
if
04A4:   $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

QUOTE
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

QUOTE
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
Users WebsitePM
  Top
 

 
EdUaRdO - Brazil  
Posted: Saturday, Apr 23 2011, 16:01
Quote Post


Brazilian Scripter
Group Icon
Group: Members
Joined: Nov 14, 2010

ba.gif

XXXXX



QUOTE
no, not a car but an object


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

cookie.gif


CODE

{$CLEO .cs}

03A4: name_thread 'Spawn_test'

:Spawn_test
0001: 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

:check
0001: wait 0 ms
00D6: if and
0248:   model #NRG500 available
jf @check
03E5: text_box 'CHEAT1'  // Cheat Ativado
04C4: 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_Z
0172: $ANGLE = actor $PLAYER_ACTOR Z_angle
if
0175: set_car $CAR Z_angle_to $ANGLE
0224: set_car $CAR health_to 3500
wait 2000
0249: 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
Users WebsitePMMSN
  Top
 

 
SilentPL  
Posted: Saturday, Apr 23 2011, 16:58
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




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

QUOTE
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:

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

CODE
0AA5: call 0x43A0B0 num_params 1 pop 0 #RHINO
Users WebsitePMMSNXbox Live
  Top
 

 
ZAZ  
Posted: Saturday, Apr 23 2011, 19:24
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




or in this way
i think he means with Function_Memory_Addresses
0x0043A4A0
CCheat::CreateCar432

CODE
{$CLEO}
thread 'MEMCAR'

:MEMCAR_1
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @MEMCAR_1
0A8D: 1@ = read_memory 0x0043A4A0 size 4 virtual_protect 1
03F0: enable_text_draw 1
045A: draw_text_1number 250.0 40.0 GXT 'NUMBER' number 1@  // ~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

This post has been edited by ZAZ on Saturday, Apr 23 2011, 19:41
Users WebsitePM
  Top
 

 
EdUaRdO - Brazil  
Posted: Saturday, Apr 23 2011, 20:26
Quote Post


Brazilian Scripter
Group Icon
Group: Members
Joined: Nov 14, 2010

ba.gif

XXXXX



QUOTE
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:


CODE
{$CLEO .cs}

//-------------MAIN---------------
03A4: name_thread 'ROMERO'

:ROMERO_11
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ROMERO_11
00D6: if
0AB0:   key_pressed 9     // -------TAB
004D: jump_if_false @ROMERO_11
0247: load_model #ROMERO    //---model

:ROMERO_51
0001: wait 0 ms
00D6: if and
0248:   model #ROMERO available //---model
004D: jump_if_false @ROMERO_51
0AA5: call 4225105 1 pop 1 442  // Addresses :CreateCar
0001: 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

CODE
{$CLEO .cs}

//-------------MAIN---------------
03A4: name_thread 'ROMERO'

:ROMERO_11
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ROMERO_11
00D6: if
0AB0:   key_pressed 9     // -------TAB
004D: jump_if_false @ROMERO_11
0AA5: call 4225105 1 pop 1 442  // Addresses :CreateCar
0001: wait 1000 ms
0002: jump @ROMERO_11


And thanks for script example
This is very helpful for me icon14.gif icon14.gif


This post has been edited by EdUaRdO - Brazil on Saturday, Apr 23 2011, 20:46
Users WebsitePMMSN
  Top
 

 
ZAZ  
Posted: Sunday, Apr 24 2011, 19:35
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




again a failure in your check
CODE
00D6: if and <-------------------------------- you have only one condition!
0248:   model #ROMERO available //---model
004D: jump_if_false @ROMERO_51

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

 
EdUaRdO - Brazil  
Posted: Sunday, Apr 24 2011, 21:23
Quote Post


Brazilian Scripter
Group Icon
Group: Members
Joined: Nov 14, 2010

ba.gif

XXXXX



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
Users WebsitePMMSN
  Top
 

 
SilentPL  
Posted: Sunday, Apr 24 2011, 21:26
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




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

 
EdUaRdO - Brazil  
Posted: Sunday, Apr 24 2011, 21:30
Quote Post


Brazilian Scripter
Group Icon
Group: Members
Joined: Nov 14, 2010

ba.gif

XXXXX



icon14.gif
Users WebsitePMMSN
  Top
 

 
pringston2010  
Posted: Thursday, May 12 2011, 01:57
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Oct 2, 2010

XXXXX



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

 
EdUaRdO - Brazil  
Posted: Friday, May 13 2011, 23:40
Quote Post


Brazilian Scripter
Group Icon
Group: Members
Joined: Nov 14, 2010

ba.gif

XXXXX



QUOTE (pringston2010 @ May 12 2011, 01:57)
Good job! thanks for tutorial need a tutorial for make a cleo teleport in spheres.

This is one example for teleport:

CODE
{$CLEO .cs}
:MODLSUB_1
03A4: name_thread 'TELEPORT'

:Teleport_Example
0001: wait  0 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Teleport_Example
00D6: if  0
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot X Y Z radius  1.0  1.0  1.0 //<===put your coords here
004D: jump_if_false @Teleport_Example
016A: fade 0 time 1500// <=== fade effect
0050: jump @Teleport_Example2

:Teleport_Example2
0001: wait 2000 ms
if
04E4: unknown_refresh_game_renderer_at X Y Z // <=== out here the exit coords
03CB: set_rendering_origin_at X Y Z // <=== out here the exit coords
00A1: put_actor $PLAYER_ACTOR at X Y Z // <=== out here the exit coords
0001: wait 2000 ms
if
016A: fade 1 time 1500
jump @Teleport_Example



The lines:

CODE
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

CODE
04E4: unknown_refresh_game_renderer_at X Y Z // <=== out here the exit coords
03CB: 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

CODE
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


This post has been edited by EdUaRdO - Brazil on Friday, May 13 2011, 23:52
Users WebsitePMMSN
  Top
 

 
ZAZ  
Posted: Saturday, May 14 2011, 06:46
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




Nice Example, EdUaRdO but basicly is a teleport more simple (and the ifs are wrong)
fades and render codes are just to make it nicer
QUOTE
016A: fade 0 time 1500// <=== fade effect
0001: wait 2000 ms
04E4: unknown_refresh_game_renderer_at X Y Z // <=== out here the exit coords
03CB: set_rendering_origin_at X Y Z // <=== out here the exit coords
00A1: put_actor $PLAYER_ACTOR at X Y Z // <=== out here the exit coords
0001: wait 2000 ms
016A: fade 1 time 1500


Teleport, Sphere (red marker), Location Check

Simple example,
red marker in Grovestreet teleports on to roof of CJ's house
CODE
{$CLEO .cs}
:Teleport_1
03A4: name_thread 'TELE'

:Teleport_2
wait 0
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:
CODE
: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
CODE
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
CODE
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
CODE
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
CODE
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 sphereparameter 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:
CODE
{$CLEO .cs}
:Teleport_1
03A4: name_thread 'TELE'

:Teleport_2
wait 0
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


This post has been edited by ZAZ on Saturday, May 14 2011, 07:18
Users WebsitePM
  Top
 

 
ZAZ  
Posted: Saturday, May 14 2011, 07:06
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




Teleport into interior:

The Entrances with yellow triangle are done by Enex lines in the IPL files
read here about that method:
gtamodding-ENEX
CODE
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
CODE
{$CLEO .cs}
:Interior_entrance_verysimple
03A4: name_thread 'INTENTS'

:INTENTS_2
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @INTENTS_2
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
004D: jump_if_false @INTENTS_2
016A: fade 0 time 1000
0001: wait 1000 ms
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
0001: wait 500 ms
016A: fade 1 time 1000
0002: jump @INTENTS_2


Interior teleport and back teleport
CODE
{$CLEO .cs}
:Interior_entrance_Exit_simple
03A4: name_thread 'INTENTS'

:INTENTS_2
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @INTENTS_2
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
004D: jump_if_false @INTENTS_2
016A: fade 0 time 1000
0001: wait 1000 ms
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
0001: wait 500 ms
016A: fade 1 time 1000


:EXIT_3
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @EXIT_3
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 965.5  -53.2  1001.2 radius  1.0  1.0  1.0
004D: jump_if_false @EXIT_3
016A: fade 0 time 1000
0001: wait 1000 ms
04BB: select_interior 0//--------------------- outside world is interior 0
04E4: unknown_refresh_game_renderer_at 1126.3 -2037.1
03CB: set_rendering_origin_at 1126.3 -2037.1 69.88
0860: link_actor $PLAYER_ACTOR to_interior 0//------------ link player to interior 0
00A1: put_actor $PLAYER_ACTOR at 1126.3 -2037.1 69.88
0173: set_actor $PLAYER_ACTOR Z_angle_to 84.0
0001: wait 500 ms
016A: fade 1 time 1000
0002: 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
CODE
0A40: 1@ = create_entrance_marker_at 2493.5  -1682.5  13.35 color 14
//eventual needs to remove the entrance_marker at any time
0A41: destroy_entrance_marker 1@



Try script below then go to Grovestreet to find the entrance_marker with teleport
CODE
{$CLEO .cs}
:Entrance_marker_1
03A4: name_thread 'ENTRMK'
0A95: enable_thread_saving
0A40: 1@ = create_entrance_marker_at 2493.9 -1670.8 14.5 color 6
0A40: 2@ = create_entrance_marker_at 2527.6 -1679.5 1016.5 color 6

:Entrance_marker_3
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Entrance_marker_3
if
00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2493.9 -1670.8 13.4 radius  2.0  2.0  2.0
004D: jump_if_false @Entrance_marker_5
016A: fade 0 time 1000
0001: wait 1000 ms
04E4: unknown_refresh_game_renderer_at  2535.8301 -1674.6753
03CB: set_camera  2535.8301 -1674.6753 1015.4986
00A1: put_actor $PLAYER_ACTOR at 2535.8301 -1674.6753 1015.4986
0860: link_actor $PLAYER_ACTOR to_interior 1
04BB: select_interior 1
0001: wait 500 ms
016A: fade 1 time 1000
0002: jump @Entrance_marker_3

:Entrance_marker_5
if
00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2527.6 -1679.5 1015.5 radius  2.0  2.0  2.0
004D: jump_if_false @Entrance_marker_3
016A: fade 0 time 1000
0001: wait 1000 ms
04E4: unknown_refresh_game_renderer_at  2494.5 -1679.2
03CB: set_camera  2494.5 -1679.2 13.4
00A1: put_actor $PLAYER_ACTOR at 2494.5 -1679.2 13.4
0860: link_actor $PLAYER_ACTOR to_interior 0
04BB: select_interior 0
0001: wait 500 ms
016A: fade 1 time 1000
0002: jump @Entrance_marker_3


This post has been edited by ZAZ on Saturday, May 28 2011, 07:19
Users WebsitePM
  Top
 

 
Sasukers  
Posted: Sunday, May 15 2011, 19:20
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Dec 8, 2010

XXXXX



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
PM
  Top
 

 
ZAZ  
Posted: Sunday, May 15 2011, 20:07
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (Sasukers @ May 15 2011, 19:20)
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:
CODE
// this script must become this name: MultiThread.cs
{$CLEO .cs}
:MultiThread
if
0@ == 0
jf @MultiThread_20

03A4: name_thread 'MULTHRD'
0A92: create_custom_thread "MultiThread.cs" 1  

:MultiThread_11
wait 0
jump @MultiThread_11


:MultiThread_20
03A4: name_thread 'SECONDT'

:MultiThread_50
wait 0
jump @MultiThread_50


The example below starts a second thread by keypress Backspace
and displays the values of 1@, 2@, 3@, 4@
CODE
// this script must become this name: MultiThread.cs
{$CLEO .cs}
:MultiThread//-- 0@ = 0 by default
if
0@ == 0
jf @MultiThread_20

03A4: name_thread 'MULTHRD'  

:MultiThread_10
wait 0
03F0: enable_text_draw 1  
045A: draw_text_1number 200.0 40.0 GXT 'NUMBER' number 0@  // ~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 0@, the second param to 1@ and so on
// the second thread beginns also with
//:MultiThread//-- but 0@ = 1 because of the  first param of 0A92:
//if
//0@ == 0
//jf @MultiThread_20


:MultiThread_11
wait 0
03F0: enable_text_draw 1  
045A: draw_text_1number 200.0 40.0 GXT 'NUMBER' number 0@  // ~1~  
jump @MultiThread_11

/////////////////////////////////////////////////////////
////// second thread


:MultiThread_20
if
0@ == 1
jf @MultiThread_50
03A4: name_thread 'SECONDT'

:MultiThread_21
wait 0
03F0: enable_text_draw 1  
045A: draw_text_1number 200.0 60.0 GXT 'NUMBER' number 0@  // ~1~
045A: draw_text_1number 240.0 60.0 GXT 'NUMBER' number 1@  // ~1~
045A: draw_text_1number 260.0 60.0 GXT 'NUMBER' number 2@  // ~1~
045A: draw_text_1number 280.0 60.0 GXT 'NUMBER' number 3@  // ~1~
jump @MultiThread_21

:MultiThread_50
0A93: end_custom_thread


This post has been edited by ZAZ on Sunday, May 15 2011, 20:10
Users WebsitePM
  Top
 

 
Sasukers  
Posted: Sunday, May 15 2011, 20:54
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Dec 8, 2010

XXXXX





--

OK i'm understand
I can use the arrays for the multiples objects biggrin.gif its more easy

THANK YOU ZAZ
PM
  Top
 

 
ZAZ  
Posted: Sunday, May 15 2011, 21:01
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




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

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

multithreading is easier
Users WebsitePM
  Top
 

 
Sasukers  
Posted: Sunday, May 15 2011, 21:03
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Dec 8, 2010

XXXXX



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

PM
  Top
 

 

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)

0 Members:

Pages: (31) « First ... 10 11 [12] 13 14 ... Last »

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG