CLEO Help 0B8F:

CLEO related
Status
Not open for further replies.

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
[shcode=cpp]
if and
  Dialog.CheckBoxIsChecked(4@, 10) 
  3@ == 0
then
    // Draw Textdraws
    if and 
      0818:   actor $PLAYER_ACTOR in_air
      0AB0:   key_pressed 0x04
    then 25@ = 1
    end
    if 25@ == 1
    then 0B8D: samp set_cursor_mode 2
    if 0AB0:   key_pressed 0x01
    then
        0B5E: get_cursor_pos 26@ 27@
        // 0B8F: convert_screen_coords 26@ 27@ depth 19@ to_world_3d 28@ 29@ 30@
        00A1: put_actor $PLAYER_ACTOR at 28@ 29@ 30@
        0B8D: samp set_cursor_mode 0
        25@ = 0
    end           [/shcode]

when im in air and i want to be teleported to my cursor pos, this script don't tp me, but it give me the good coords via chatmsg "%f"%f" except Z coord(btw how can i get Z cursor pos?)
i want to do a function like s0beit has(mouse3-->mouse1--> tp you to the right cursor pos)
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
Just use
[shcode=cpp]00A1: put_actor $PLAYER_ACTOR at 28@ 29@ -100.0[/shcode]
it will automatically try to get the ground z position at 28@ 29@ coords.
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
Opcode.eXe said:
You can try this: 02CE: 16@ = ground_z_at 2@ 3@ 4@

springfield said:
Just use
[shcode=cpp]00A1: put_actor $PLAYER_ACTOR at 28@ 29@ -100.0[/shcode]
it will automatically try to get the ground z position at 28@ 29@ coords.

you both are right :) unfortunately if you convert [shcode=cpp]0B5E: get_cursor_pos(GAME_SCREEN_COORDS)[/shcode] into [shcode=cpp]WINDOW_SCREEN_COORDS[/shcode] and after you use [shcode=cpp]0B8F: to convert the screen cords to in_game coords / 3d coords[/shcode] it gives you same thing as [shcode=cpp]00A0: store_actor $PLAYER_ACTOR position_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3[/shcode] does :sadpepe:  in my opinion is imposible to make that func in cleo  :fuck_yea: 


i tried to add this tp func to my proto mod .here is source code if you think that may be im wrong

[shcode=cpp]
if and
  Dialog.CheckBoxIsChecked(4@, 10) 
  3@ == 0
then   
    // Draw Textdraws

    if 0AB0:   key_pressed 0x04
    then 25@ = 1
    end
    if 25@ == 1
    then 
        0B8D: samp set_cursor_mode 2
        if 0AB0:   key_pressed 0x01
    then
        0B5E: get_cursor_pos 26@ 27@
        0B5F: convert_game_screen_coords 26@ 27@ to_window_screen_coords 28@ 29@
        chatmsg "%f %f" -1 28@ 29@
        0B8F: convert_screen_coords 28@ 29@ depth 3@ to_world_3d 22@ 23@ 24@
        chatmsg "%f %f %f" -1 22@ 23@ 24@
        00A1: put_actor $PLAYER_ACTOR at 22@ 23@ -100.0
        0B8D: samp set_cursor_mode 0
        25@ = 0
    end             
    end      
    if 0AB0:   key_pressed 0x20
    then
        0393: actor $PLAYER_ACTOR perform_animation "MUSCLESPRINT" at 4.0 times_normal_rate 
        0393: actor $PLAYER_ACTOR perform_animation "SPRINT_CIVI" at 4.0 times_normal_rate 
        0393: actor $PLAYER_ACTOR perform_animation "RUN_PLAYER" at 4.0 times_normal_rate 
        0393: actor $PLAYER_ACTOR perform_animation "JUMP_LAUNCH" at 6.0 times_normal_rate 
        0393: actor $PLAYER_ACTOR perform_animation "JUMP_LAUNCH_R" at 6.0 times_normal_rate 
        0393: actor $PLAYER_ACTOR perform_animation "WALK_PLAYER" at 4.0 times_normal_rate 
        0393: actor $PLAYER_ACTOR perform_animation "SWIM_CRAWL" at 6.0 times_normal_rate 
        0393: actor $PLAYER_ACTOR perform_animation "SWIM_UNDER" at 6.0 times_normal_rate 
    end    
    if and 
      0818:   actor $PLAYER_ACTOR in_air
      0AB0:   key_pressed 0x10 
    then
        083D: get_actor $PLAYER_ACTOR velocity_in_direction_XYZ 11@ 12@ 13@ 
        083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 11@ 12@ 30.0
    end
    if and 
      0818:   actor $PLAYER_ACTOR in_air
      0AB0:   key_pressed 0x41
    then  
        068D: get_camera_position_to 14@ 15@ 16@ 
        Actor.StorePos($PLAYER_ACTOR, 11@, 12@, 13@)
        0063: 11@ -= 14@ // (float) 
        0063: 12@ -= 15@ // (float) 
        0604: get_Z_angle_for_point 11@ 12@ store_to 10@ 
        10@ += 405.0 
        Actor.Angle($PLAYER_ACTOR) = 10@
        083D: get_actor $PLAYER_ACTOR velocity_in_direction_XYZ 11@ 12@ 13@ 
        083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 5.0 12@ 13@
    end
    if and 
      0818:   actor $PLAYER_ACTOR in_air
      0AB0:   key_pressed 0x44
    then  
        068D: get_camera_position_to 14@ 15@ 16@ 
        Actor.StorePos($PLAYER_ACTOR, 11@, 12@, 13@)
        0063: 11@ -= 14@ // (float) 
        0063: 12@ -= 15@ // (float) 
        0604: get_Z_angle_for_point 11@ 12@ store_to 10@ 
        10@ -= 405.0 
        Actor.Angle($PLAYER_ACTOR) = 10@
        083D: get_actor $PLAYER_ACTOR velocity_in_direction_XYZ 11@ 12@ 13@ 
        083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 11@ 5.0 13@
    end    
    if and
      0818:   actor $PLAYER_ACTOR in_air
      0AB0:   key_pressed 0x20
    then
        if Actor.Animation($PLAYER_ACTOR) == "FALL_FALL"
        then
            0812: AS_actor $PLAYER_ACTOR perform_animation "MUSCLESPRINT" IFP "BIKES" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 0 time -1 // versionB 
            0A8C: write_memory 8848320 size 4 value 15.0 virtual_protect 1 
            Actor.SetImmunities($PLAYER_ACTOR, 1, 1, 1, 1, 1)
            0393: actor $PLAYER_ACTOR perform_animation "MUSCLESPRINT" at 4.0 times_normal_rate 
            0393: actor $PLAYER_ACTOR perform_animation "SPRINT_CIVI" at 4.0 times_normal_rate 
            0393: actor $PLAYER_ACTOR perform_animation "RUN_PLAYER" at 4.0 times_normal_rate 
            0393: actor $PLAYER_ACTOR perform_animation "JUMP_LAUNCH" at 6.0 times_normal_rate 
            0393: actor $PLAYER_ACTOR perform_animation "JUMP_LAUNCH_R" at 6.0 times_normal_rate 
            0393: actor $PLAYER_ACTOR perform_animation "WALK_PLAYER" at 4.0 times_normal_rate 
            0393: actor $PLAYER_ACTOR perform_animation "SWIM_CRAWL" at 6.0 times_normal_rate 
            0393: actor $PLAYER_ACTOR perform_animation "SWIM_UNDER" at 6.0 times_normal_rate 
        end    
    end  
    if and 
      not Dialog.CheckBoxIsChecked(4@, 10)
      not Dialog.CheckBoxIsChecked(4@, 6)
      not Dialog.CheckBoxIsChecked(4@, 1) 
    then Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)  
    end
