Jump to content

» «

8-byte strings and arrays

2 replies to this topic
  • Opius


  • Feroci
  • Joined: 27 Jun 2002


Posted 18 June 2005 - 12:30 PM

Alright, I've been trying for the last six hours to get to work and I still cannot see why this isn't working.

My final goal is to make something similar to an associative array. You put the cars ID number into this array as the index, and the value returned is the GXT key for the cars name.

Now, I can get this to work, EXTREMELY basically. See below.
05A9: $motherf*cker1 = 'MTIME3';; 8-byte strings    
05A9: $motherf*cker1(1) = 'MOREREP';; 8-byte strings
05A9: $motherf*cker1(2) = 'MTIME3';; 8-byte strings
05A9: $motherf*cker1(3) = 'MOREREP';; 8-byte strings
05A9: $motherf*cker1(4) = 'MTIME3';; 8-byte strings

05A9: s$motherf*cker1 = 'MTIME3';; 8-byte strings    
05A9: s$motherf*cker1(1) = 'MOREREP';; 8-byte strings
05A9: s$motherf*cker1(2) = 'MTIME3';; 8-byte strings
05A9: s$motherf*cker1(3) = 'MOREREP';; 8-byte strings
05A9: s$motherf*cker1(4) = 'MTIME3';; 8-byte strings

0006: @0 =  0 ;; integer values

00D6: if  0
8039: NOT  @0 ==  5 ;; integer values
004D: jump_if_false ££opiusyayberak
0001: wait  100 ms
00BC: text_highpriority $motherf*cker1(@0,5s) 10000 ms  1
000A: @0 +=  1;; integer values
0002: jump ££opiusarraysizetest


Now, to point out a few things. NOTHING gets printed to the screen unless I have the array first set out WITHOUT the 's$'. Why, I have no idea.

Secondly, take note of how I address the array. The value after the index is how many indexes are in the array. Again, without that, nothing works.

Thirdly, see the 's' right after the number of indexes? I can only assume that tells it that there strings in the array, but guess what? Without it, nothing works.

Anyway, that code works fine, but as soon as I enlarge it past around 30 or so, the game will crash.

Now, I'm pretty damn sure I'm doing everything exactly as Rockstar have in the original script, so I have no idea why I'm still having problems with arrays larger than ~30 entries. I'd love it if someone could give me a hand with this.

And one final, sorta off-topic question: Are the vehicle name texts stored in a different key of the GXT? Even with a normal, non-variable-using text command I wasn't able to print ANY of the vehicles names.

  • random_download


  • Members
  • Joined: 07 Mar 2004


Posted 18 June 2005 - 01:08 PM

Vehicle names are in the MAIN table of gxt. In the gxt the key names are just dword numbers instead of strings.
Link to gxt editor.

  • Y_Less


  • Members
  • Joined: 14 Mar 2004


Posted 18 June 2005 - 06:35 PM

Last line:


Seems like you copied the text wrong, could this be what is causing your problem?

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users