|
 |
|
|
|
|
|
GTA Modification Forums
The Modders Lounge Ideas/Feedback/Suggestions
 |
|
 |
| |
Mister X  |
Posted: Thursday, Aug 16 2012, 16:58
|
Square Civilian

Group: Members
Joined: Dec 25, 2007

|
THIS is dedicated to: - Fastman92 - Fireguy109 - Frank.s - Jack Jones - Ashwin the new boy - Silent PL - Deji - X-Seti - krasiejow - Link2012 - MW_29 - Bad.boy! THANKS for helping me,guys!
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
fastman92  |
Posted: Thursday, Aug 16 2012, 18:01
|
фастман92 | ف

Group: Members
Joined: Jul 28, 2009


|
About in-game cursor. Take a look into source of [url=In-game Timecyc Editor 1.7 Include functions at the beginning: | CODE | {$INCLUDE functions/Detect_EXE_version.txt}
Include at the ending: {$INCLUDE general/Addresses.txt} {$INCLUDE functions/ArrayGetValueByIndex.txt} {$INCLUDE functions/MouseSupport.txt}
You need to have two variables to store size of cursor: 0AB1: call_scm_func @MouseSupport_getCursorSize 0 store_XY_size 5@ 6@
|
Next step: load texture of cursor, take it from timecyc.txd which comes with the In-game Timecyc Editor[/url] | CODE | 0390: load_txd_dictionary 'timecyc' 038F: load_texture "cursor" as 1 // Load dictionary with 0390 first
|
Next step: put in "wait 0" loop this code to draw: | CODE | | 0AB1: call_scm_func @MouseSupport_process 6 cursor_texID 3 current_cursor_pos_XY 1@ 2@ cursor_size_xy 5@ 6@ IsCursorLocked false store_updated_cursor_pos_XY 1@ 2@ |
Remember 1@ and 2@ (both float type) current X and Y cursor position in dimensions 640.0 x 448.0 This post has been edited by fastman92 on Thursday, Aug 16 2012, 18:05
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
fastman92  |
Posted: Wednesday, Aug 22 2012, 14:28
|
фастман92 | ف

Group: Members
Joined: Jul 28, 2009


|
MK, yes, you can, but have to pay five bucks at least. This answer should satisfy yourself. It's pretty straightforward how {$INCLUDE ...} is used, path is relative to the main compiled CLEO txt source file, but your English skill may degrade understanding of given information in this post. In Sanny Builder {$INCLUDE another.txt} simply puts whole content of included file into compiled project on the fly in place of directive as it was placed here. There's not much to explain.
This post has been edited by fastman92 on Wednesday, Aug 22 2012, 14:37
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Link2012  |
Posted: Wednesday, Aug 22 2012, 15:54
|
Wut?

Group: Members
Joined: Jan 30, 2011


|
| QUOTE (Yezz007 @ Wednesday, Aug 22 2012, 04:14) | Hey guys, i wanna ask how to use these codes? I want to make 'randomize' things
| CODE | 0209: 100@ = random_int_in_ranges 0 to 7 //or 0@ = random(1@, 2@) |
Random things like...spawn a car; infernus or turismo(random) for CLEO 3 GTA SA |
This code will randomize a number from 0 to 7 (0,1~6) and put the result at 0@. Same in second case, but the randomization will be from 1@ to 2@ These opcodes are original from the game. This post has been edited by Link2012 on Wednesday, Aug 22 2012, 17:24
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SilentPL  |
Posted: Thursday, Aug 23 2012, 10:47
|
Senior File Manager

Group: Members
Joined: Feb 1, 2010



|
| QUOTE (Yezz007 @ Thursday, Aug 23 2012, 05:30) | | QUOTE (Link2012 @ Wednesday, Aug 22 2012, 22:54) | This code will randomize a number from 0 to 7 (0,1~6) and put the result at 0@. Same in second case, but the randomization will be from 1@ to 2@
These opcodes are original from the game. |
Thats clear, thanks. | The fact is, 0209 will never generate the highest value (in this case, 7). It works as a modulo operation.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Deji  |
Posted: Thursday, Aug 23 2012, 12:20
|
Coding like a Rockstar!

Group: Members
Joined: Dec 24, 2007


|
I think it works that way for good reason. With floats, for example: | CODE | | GENERATE_RANDOM_FLOAT_IN_RANGE 0.0 10.0 0@ |
Will generate from 0.0 to 9.(9). Much better than writing the actual maximum, which would require a lot of try-failing. And 9.9 recurring, technically, is equivalent to 10. So thinking about it this way, it works perfectly. Both float/int generating use the same function (flooring the value, same as SA's convert to int opcodes work), except the int one typecasts to int. So perhaps it's just laziness...
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SilentPL  |
Posted: Thursday, Aug 23 2012, 12:27
|
Senior File Manager

Group: Members
Joined: Feb 1, 2010



|
| QUOTE (Deji @ Thursday, Aug 23 2012, 14:20) | I think it works that way for good reason. With floats, for example:
| CODE | | GENERATE_RANDOM_FLOAT_IN_RANGE 0.0 10.0 0@ |
Will generate from 0.0 to 9.(9). Much better than writing the actual maximum, which would require a lot of try-failing. And 9.9 recurring, technically, is equivalent to 10. So thinking about it this way, it works perfectly. Both float/int generating use the same function (flooring the value, same as SA's convert to int opcodes work), except the int one typecasts to int. So perhaps it's just laziness... | With ints it's even more obivious. | CODE | GENERATE_RANDOM_FLOAT_IN_RANGE 0 ARRAY_SIZE 0@
|
No need for additional math.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (Yezz007 @ Monday, Aug 27 2012, 09:39) | | I have a question, how to get the SA ped path? I mean how i know the path is going to?(the coords) |
For Carpaths can you get path point coords and it's angle near specified coords, then calculate coords by the angle and an specified radius to get again path point coords near these coords but it's unknown if the the founded coords are from the same path test the script below to show marker at pathpoints, drive around the map | CODE | {$CLEO .cs} :SHOW_CAR_PATHS thread 'SCPATH' 8@ = 1
while true wait 0 if 0256: player $PLAYER_CHAR defined then gosub @create_SUB wait 1000 gosub @remove_SUB if 8@ == 1 then 8@ = 2 else 8@ = 1 end end end
:create_SUB 04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 for 0@ = 0 to 20 06F8: get_nearest_route_for 1@ 2@ 3@ in_direction 8@ store_to 4@ 5@ 6@ Z_angle_to 7@ 018A: 10@(0@,24i) = create_checkpoint_at 4@ 5@ 6@ 0087: 1@ = 4@ // (float) 0087: 2@ = 5@ // (float) 02F6: 4@ = cosine 7@ // sinus swapped with cosine 02F7: 5@ = sinus 7@ // cosine swapped with sinus 4@ *= 50.0 5@ *= 50.0 005B: 1@ += 4@ // floating-point values 005B: 2@ += 5@ // floating-point values end return
:remove_SUB for 0@ = 0 to 20 0164: disable_marker 10@(0@,24i) end return |
The opcode for pedpaths don't returns an angle, so you can just search around | CODE | {$CLEO .cs} :SHOW_PED_PATHS thread 'SPPATH'
while true wait 0 if 0256: player $PLAYER_CHAR defined then gosub @create_SUB wait 1000 gosub @remove_SUB end end
:create_SUB 04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 7@ = 0.0 8@ = 20.0 for 0@ = 0 to 20 02C0: store_to 4@ 5@ 6@ ped_path_coords_closest_to 1@ 2@ 3@ 018A: 10@(0@,24i) = create_checkpoint_at 4@ 5@ 6@ 0087: 1@ = 4@ // (float) 0087: 2@ = 5@ // (float) 02F6: 4@ = cosine 7@ // sinus swapped with cosine 02F7: 5@ = sinus 7@ // cosine swapped with sinus 006B: 4@ *= 8@ // floating-point values 006B: 5@ *= 8@ // floating-point values 005B: 1@ += 4@ // floating-point values 005B: 2@ += 5@ // floating-point values 7@ += 15.0 8@ += 1.0 end return
:remove_SUB for 0@ = 0 to 20 0164: disable_marker 10@(0@,24i) end return |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(12) « First ... 6 7 [8] 9 10 ... Last »
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|