Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

SA Merging gxt keys and regular text. Or just merge 4 gxt keys. Possible ?


vladvo
 Share

Recommended Posts

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 by vladvo
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by OrionSR
Link to comment
Share on other sites

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

 

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 by ZAZ
Link to comment
Share on other sites

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

OrionSR

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 by OrionSR
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.