end
     
end // while true end

[/shcode]
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
0B8F takes a 3rd parameter which is the depth or distance from the camera.
Then use [shcode=cpp]
0BFF: process_line_of_sight start 0@ 1@ 2@ end 3@ 4@ 5@ check_solid true car true actor false object true particle false see_through_stuff false ignore_some_objects_for_camera true store_col_point_to 6@ entity_to 7@
[/shcode]
to get a collision point between your camera/player position and and the converted mouse screen position.
Then just teleport to the collision point, if it exists.
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
springfield said:
0B8F takes a 3rd parameter which is the depth or distance from the camera.
Then use [shcode=cpp]
0BFF: process_line_of_sight start 0@ 1@ 2@ end 3@ 4@ 5@ check_solid true car true actor false object true particle false see_through_stuff false ignore_some_objects_for_camera true store_col_point_to 6@ entity_to 7@
[/shcode]
to get a collision point between your camera/player position and and the converted mouse screen position.
Then just teleport to the collision point, if it exists.

Don't get me wrong but I'm stupid, I tried to think it alone like 30 minutes or more but still nothing xd

use 0BFF to get a collision point between your camera/player position
[shcode=cpp] 
068D: get_camera_position_to 19@ 20@ 21@ // or 00A0: store_actor $PLAYER_ACTOR position_to 19@ 20@ 21@ tried both
0BFF: process_line_of_sight start 19@ 20@ 21@ ....
[/shcode]

and the converted mouse screen position
[shcode=cpp]
// which is (may be)
0B5E: get_cursor_pos 26@ 27@
0B5F: convert_game_screen_coords 26@ 27@ to_window_screen_coords 28@ 29@

//or second alternative(but there's no logic to compare identical coords)
0B8F: convert_screen_coords 28@ 29@ depth 3@ to_world_3d 22@ 23@ 24@ // WINDOW_SCREEN_COORDS --> 3d_WORLD
[/shcode]

and 0BFF: should look like (probably):

[shcode=cpp]
// First Method that I tried
068D: get_camera_position_to 19@ 20@ 21@
0B5E: get_cursor_pos 26@ 27@
0B5F: convert_game_screen_coords 26@ 27@ to_window_screen_coords 28@ 29@
0BFF: process_line_of_sight start 19@ 20@ 21@ end 28@ 29@ -1 solid true car true actor false object true particle false through_stuff false ignore_some_objects true col_point 17@ 18@
                               //Actor Position //Window_Screen_Coords

// Second Alternative
068D: get_camera_position_to 19@ 20@ 21@
0B5E: get_cursor_pos 26@ 27@
0B5F: convert_game_screen_coords 26@ 27@ to_window_screen_coords 28@ 29@
0B8F: convert_screen_coords 28@ 29@ depth 3@ to_world_3d 22@ 23@ 24@
0BFF: process_line_of_sight start 19@ 20@ 21@ end 22@ 23@ 24@ ...........
[/shcode]

Then just teleport to the collision point, if it exists.

i think you mean this
[shcode=cpp]0BFF: ........ col_point 17@[/shcode]

but how to tp to 17@? I tried 00A1: put_actor $PLAYER_ACTOR 17@ -1 -1 but it don't works anyway if i'm trying to find out what is hidding 17@ via 
[shcode=cpp]chatmsg "%x %f" -1 17@  17@ it returns me 0; 0.0[/shcode]
 
Status
Not open for further replies.
Top