Jump to content

» «

Weird text string bug

3 replies to this topic
  • arielnmz


  • Members
  • Joined: 17 Jun 2011


Posted 04 December 2013 - 07:21 PM

Hello everyone, this is the problem


I create a new formatted string and store it to [email protected] like this:

0AD3: string [email protected] format "obj_id_%d" OBJ_MODEL // Nombre de sección de ini

And if I store something into var [email protected], the text is displayed like this:

obj_ -Ûi62

However, anywhere in the script before storing anything into [email protected], the text is displayed/read correctly:


Then I tried to use this:

0AC8: [email protected] = allocate_memory_size 64

But I get the same results.


I hope you can help me... Thank you everyone!

  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]
    Helpfulness Award [Mods]


Posted 04 December 2013 - 07:37 PM

That's because [email protected] variable will use 4 variables - [email protected], [email protected], [email protected], [email protected] to store the string.
So while you need text in [email protected], you must not touch these variables.

  • arielnmz


  • Members
  • Joined: 17 Jun 2011


Posted 04 December 2013 - 08:16 PM

Ok, so you say locals are stored into contiguous addresses?? What if I allocate 32 bytes on [email protected]?? Thanks!

  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful in Modding 2017
    Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012


Posted 04 December 2013 - 09:14 PM

If you want to use CLEO4 opcodes with allocated memory, just refer to regular variables, and not longstrings. In your case, use [email protected] in sprintf (after you've called memory alloc, storing the memory pointer to this var).

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users