|
 |
|
|
|
|
|
GTA Modification Forums
Magnet Crane
 |
|
 |
| |
ZAZ  |
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
It's not recommanded to manipulate globals of main.scm via cleoscript Works only with original main and in some cases can it happens that cleo don't allocate the global correct, especially while active mission mode If you want to do it anyway, so do some checks to make shure that the global will be allocated to the object At first a check for the loacation, then if the global object exist and then if the object is the correct model Have a look to the first script You can also spawn the MagnoCrane_03 by new Use then 0A95: enable_thread_saving Have a look to the second script It spawns the MagnoCrane_03 at Sa Fierro/Esplanade East and allows to rotate the object and move the rope up/down the local 1@ (multiplicated with 10) displays the rope lengh on screen | CODE | {$CLEO .cs} :MagnoCrane_03 03A4: name_thread 'MAGCRAN' 0001: wait 1000 ms //1382, MagnoCrane_03, Cranes_DYN2_CJ, 150, 4 :MAGCRAN_1 wait 0 00D6: if 0 0256: player $PLAYER_CHAR defined jf @MAGCRAN_1 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -1563.3109 83.1891 26.9332 radius 75.0 75.0 25.0 jf @MAGCRAN_1 wait 50 if 03CA: object $CRANE_MAGNET exists jf @MAGCRAN_1 00BA: text_styled 'FEM_OK' 1000 ms 4 0001: wait 1000 ms if 09CC: object $CRANE_MAGNET model_is 1382 jf @MAGCRAN_1 008B: 5@ = $CRANE_MAGNET 00BA: text_styled 'FEM_On' 1000 ms 4
:MAGCRAN_3 wait 0 00D6: if 0 0256: player $PLAYER_CHAR defined jf @MAGCRAN_1 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -1563.3109 83.1891 26.9332 radius 75.0 75.0 25.0 jf @MAGCRAN_1 0796: get_crane_magnet 5@ magnet_lane_length_to 0@ 0087: 1@ = 0@ // (float) 1@ *= 10.0 0092: 1@ = float_to_integer 1@ 03F0: enable_text_draw 1 045A: text_draw_1number 50.0 100.0 'NUMBER' 1@ // value if 0AB0: key_pressed 57//--------------------------------- key 9 jf @MAGCRAN_3 0797: set_crane_magnet 5@ magnet_lane_length_to 0.7 // float jump @MAGCRAN_3 | | CODE | {$CLEO .cs} :MagnoCrane_03 03A4: name_thread 'MAGCRAN' 0001: wait 1000 ms //1382, MagnoCrane_03, Cranes_DYN2_CJ, 150, 4 0A95: enable_thread_saving 029B: 5@ = init_object 1382 at -1574.4401 1209.9697 57.1919
:MAGCRAN_3 wait 0 00D6: if 0 0256: player $PLAYER_CHAR defined jf @MAGCRAN_3 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -1574.4401 1209.9697 27.1919 radius 75.0 75.0 75.0 jf @MAGCRAN_3 0796: get_crane_magnet 5@ magnet_lane_length_to 0@ 0087: 1@ = 0@ // (float) 1@ *= 10.0 0092: 1@ = float_to_integer 1@ 03F0: enable_text_draw 1 045A: text_draw_1number 50.0 100.0 'NUMBER' 1@ // value if and 1.0 > 0@ 0AB0: key_pressed 104// numeric keypad 8 key jf @MAGCRAN_5 0@ += 0.01 0797: set_crane_magnet 5@ magnet_lane_length_to 0@ // float jump @MAGCRAN_3
:MAGCRAN_5 if and 0@ > -1.0 0AB0: key_pressed 98// numeric keypad 2 key jf @MAGCRAN_7 0@ -= 0.01 0797: set_crane_magnet 5@ magnet_lane_length_to 0@ // float jump @MAGCRAN_3
:MAGCRAN_7 if 0AB0: key_pressed 100// numeric keypad 4 key jf @MAGCRAN_9 0176: 2@ = object 5@ Z_angle 2@ += 0.3 0177: set_object 5@ Z_angle_to 2@ jump @MAGCRAN_3
:MAGCRAN_9 if 0AB0: key_pressed 102// numeric keypad 6 key jf @MAGCRAN_3 0176: 2@ = object 5@ Z_angle 2@ -= 0.3 0177: set_object 5@ Z_angle_to 2@ jump @MAGCRAN_3 |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (jemahuk1 @ Monday, Aug 6 2012, 14:51) | Thanks, man! Now it real works! But one more thing, attaching the player on the magnet... Actually, I've tried some many ways to realize it, using | CODE | | 0916: set_object 30@ attractive_to_magnet 1 |
So, I create an object, make it attractive to magnet and attach the object onto player's head but it didn't attracted to this magnet. Any ideas?  |
do you mean that the object didn't attracted to the magnet? i also didn't got the desired effect with that code it's written at 2 lines in main.scm , Quarry mission and should attract the object dead_tied_cop (don't make sense) ok, i played Quarry mission and could pickup dyn_quarryrock03 with Quarry crane As next i spawned 16329, quarry_cranearm in my cleo testscript and could also pickup the dyn_quarryrock03, worked autom. Other objects wasn't possible to make attractive_to_magnet, opcode 0916: still had no effect, also not with dyn_quarryrock03 Picking up objects with magnet seems to be hardcoded and work only with 16329, quarry_cranearm and 1303, dyn_quarryrock03 With that was it possible to attach player to object, hanging on crane magnet test the script below | CODE | {$CLEO .cs} :MagnoCrane_03 03A4: name_thread 'MAGCRAN' 0001: wait 1000 ms //16329, quarry_cranearm, des_quarrycrane, 150, 2097156 //1303, dyn_quarryrock03, dynquarryrock, 100, 128 //1608, shark, shark, 40, 128 //3092, dead_tied_cop, deadcopX, 100, 0 //3054, DYN_WREKING_BALL, BREAK_ballX, 100, 0 //3065, BBALL_col, bballX, 30, 0
0A95: enable_thread_saving 029B: 5@ = init_object 16329 at -1574.4401 1209.9697 57.1919 029B: 6@ = init_object 1303 at -1597.6106 1264.3789 11.1781 0453: set_object 5@ XY_rotation 0.0 90.0 angle 0.0
:MAGCRAN_3 wait 0 00D6: if 0 0256: player $PLAYER_CHAR defined jf @MAGCRAN_3 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -1574.4401 1209.9697 27.1919 radius 75.0 75.0 75.0 jf @MAGCRAN_3 0796: get_crane_magnet 5@ magnet_lane_length_to 0@ 0087: 1@ = 0@ // (float) 1@ *= 10.0 0092: 1@ = float_to_integer 1@ 03F0: enable_text_draw 1 045A: text_draw_1number 50.0 100.0 'NUMBER' 1@ // value if and 1.0 > 0@ 0AB0: key_pressed 104// numeric keypad 8 key jf @MAGCRAN_5 0@ += 0.01 0797: set_crane_magnet 5@ magnet_lane_length_to 0@ // float jump @MAGCRAN_3
:MAGCRAN_5 if and 0@ > -1.0 0AB0: key_pressed 98// numeric keypad 2 key jf @MAGCRAN_7 0@ -= 0.01 0797: set_crane_magnet 5@ magnet_lane_length_to 0@ // float jump @MAGCRAN_3
:MAGCRAN_7 if 0AB0: key_pressed 100// numeric keypad 4 key jf @MAGCRAN_9 0176: 2@ = object 5@ Z_angle 2@ += 0.3 //0177: set_object 5@ Z_angle_to 2@ 0453: set_object 5@ XY_rotation 0.0 90.0 angle 2@ jump @MAGCRAN_3
:MAGCRAN_9 if 0AB0: key_pressed 102// numeric keypad 6 key jf @MAGCRAN_11 0176: 2@ = object 5@ Z_angle 2@ -= 0.3 0453: set_object 5@ XY_rotation 0.0 90.0 angle 2@ jump @MAGCRAN_3
:MAGCRAN_11 if 0AB0: key_pressed 48// 0 key jf @MAGCRAN_13 04F4: put_actor $PLAYER_ACTOR into_turret_on_object 6@ offset_from_object_origin 0.0 0.0 -1.5 orientation 0 both_side_angle_limit 360.0 lock_weapon 0 0001: wait 100 ms 01B4: set_player $PLAYER_CHAR can_move 0 0001: wait 100 ms 01B4: set_player $PLAYER_CHAR can_move 1 wait 1000 jump @MAGCRAN_3
:MAGCRAN_13 if 0AB0: key_pressed 8// backspace key jf @MAGCRAN_3 0465: remove_actor $PLAYER_ACTOR from_turret_mode 0799: set_crane_magnet 5@ release_stuff_from_magnet wait 1000 jump @MAGCRAN_3 |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
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.
| |
 |
|
 |
|
|
|
|