Coding

 Reply to this postStart new topic

Question to the Usage of '0ADF: add_dynamic_GXT_entry'

ATP
post Jan 7 2012, 04:37 PM
Post #1


GTA United Lead Developer

Posts: 52
From: Germany
Joined: 23-April 11



Hey,
if I use this:
SANNY
0004: $INDEX = 0
06D1: v$GXT_NAME[0] = "BLUBGXT"
0ADF: add_dynamic_GXT_entry $GXT_NAME($INDEX,50v) text "This is my great new GXT entry, it is just awesome."

It works fine.

But if I use this:
SANNY
0004: $INDEX = 0
06D1: v$GXT_NAME[0] = "BLUBGXT"
06D1: v$GXT_CONTENT[0] = "This is my great new GXT entry, it is just awesome."
0ADF: add_dynamic_GXT_entry $GXT_NAME($INDEX,50v) text $GXT_CONTENT($INDEX,50v)

The text appears clipped ingame.

Any idea? Maybe wrong usage of the data type?


--------------------
Go to the top of the page
 
+Quote Post
Wesser
post Jan 7 2012, 04:52 PM
Post #2


The Assistant

Posts: 84
From: Matera, IT
Joined: 16-June 11



s$/@s refers to a 8-byte string, that is 2 variables are used (both have 4 bytes). On the other side, v$/@v writes 16 bytes only to the variable buffer, that is 4 variables of 4 bytes keep overwrited. That issue regards the limited data type a scm variable can have.

This post has been edited by Wesser: Jan 7 2012, 04:55 PM
Go to the top of the page
 
+Quote Post
ATP
post Jan 7 2012, 04:59 PM
Post #3


GTA United Lead Developer

Posts: 52
From: Germany
Joined: 23-April 11



Ok, so there is no way to get longer data types?


--------------------
Go to the top of the page
 
+Quote Post
Wesser
post Jan 7 2012, 05:18 PM
Post #4


The Assistant

Posts: 84
From: Matera, IT
Joined: 16-June 11



Not yet. Use labels instead. wink.gif
Go to the top of the page
 
+Quote Post
Silent
post Jan 7 2012, 11:52 PM
Post #5


The master of cut retort

Group Icon

Posts: 239
From: Warsaw, PL
Joined: 21-July 10



QUOTE (Wesser @ Jan 7 2012, 06:18 PM) *
Not yet. Use labels instead. wink.gif


Well, PARTIALLY you can do it:

SANNY
0AC8: 0@ = allocate_memory_size 260
0AD3: 0@ = format "Hello world, it's a long entry, which gets saved in this malloc!"
0ADF: add_dynamic_GXT_entry "ENTRY" text 0@
0AC9: free_allocated_memory 0@
Go to the top of the page
 
+Quote Post
Wesser
post Jan 8 2012, 10:09 AM
Post #6


The Assistant

Posts: 84
From: Matera, IT
Joined: 16-June 11



Does 0ADF accepts pointers? I'm not friendly with CLEO4. tongue.gif
Go to the top of the page
 
+Quote Post
Silent
post Jan 8 2012, 12:27 PM
Post #7


The master of cut retort

Group Icon

Posts: 239
From: Warsaw, PL
Joined: 21-July 10



Yeah, this code is perfectly valid.
Go to the top of the page
 
+Quote Post
Deji
post Jan 8 2012, 03:15 PM
Post #8


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



QUOTE (Wesser @ Jan 8 2012, 10:09 AM) *
Does 0ADF accepts pointers? I'm not friendly with CLEO4. tongue.gif


Maybe you could fix it? The source was made available, I just find the compiler requirements demanding. It's also written in a style of C++ I'm not acquainted with and uses AT&T ASM tongue.gif

Or we just wait for CLEO 5...


--------------------
Go to the top of the page
 
+Quote Post
fastman92
post Jan 9 2012, 03:39 PM
Post #9


Trained Member

Posts: 77
Joined: 25-October 10



CLEO4 string opcodes require string variable or int variable
If it`s int variable e.g 4@ then CLEO4 opcode will use value on memory address taken from 4@
If it`s 4@s or 4@v - store string in usual way.
However INT variables as pointers instead of string variables don`t work in CLEO3.
Go to the top of the page
 
+Quote Post
ATP
post Jan 9 2012, 08:43 PM
Post #10


GTA United Lead Developer

Posts: 52
From: Germany
Joined: 23-April 11



thx for all answers wink.gif


--------------------
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: