zag40 Posted March 24, 2016 Share Posted March 24, 2016 Can anyone help me? I tried to attach text to player actor, like making the text move around with the actor with coords but the text didn't show up. Any idea how to do it? Here's what i'm working on 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.8 0.8 [email protected] = Actor.Health($PLAYER_ACTOR)03E4: set_text_draw_align_right 10340: set_text_draw_RGBA 0 128 64 255 033F: set_text_draw_letter_size 0.35 0.8081C: draw_text_outline 1 RGBA 0 128 64 400349: set_text_draw_font 103E0: draw_text_behind_textures 1 045A: draw_text_1number [email protected] [email protected] GXT 'NUMBER' number [email protected] Thank you. Link to comment Share on other sites More sharing options...
Shmoopy Posted March 24, 2016 Share Posted March 24, 2016 Put this inside your thread: 0000: NOP03F0: enable_text_draw 1 while true wait 0 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1.0 //0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ [email protected] [email protected] [email protected] store_to [email protected] [email protected] //0AB1: call_scm_func @get3DCoordsFromScreenXY 3 coords_XY [email protected] [email protected] distance 1.0 store_camera_to [email protected] [email protected] [email protected] point_to [email protected] [email protected] [email protected] 0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ [email protected] [email protected] [email protected] store_to [email protected] [email protected] 054C: use_GXT_table 'SWEET6' 0341: unknown_text_draw_flag 0 0342: enable_text_draw_centered 1 033E: set_draw_text_position [email protected] [email protected] GXT 'SWE6B34' end And this outside your thread: :getScreenXYFrom3DCoords{ Parameters: Passed: [email protected] - position X [email protected] - position Y [email protected] - position Z Result: [email protected] - screen X [email protected] - screen Y Example: 0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 2488.562 -1666.865 12.8757 store_to [email protected] [email protected] }0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 3 store_to [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 5 store_to [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 6 store_to [email protected] 0AA5: call 0x70CE30 num_params 6 pop 6 bFarClip 0 bNearClip 0 pMultY [email protected] pMultX [email protected] pScreen [email protected] pCoords [email protected] 0AB1: call_scm_func @getScreenXY 2 coords_XY [email protected] [email protected] store_to [email protected] [email protected] 0AB2: ret 2 [email protected] [email protected] :get3DCoordsFromScreenXY{ Parameters: Passed: [email protected] - screen X [email protected] - screen Y [email protected] - distance Result: [email protected] - camera X [email protected] - camera Y [email protected] - camera Z [email protected] - position X [email protected] - position Y [email protected] - position Z Example: 0AB1: call_scm_func @get3DCoordsFromScreenXY 3 coords_XY 320.0 224.0 distance 1.0 store_camera_to [email protected] [email protected] [email protected] point_to [email protected] [email protected] [email protected] }0A8D: [email protected] = read_memory 0x8D5038 size 4 virtual_protect 0 // field of [email protected] *= 0.5 02F6: [email protected] = sine [email protected] 02F7: [email protected] = cosine [email protected] 0073: [email protected] /= [email protected] // tangent line0A8D: [email protected] = read_memory 0x865394 size 4 virtual_protect 0 // half screen X scale006B: [email protected] *= [email protected] [email protected] -= 1.0 0097: make [email protected] absolute_float006B: [email protected] *= [email protected] 0A8D: [email protected] = read_memory 0x865398 size 4 virtual_protect 0 // half screen Y scale006B: [email protected] *= [email protected] [email protected] -= 1.0 0097: make [email protected] absolute_float006B: [email protected] *= [email protected] 0A8D: [email protected] = read_memory 0xC3EFA4 size 4 virtual_protect 0 // screen aspect ratio0073: [email protected] /= [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 9 store_to [email protected] 0A8D: [email protected] = read_memory 0xB6F03C size 4 virtual_protect 0 // camera matrix0AA5: call 0x59C890 num_params 3 pop 3 pOffsets [email protected] pMatrix [email protected] pPoint [email protected] // CPlaceable__transformPoint006B: [email protected] *= [email protected] 006B: [email protected] *= [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 14 store_to [email protected] 0AA5: call 0x59C890 num_params 3 pop 3 pOffsets [email protected] pMatrix [email protected] pPoint [email protected] // CPlaceable__transformPoint0AB2: ret 6 [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] :getScreenXY{ Parameters: Passed: [email protected] - full screen X [email protected] - full screen Y Result: [email protected] - screen X [email protected] - screen Y Example: 0AB1: call_scm_func @getScreenXY 2 coords_XY 512.0 384.0 store_to [email protected] [email protected] }0A8D: [email protected] = read_memory 0xC17044 size 4 virtual_protect 0 // full screen X0A8D: [email protected] = read_memory 0x859520 size 4 virtual_protect 0 // screen X scale0093: [email protected] = integer [email protected] to_float006B: [email protected] *= [email protected] 0073: [email protected] /= [email protected] 0A8D: [email protected] = read_memory 0xC17048 size 4 virtual_protect 0 // full screen Y0A8D: [email protected] = read_memory 0x859524 size 4 virtual_protect 0 // screen Y scale0093: [email protected] = integer [email protected] to_float006B: [email protected] *= [email protected] 0073: [email protected] /= [email protected] 0AB2: ret 2 [email protected] [email protected] :getLocalVarOffset{ Parameters: Passed: [email protected] - var number Result: [email protected] - var pointer Example: 0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to [email protected] }[email protected] *= 0x4 0A9F: [email protected] = current_thread_pointer0A8E: [email protected] = [email protected] + 0xDC 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 // bMissionFlagif [email protected] == 1 then [email protected] += 0xA48960 // pMissionLocalselse 005A: [email protected] += [email protected] [email protected] += 0x3C // pThreadLocalsend0AB2: ret 1 [email protected] Do not thank me for this, all credits should go to @Wesser : Source Link to comment Share on other sites More sharing options...
zag40 Posted March 24, 2016 Author Share Posted March 24, 2016 dont know what to say this is awesome so I have to thanks for helping me anyway Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now