vladvo Posted February 27 Share Posted February 27 (edited) It is possible to do ? I need to print a string that would contain 2 gxt keys and "regular" text (guess regular might be replaced with gxt as well). In the end it should look like: "Bring (gxt_key1) to (gxt_key2)" Might as well be "(gxt_key3) (gxt_key1) (gxt_key4) (gxt_key2)". The purpose of it is to release variables because the text that I want to put in gxt_key1 and gxt_key2 is already long_sting and it uses 4 vars per. I can find a better use for them. P.S. By gxt_key I mean entries in .fxt file. Edited February 27 by vladvo Link to comment Share on other sites More sharing options...
Jack Posted February 28 Share Posted February 28 while true wait 0 05AA: [email protected] = 'gxt_key1' // [email protected] ---> [email protected], [email protected] 05AA: [email protected] = 'gxt_key2' // [email protected] ---> [email protected], [email protected] 05AA: [email protected] = 'gxt_key3' // [email protected] ---> [email protected], [email protected] 05AA: [email protected] = 'gxt_key4' // [email protected] ---> [email protected], [email protected] 0AD3: [email protected] = format "%s%s%s%s" [email protected] [email protected] [email protected] [email protected] // [email protected] ---> long string if TIMERA >= 3000 // 3 seconds then 0ACA: show_text_box [email protected] // [email protected] ---> [email protected], [email protected], [email protected], [email protected] TIMERA = 0 // reset the timer end end // while end 0ACA opcode can only print certain num of characters - that does not mean the strings are not written to all of the variables. Note: Make sure the SB is set to "Case Converting - As is": Tools - Options - Formats - Case Converting - As is. Wanted Level Editor Gore Level Effect [III] My YouTube Channel Link to comment Share on other sites More sharing options...
OrionSR Posted February 28 Share Posted February 28 (edited) 21 hours ago, vladvo said: It is possible to do ? Yes, but the process is complex and variable intensive. An easier solution to complex strings in cleo scripts is counter intuitive, unless you consider that SCM isn't the least bit happy about managing strings, and the severe limit of available variables in scripts. Instead, work with the strength of cleo scripts - they can be quite large. Consider using a spreadsheet or word processor to create every possible combination of strings you may require in a jump table (switch case) format that assigns the string to a dynamic gxt key. :String_01030502 0ADF: add_text_label "_TEST" text "John hates green eggs." jump @End_of_String_Table :String_02040502 0ADF: add_text_label "_TEST" text "Sam likes green eggs." jump @End_of_String_Table Edited February 28 by OrionSR Link to comment Share on other sites More sharing options...
vladvo Posted February 28 Author Share Posted February 28 2 hours ago, OrionSR said: Consider using a spreadsheet or word processor to create every possible combination of strings Thanks. So far I came up to using only 2 gxt keys. Just need to position them on screen the right way. 033E: set_draw_text_position [email protected] [email protected] GXT '400' 033E: set_draw_text_position [email protected] [email protected] GXT '1022' 5 hours ago, Jack said: 0ACA opcode can only print certain num of characters - that does not mean the strings are not written to all of the variables. Thanks, I know this method. Unfortunately, it involves exactly what I am trying to avoid - using too much variables. This is why I am switching to gxt entries. Besides, in my case the string that would be the sum of all four 'smaller' strings will be more that 15 chars. Link to comment Share on other sites More sharing options...
ZAZ Posted February 28 Share Posted February 28 (edited) 7 hours ago, Jack said: while true wait 0 05AA: [email protected] = 'gxt_key1' // [email protected] ---> [email protected], [email protected] 05AA: [email protected] = 'gxt_key2' // [email protected] ---> [email protected], [email protected] 05AA: [email protected] = 'gxt_key3' // [email protected] ---> [email protected], [email protected] 05AA: [email protected] = 'gxt_key4' // [email protected] ---> [email protected], [email protected] 0AD3: [email protected] = format "%s%s%s%s" [email protected] [email protected] [email protected] [email protected] // [email protected] ---> long string if TIMERA >= 3000 // 3 seconds then 0ACA: show_text_box [email protected] // [email protected] ---> [email protected], [email protected], [email protected], [email protected] TIMERA = 0 // reset the timer end end // while end 0ACA opcode can only print certain num of characters - that does not mean the strings are not written to all of the variables. Note: Make sure the SB is set to "Case Converting - As is": Tools - Options - Formats - Case Converting - As is. Nice template @Jack but it doesn't show of content of gxt/fxt connection, it shows directly the string entries of 05AA: Spoiler it displays gxt_key1 gxt_key2... {$CLEO .cs} thread 'FORMTXT' 0ADF: add_dynamic_GXT_entry "gxt_key1" text "Bring me a" 0ADF: add_dynamic_GXT_entry "gxt_key2" text "Gatling gun" 0ADF: add_dynamic_GXT_entry "gxt_key3" text "to my house in" 0ADF: add_dynamic_GXT_entry "gxt_key4" text "Palomino Creek" while true wait 0 05AA: 0@s = 'gxt_key1' // 0@s ---> [email protected], [email protected] 05AA: 2@s = 'gxt_key2' // 2@s ---> [email protected], [email protected] 05AA: 4@s = 'gxt_key3' // 4@s ---> [email protected], [email protected] 05AA: 6@s = 'gxt_key4' // 6@s ---> [email protected], [email protected] 0AD3: 8@v = format "%s%s%s%s" 0@s 2@s 4@s 6@s // 8@v ---> long string if TIMERA >= 3000 // 3 seconds then 0ACA: show_text_box 8@v // 8@v ---> [email protected], [email protected], [email protected], [email protected] TIMERA = 0 // reset the timer end end // while end it displays "I can read text" while true wait 0 05AA: 0@s = 'I' // 0@s ---> [email protected], [email protected] 05AA: 2@s = 'can' // 2@s ---> [email protected], [email protected] 05AA: 4@s = 'read' // 4@s ---> [email protected], [email protected] 05AA: 6@s = 'text' // 6@s ---> [email protected], [email protected] 0AD3: 8@v = format "%s %s %s %s" 0@s 2@s 4@s 6@s // 8@v ---> long string if TIMERA >= 3000 // 3 seconds then 0ACA: show_text_box 8@v // 8@v ---> [email protected], [email protected], [email protected], [email protected] TIMERA = 0 // reset the timer end end // while end Edited February 28 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
vladvo Posted February 28 Author Share Posted February 28 Damn. Still stuck. Using two 033E opcode (033E: set_draw_text_position [email protected] [email protected] GXT '400') works in one place of the script but it is unusable in another. The problem is that this opcode must be in a loop to work. And I can't add loops or waits wherever I need a string printed. 00BC: show_text_highpriority GXT 'CTMBOSC' time 3000 flag 1 is very comfortable to use but it shows only one GXT at a time. I need to show two GXTs at the same so that everything looks nice but it seems that it's impossible with this opcode. And looks like there is no way to merge two gxt 'on the fly' without using a lot of variables. Maybe it's possible to do that through memory editing, like find certain gxt offset and add text there but I think this will require a lot of effort. Quote Consider using a spreadsheet or word processor to create every possible combination of strings you may require in a jump table OrionSR, that's a nice idea, but in my case it would be 3168 entries )) Link to comment Share on other sites More sharing options...
OrionSR Posted March 1 Share Posted March 1 (edited) How about opcode 0384? PRINT_STRING_IN_STRING_NOW Displays a styled message in which the first string token ~a~ is substituted with the specified text 9 hours ago, vladvo said: find certain gxt offset and add text there but I think this will require a lot of effort. A similar solution would be to construct your string in a memory buffer and redirect a standard gxt key's pointer to the start of the buffer. I've used the pointer redirection strategy before to create custom text without cleo. I'm not sure if I can find the documentation for PC though. Most of the work was done on PS2. Shouldn't be too tough to recreate. I was using the global variable space to hide strings in save files for PS2. This is possible on PC too, but it would be better practice to create a buffer within your script - something I've seen frequently but never tried. Consider farming out some of your variable intensive processes to custom cleo functions or other cleo scripts. 0AB1: cleo_call @GetSQR 1 10 $result 0A92: stream_custom_script "ShowTextBox.s" Update: I found the topic where I was tweaking GXT pointers. There isn't a lot of technical reference. And a multi-version script showing the process, but saved in a PS2 configuration. eCoords4.txt Added: PC version of eCoords4.txt - looks like it's been edited since it was originally created. There's a lot of weirdness in these scripts, like aDMA memory addressing and out of range global variables, because PS2 can't use cleo opcodes. The process would be much easier with cleo. Edited March 1 by OrionSR Link to comment Share on other sites More sharing options...