#51 07-06-2010 04:35

Alien
Registered: 12-10-2008
Posts: 564

Re: CLEO 4. Questions and bug reports.

0A99 can't be used in start of script. The game is not fully loaded before the first iteration of script executed. Try to add some sleeping time in the begin of script (or 2 'wait 0').

{$CLEO}
wait 0
wait 0
0A99: chdir "cleo"
0A99: chdir 0
0A93: end_custom_thread

About shortcuts. It's binary files with .lnk extension and it's format opened for learning.
Microsoft documentation.
It's possible to write lnk-parser in cleo script or cleo plugin to retrieve information about path, working directory, hotkey, cmdShow value, commentary etc...

Also, i've alredy thought about writing mp3-player in cleo using find_first_file, find_next_file, but have not enough time=).

Last edited by Alien (07-06-2010 04:38)

Offline

#52 07-06-2010 13:55

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

Shortcuts are scanned by the opcodes when using "*.mp3" (with most windows-created shortcuts, the shortcut uses the same filename), which makes the only way to differentiate them is to try to open them as audio. If it fails, it's most likely a shortcut.

The MP3 player works great. There is the inability to go back a file, though, but I'm thinking of adding playlist support. Or all filenames could be pre-scanned and written to a label, then the label could be read each time, but I think that would require way too much thread memory.

For me, chdir still crashed in the MP3 script, which is activated via cheat, so is not instant. I'll try and see if any other scripts are running similar lines.


EDIT

:MP3_BEGIN
if
    8AE6:   not 1@ = find_first_file "CLEO\MP3\*.*" get_filename_to 2@
then
    0ACA: show_text_box "~r~Error: No files found."
    jump @MP3
end
0ACA: show_text_box 2@
wait 2000

Code doesn't return "No Files Found", however, it doesn't play the audiostream, either.

Returns:

.

Wildcard not supported for extensions?

Last edited by Deji (07-06-2010 20:11)

Offline

#53 09-06-2010 10:45

Alien
Registered: 12-10-2008
Posts: 564

Re: CLEO 4. Questions and bug reports.

'*' represents any number (including 0) of any characters. The name "." is fully consistent with the mask "*.*". This name is a link of directory to itself.
there are 2 special sub-folders in each folder - "." and "..".
"." - link to itself.
".." - link to parent folder.
Windows Explorer filters these names and they never appears in it... Therefore, many users are unaware of these links.=)
Make sure that founded name is not one of described above. Or check that founded file is not a directory (0AE4: directory_exist "CLEO\CLEO_INI"). Or just try to load founded as an audiostream. Opcode will return FALSE on any non-audio file or folder.

Offline

#54 01-07-2010 13:24

Silent
Registered: 08-05-2010
Posts: 29

Re: CLEO 4. Questions and bug reports.

Hm, some bugs or my mistake?

In my mod I'm going to check main.scm size. At the end of mission 0 I've pasted:

0A99: chdir 1 // Reading some values from GTA SA User Files
0AF0: $KEY_TRUNKKEY = get_int_from_ini_file "gta_95.set" section "controls" key "trunkkey"
0AF0: $KEY_AIMKEY = get_int_from_ini_file "gta_95.set" section "controls" key "aimkey" 
0A99: chdir 0
while true
    if
          8A9A: not 1@ = openfile "data\script\main.scm" mode 0x6272 // IF and SET    
    jf break
    wait 0
end 
0A9C: 2@ = file 1@ size
01E5: show_text_1number_highpriority GXT 'NUMBER' number 2@ time 5000 flag 1
0A9B: closefile 1@
end_thread

The game reads values from gta_95.set without problems, but looks like it doesn't go back to SA directory. Checking main.scm size with reading integers (and both chdirs) commented works, adding waits don't make a difference.

Plus, game reads main.scm in that opcode format, but when I've used:

8A9A: not 1@ = openfile "data\script\main.scm" mode "rb" // IF and SET

game crashed.

Edit: I'm using the newest CLEO4 version, 4.1.1.25.

Last edited by SilentPL (01-07-2010 13:33)

Offline

#55 02-07-2010 00:31

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

while true
    if
          8A9A: not 1@ = openfile "data\script\main.scm" mode 0x6272 // IF and SET    
    jf break
    wait 0
end

I'm not sure, but does "jf break" work? Sanny is coded to allow that? If not, use "then break end" and turn the opcode to 0A9A.

And Click...

Last edited by Deji (02-07-2010 00:32)

Offline

#56 02-07-2010 15:10

Silent
Registered: 08-05-2010
Posts: 29

Re: CLEO 4. Questions and bug reports.

Yes, Sanny supports 'jf break'. This loop isn't a problem, because after commenting ini loads and both chdirs everything works fine.

And, while mission 0 is executed, game is fully loaded - about 4-5 second after full game load.

Last edited by SilentPL (02-07-2010 15:10)

Offline

#57 02-07-2010 16:54

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

0AF0: $KEY_AIMKEY = get_int_from_ini_file "gta_95.set" section "controls" key "aimkey"

I don't understand your script too well. What is contained within this gta_95.set file? Made sure the sections and keys match the file exactly?


I perfer to skip the use of IniFiles with:

0ADA: 0@ = scan_file $hFile format "iniSetting=%d" 1@

No easy support for sections, but overall the support is much more. You can read a sequence of file settings:

0ADA: 0@ = scan_file $hFile format "iniSetting=%d %d %d" 1@ 2@ 3@

Or read a certain length of a number.

0ADA: 0@ = scan_file $hFile format "iniSetting=%.2d/%.2d/%.4d - %.2d:%.2d\n" 1@ 2@ 3@ 4@ 5@
iniSetting=02/07/2010 - 16:54

This reads an IP:Port address. Will not work with anything (except a newline) at the end of the setting line, but ensures that it is actually an IP address

See the string convention for more supported parameters like %d - You can mix types (%d-%s) as well. So overall, much better support from that opcode.

Offline

#58 02-07-2010 17:08

Silent
Registered: 08-05-2010
Posts: 29

Re: CLEO 4. Questions and bug reports.

Deji, ini reading is not a problem, that's working fine. The problem is on chdir 0 - script can't go back to San Andreas directory to read main.scm size (and other files also). Without chdirs (and ini reading, cause gta_95.set is in GTA SA User Files) it works.


@down
I know this technicue too, but with this I can check only one conditional ;P

Last edited by SilentPL (02-07-2010 20:35)

Offline

#59 02-07-2010 18:06

Den_spb
From: Ленинград
Registered: 23-11-2008
Posts: 941
Website

Re: CLEO 4. Questions and bug reports.

while true
    if
          8A9A: not 1@ = openfile "data\script\main.scm" mode 0x6272 // IF and SET   
    jf break
    wait 0
end

It's easier to write:

while 8A9A: not 1@ = openfile "data\script\main.scm" mode 0x6272 // IF and SET    
    wait 0
end

Offline

#60 02-07-2010 23:54

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

0ADA: 0@ = scan_file 1@ format "\r\nMP3Dir=%s\r\n" 2@

Cannot retrieve strings using 0ADA. Maybe intentional, but a huge pain in the ass from my position.

There is seemingly no way to test whether a string variable matches a string larger than 4 bytes without matching multiple 4 byte variables.

Sprinkle me with wisdom on another possible way to do this.


EDIT

I found out that 0AD7 uses it's own starting position (not manipulated by 0AD5). So I can just keep repeating 0AD7 to read each line... Still, a way to compare strings is needed (would strings over 4 bytes work with 0039?).


EDIT 2

I'd love to know what is wrong with this... The error makes no sense.

if
    0A9A: M3U = openfile M3U_FILE mode 'rt'   // read file in text mode
then
    0A99: chdir 0
    while true
        if
            8AD7:   not read_string_from_file M3U to MP3_FILE size 260   // read 260 bytes of each line (or all of the bytes of a smaller line)
        then
            0ACA: show_text_box "No Files Found."	// the whole file was scanned. no existing files found.
            jump @MP3_END
        end
        if
            0AAB:   file_exists MP3_FILE	// if 0AD7 returned a line of text referring to an existing file.
        then
            break
        end
    end
    0ACE: show_formatted_text_box "%s" MP3_FILE   // should print "C:/Music/song.mp3"
    wait 3000
    jump @MP3_PLAY
end

(M3U FILE)

C:/Music/song.mp3

The file exists at the right location. 0AD7 is successfully retrieving the exact text, however, 0AAB returns false whenever I've read the filepath from the memory.

But if I typed compiled the exact same filepath into 0AAB, or compiled storing the path into MP3_FILE, the 0AAB returns true.

Is there some sort of difference in .txt formats that is unsupported? They both appear the same. I've even scanned them and the hex is the same, yet both return different results.

Last edited by Deji (04-07-2010 23:01)

Offline

#61 06-07-2010 14:04

Alien
Registered: 12-10-2008
Posts: 564

Re: CLEO 4. Questions and bug reports.

Deji wrote:
0ADA: 0@ = scan_file 1@ format "\r\nMP3Dir=%s\r\n" 2@

Cannot retrieve strings using 0ADA. Maybe intentional, but a huge pain in the ass from my position.

Unfortunately, SB does not support escape sequences in strings. Use 0AD7 to skip new-line symbols.

Deji wrote:

There is seemingly no way to test whether a string variable matches a string larger than 4 bytes without matching multiple 4 byte variables.

Sprinkle me with wisdom on another possible way to do this.

Try to call 'strlen' function from exe:

05E2: call_function 0x826330 num_params 1 pop 1 your_string 0@v get_len_to 4@
Deji wrote:

I found out that 0AD7 uses it's own starting position (not manipulated by 0AD5). So I can just keep repeating 0AD7 to read each line... Still, a way to compare strings is needed (would strings over 4 bytes work with 0039?).

Here's some mistake. 0AD7 must read the contents of the current pointer position.

I'd love to know what is wrong with this... The error makes no sense.

may be new-line symbols (\r\n) interfere at the end of string MP3_FILE.

Offline

#62 06-07-2010 15:03

Silent
Registered: 08-05-2010
Posts: 29

Re: CLEO 4. Questions and bug reports.

Alien, how about that possible bug, which I've posted above?

Offline

#63 17-07-2010 08:20

dva511
Registered: 06-04-2010
Posts: 1

Re: CLEO 4. Questions and bug reports.

Is there a way to get CLEO 4 working with Streaming Memory Fix 2.0 ? , when i place the Streaming Memory Fix 2.0  files into my game main folder Memory fix wont work the textures disaper and buildings due to car mods. Seems like CLEO 4 is not compatible with this other mod, but is it posible to get them working together?

Offline

#64 17-07-2010 08:38

~AquaZ~
Registered: 01-03-2010
Posts: 726

Re: CLEO 4. Questions and bug reports.

On my computer CLEO working with Stream mem fix...

Offline

#65 26-07-2010 17:18

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

Apologies... Crashes with IntOperations, iniFiles and FileSystemOperations were caused by a SASCM.ini downloaded from the Opcode Database (wrong parameter order). This issue has been fixed.

I never actually had a chance to look through the developer files to see the .ini lines and none were posted elsewhere, so I made the parameters in-order like this:

0AF4=4,%1d% = read_string_from_ini_file %2s% section %3s% key %4s%

Lack of attention there, sorry.

Offline

#66 28-07-2010 18:39

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

Thought I'd take a chance to ask the GTAForums community what problems they were having with mods working on CLEO 4.

Here's a Missile one by Ryosuke that causes problems.

//0A99: chdir 0
0A9A: 30@ = openfile "cleo\missile.dat" mode "rb"//0x6272  // IF and SET
for 33@ = 0 to 23
    0AA7: call_function 0x536F80 num_params 1 pop 1 30@ 11@
    {0A8D: 12@ = read_memory 11@ size 1 virtual_protect 0
    if
    0039:   12@ == 0
    then
        break
    end 
    if
    0039:   12@ == 0x3B
    then
        000E: 33@ -= 1 
        continue
    end 
    0AA5: call 3@(3@,1i) num_params 3 pop 3 11@ 13@ 14@
    000A: 14@ += 0xA0}
end
0A9B: closefile 30@

Problem is caused by calling SA's getConfigLine, which apparently worked on CLEO 3.

CLEO 4 probably differs its method of file opening? It would indeed be nice for files to work with SA function calls.

Offline

#67 03-08-2010 18:49

dihion
Registered: 28-05-2010
Posts: 1

Re: CLEO 4. Questions and bug reports.

SAMP Related Issue

After downloading Cleo 4, I load the .exe and I choose my gta folder and I begin installing, it installs correctly then I get these errors;

cleo4prob.png

After clicking ignore for them, the install completes. Once I try to connect to a server, I obtain this error.

Exception At Address: 0x54414454

Registers:
EAX: 0x00C1AEB8	EBX: 0x00001534	ECX: 0x00000000	EDX: 0x0028F344
ESI: 0x00865264	EDI: 0x006A03BC	EBP: 0x00000008	ESP: 0x0028F368
EFLAGS: 0x00010206

Stack:
+0000: 0x52454D41   0x4E414349   0x5458472E   0x00000000
+0010: 0x00000004   0x007466DA   0x00000000   0x00000018
+0020: 0x00000000   0x0028F3E0   0x00000000   0x007474D3
+0030: 0x00000000   0x00000000   0x00000000   0x000003F8
+0040: 0x0101DE63   0x0028F2E4   0x0028F3F0   0x0028F424
+0050: 0x772D03DD   0x1C439585   0xFFFFFFFE   0x77292E3A
+0060: 0x77292A32   0x00000000   0x015927A8   0x015927A8
+0070: 0x01592800   0x00000000   0x015927A0   0x0028F3F8
+0080: 0x760F14D1   0x01590000   0x00000000   0x015927A8
+0090: 0x0028F434   0x008241EA   0x01590000   0x00000000
+00A0: 0x008241EF   0x01592800   0x00000000   0x00000000
+00B0: 0x75F22BD0   0x0028F40C   0x0028F42C   0x0028F61C
+00C0: 0x00825EE4   0x00888038   0xFFFFFFFF   0x008241EF
+00D0: 0x00406C83   0x00000018   0x00541ABC   0x00B73696
+00E0: 0x00541DA5   0x00000001   0x00000001   0x00000000
+00F0: 0x0028F62C   0x0053EC35   0x00619B71   0x00000018
+0100: 0x00000000   0x760F1225   0x00000000   0x0074878E
+0110: 0x00000018   0x00000000   0x7EFDE000   0x01590000
+0120: 0x00000000   0x00828CF3   0x00856CC0   0x008A5A08
+0130: 0x7EFDE000   0x008A5A10   0x008E3200   0x00856CC0

SCM Op: 0x0, lDbg: 0

Game Version: EU 1.0

And this error after closing the first one.

Exception At Address: 0x00823CDC

Registers:
EAX: 0x0082AC4E	EBX: 0x0028F61C	ECX: 0xE2BD0000	EDX: 0x0008E8B8
ESI: 0x00000000	EDI: 0xC0000005	EBP: 0x0028F500	ESP: 0x0028F4FC
EFLAGS: 0x00010246

Stack:
+0000: 0xC0000005   0x0028F62C   0x00823D0C   0xC0000005
+0010: 0x00000001   0x00000000   0x0082476E   0xC0000005
+0020: 0x00000094   0x00000006   0x00000000   0x00001770
+0030: 0x00000002   0x75F2DA00   0x75F507A8   0x00000000
+0040: 0x01AA15A0   0x6B43A669   0x0028F3FC   0x75F1B392
+0050: 0x0028FF78   0x772D03DD   0x1C43E855   0xFFFFFFFE
+0060: 0x7729C389   0x00000000   0x01AA0000   0x01B13E68
+0070: 0x77297BC3   0x00000001   0x00000020   0x0028F5E4
+0080: 0x00000000   0x01AA0000   0x01B13E68   0x7728E592
+0090: 0x01B13E68   0x00A20012   0xBB087234   0x01544304
+00A0: 0x7728E5C5   0x6B43A6E5   0x01B139A0   0x00000001
+00B0: 0x008245C8   0x00000000   0x00001770   0x7EFDE000
+00C0: 0xC0000005   0x7EFDE000   0x01AA332A   0x00000044
+00D0: 0x01AE1050   0x01AE3048   0x01AE3FF8   0x00000000
+00E0: 0x00000000   0x00000000   0x00000000   0x00000000
+00F0: 0x00000000   0x00000000   0x00000000   0x00000000
+0100: 0x00000000   0xFFFFFFFF   0xFFFFFFFF   0xFFFFFFFF
+0110: 0x00000000   0x00000000   0x0028F51C   0x0028F0D0
+0120: 0x0028FF78   0x00825EE4   0x00888078   0xFFFFFFFF
+0130: 0x0028F678   0x760F3677   0x7EFDE000   0x01559502

SCM Op: 0x0, lDbg: 0

Game Version: EU 1.0

After putting in the compact .exe, the game loads until the start of SAMP loading screen, then crashes and I recieve these two errors

Exception At Address: 0x004C67BB

Registers:
EAX: 0x00000000	EBX: 0x0000008B	ECX: 0x00B4C2D4	EDX: 0x0028FA8C
ESI: 0x00B4C2D4	EDI: 0x00000008	EBP: 0xFFFFFFFF	ESP: 0x0028FAA8
EFLAGS: 0x00010206

Stack:
+0000: 0x00000241   0x005B74AC   0x00000124   0x00B71848
+0010: 0x00869834   0x0028FB04   0x0028FB28   0x0028FB9C
+0020: 0x0028FB84   0x0028FB54   0x0028FB6C   0x0028FB14
+0030: 0x0028FB10   0x0028FB18   0x0028FB0C   0x0028FB08
+0040: 0x0028FB40   0x0028FBB4   0x0028FBF0   0x00000008
+0050: 0x00000241   0xFFFFFFFF   0x008E2C64   0x00000124
+0060: 0x00000004   0x00000001   0x00000000   0x00001FFF
+0070: 0x6C6C756E   0x00000000   0xFF000013   0x0083421D
+0080: 0x41534543   0x03000052   0x00000026   0x0028FB74
+0090: 0x00C9C300   0x00000090   0x5F444550   0x45505954
+00A0: 0x4E45475F   0x0B700D00   0x00001000   0x54415453
+00B0: 0x5254535F   0x5F544545   0x00595547   0x00C9C300
+00C0: 0x00000004   0x006E616D   0x0028FB00   0x00833E01
+00D0: 0x00DD08FC   0x0082B6A4   0x00000004   0x4D564943
+00E0: 0x00454C41   0x008E2CB0   0x00B71848   0x00000A9A
+00F0: 0x00B71848   0x41534543   0x00B70052   0x00B71848
+0100: 0x008E2CB0   0x0028FBB8   0x0082AD25   0x43494F56
+0110: 0x4E475F45   0x45435F47   0x00524153   0x0082381C
+0120: 0x008E2CB0   0x00823812   0x00000008   0x00B71848
+0130: 0x008E2C64   0x00B718B8   0x0000000A   0x008E2CB0

SCM Op: 0x0, lDbg: 0

Game Version: US 1.0
Exception At Address: 0x004C67BB

Registers:
EAX: 0x00000000	EBX: 0x0000008B	ECX: 0x00B4C2D4	EDX: 0x0028FA8C
ESI: 0x00B4C2D4	EDI: 0x00000008	EBP: 0xFFFFFFFF	ESP: 0x0028FAA8
EFLAGS: 0x00010206

Stack:
+0000: 0x00000241   0x005B74AC   0x00000124   0x00B71848
+0010: 0x00869834   0x0028FB04   0x0028FB28   0x0028FB9C
+0020: 0x0028FB84   0x0028FB54   0x0028FB6C   0x0028FB14
+0030: 0x0028FB10   0x0028FB18   0x0028FB0C   0x0028FB08
+0040: 0x0028FB40   0x0028FBB4   0x0028FBF0   0x00000008
+0050: 0x00000241   0xFFFFFFFF   0x008E2C64   0x00000124
+0060: 0x00000004   0x00000001   0x00000000   0x00001FFF
+0070: 0x6C6C756E   0x00000000   0xFF000013   0x0083421D
+0080: 0x41534543   0x03000052   0x00000026   0x0028FB74
+0090: 0x00C9C300   0x00000090   0x5F444550   0x45505954
+00A0: 0x4E45475F   0x0B700D00   0x00001000   0x54415453
+00B0: 0x5254535F   0x5F544545   0x00595547   0x00C9C300
+00C0: 0x00000004   0x006E616D   0x0028FB00   0x00833E01
+00D0: 0x00DD08FC   0x0082B6A4   0x00000004   0x4D564943
+00E0: 0x00454C41   0x008E2CB0   0x00B71848   0x00000A9A
+00F0: 0x00B71848   0x41534543   0x00B70052   0x00B71848
+0100: 0x008E2CB0   0x0028FBB8   0x0082AD25   0x43494F56
+0110: 0x4E475F45   0x45435F47   0x00524153   0x0082381C
+0120: 0x008E2CB0   0x00823812   0x00000008   0x00B71848
+0130: 0x008E2C64   0x00B718B8   0x0000000A   0x008E2CB0

SCM Op: 0x0, lDbg: 0

Game Version: US 1.0

Anyone know how to fix this? Please reply, thanks!

Offline

#68 04-08-2010 20:16

Alien
Registered: 12-10-2008
Posts: 564

Re: CLEO 4. Questions and bug reports.

Does CLEO 4 works in SAMP at all? I have never tested it.
The first error (on EU 1.0) occures on playing intro video. The second (on 1.0 us) - on loading peds.ide. Try with the clean installation of game.

Offline

#69 10-08-2010 16:08

ATP
Registered: 07-07-2009
Posts: 15
Website

Re: CLEO 4. Questions and bug reports.

Hi,
I found a (compatibility?) bug in CLEO4. I created a little test script for getting weapon informations form the memory, with CLEO3 it works correctly, look here:
80650249.th.jpg

But with CLEO4 it shows wrong data:
34161859.th.jpg

Is that a bug in CLEO4? Or what is the reason for this? I used the same script for CLEO3 and CLEO4.

Here is the test-code:

{$CLEO .cs}

03A4: name_thread "WEPINFO" 
0001: wait 2000 ms 
03F0: enable_text_draw 1 
048F: actor $PLAYER_ACTOR remove_weapons 
0001: wait 2000 ms 
0004: $CPED = 0xB6F5F0 
0A8D: $CPEDPOOL = read_memory $CPED size 8 virtual_protect 1 

:WEPINFO
0001: wait 0 ms 
0A8E: $CURRENTWEAPONSLOT = $CPEDPOOL + 0x718 // int 
0A8D: $CURRENTWEAPONSLOTPOOL = read_memory $CURRENTWEAPONSLOT size 1 virtual_protect 1 
0A90: $SLOTPOOLPOSITION = 28 * $CURRENTWEAPONSLOTPOOL // int 
0A8E: $AMMOINCLIP = $SLOTPOOLPOSITION + 8 // int 
0008: $AMMOINCLIP += 0x5A0 
0058: $AMMOINCLIP += $CPEDPOOL // (int) 
0A8D: $AMMOINCLIPPOOL = read_memory $AMMOINCLIP size 1 virtual_protect 1 
0A8E: $AMMOREMAINING = $SLOTPOOLPOSITION + 12 // int 
0008: $AMMOREMAINING += 0x5A0 
0058: $AMMOREMAINING += $CPEDPOOL // (int) 
0A8D: $AMMOREMAININGPOOL = read_memory $AMMOREMAINING size 1 virtual_protect 1 
0084: $TYPE = $SLOTPOOLPOSITION // (int) 
0008: $TYPE += 0x5A0 
0058: $TYPE += $CPEDPOOL // (int) 
0A8D: $TYPEPOOL = read_memory $TYPE size 2 virtual_protect 1 
045A: draw_text_1number 10.0 10.0 GXT 'NUMBER' number $CURRENTWEAPONSLOTPOOL  // ~1~
045A: draw_text_1number 10.0 20.0 GXT 'NUMBER' number $AMMOREMAININGPOOL  // ~1~
045A: draw_text_1number 10.0 30.0 GXT 'NUMBER' number $AMMOINCLIPPOOL  // ~1~
045A: draw_text_1number 10.0 40.0 GXT 'NUMBER' number $TYPEPOOL  // ~1~
0002: jump @WEPINFO

Last edited by ATP (22-08-2010 14:00)

Offline

#70 10-08-2010 17:37

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

Could you post the code?

Edit

I'm having problems with the scan opcodes:

0AC8: 1@ = allocate_memory_size 20
while 0AD7: read_string_from_file 0@ to 1@ size 20
    0AC8: 2@ = allocate_memory_size 20
    if
        0AD4: 3@ = scan_string 1@ format "%d,%s" 4@ 2@  // returns true
    then
        0AD0: show_formatted_text_lowpriority "%d - %s" time 1000 4@ 2@  // crashes game
        wait 1000
    end
    0AC9: free_allocated_memory 2@
end
0AC9: free_allocated_memory 1@

Here 0AD4 works fine, but when 0AD0 runs, the game crashes. Displaying the result of 0AD7 works fine, though. It also crashes if I use the non formatted version (display text using the pointer).

Also, if 0AD0 is removed the game crashes on the second run of the loop (0AD4 related, I think).

Here's a sample of the contents of the file I'm reading:

0,NULL
7,MALE01
9,BFORI
10,BFOST
11,VBFYCRP
12,BFYRI
13,BFYST

Originally I created this to scan the peds.ide file instead, but I figured there would be less of a chance of crashing if I read from a simplified version of the file. However it still crashes with the same exception (0xFA90 is the one with 0AD0, I believe).


Edit 2

Okay, so the scan opcodes don't support pointers? The possibly could in CLEO 5? blush

Last edited by Deji (11-08-2010 18:26)

Offline

#71 24-08-2010 21:46

patrickpf
Registered: 24-08-2010
Posts: 1

Re: CLEO 4. Questions and bug reports.

i installed cleo 4 and gta crashes, i have version 2 for sa but i used a downgrader patch

Offline

#72 25-10-2010 22:52

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

I realise CLEO 4 file handles are different from CLEO 3 ones, but I've also figured out this is the causes compatibility issues with some CLEO 3 scripts, since this eliminates the ability to call San Andreas functions passing the file handle.


Ryosukes Missile script can be fixed by following these simple steps:

Find

0A9A: 32@ = openfile "cleo\missile.dat" mode 0x6272  // IF and SET
for 33@ = 0 to 29
    0AA7: call_function 0x536F80 num_params 1 pop 1 32@ 11@
    0A8D: 12@ = read_memory 11@ size 1 virtual_protect 0
    if
    0039:   12@ == 0
    then
        break
    end 
    if
    0039:   12@ == 0x3B
    then
        000E: 33@ -= 1 
        continue
    end 
    0AA5: call 3@(3@,1i) num_params 3 pop 3 11@ 13@ 14@
    000A: 14@ += 0xA0
end
0A9B: closefile 32@

Replace With

0A9A: 32@ = openfile "cleo\missile.dat" mode "rt"  // IF and SET
for 33@ = 0 to 29
    //0AA7: call_function 0x536F80 num_params 1 pop 1 32@ 11@
    0AB1: call_scm_func @GetConfigLine 1 32@ 11@
    0A8D: 12@ = read_memory 11@ size 1 virtual_protect 0
    if
    0039:   12@ == 0
    then
        break
    end 
    if
    0039:   12@ == 0x3B
    then
        000E: 33@ -= 1 
        continue
    end 
    0AA5: call 3@(3@,1i) num_params 3 pop 3 11@ 13@ 14@
    000A: 14@ += 0xA0
end
0A9B: closefile 32@

Find

:SSCANF_FORMAT
hex
"%d" 20 "%d" 20 "%d" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%d" 20 "%f" 20 "%f" 20 "%f" 20 "%d" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%d" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%d" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%f" 20 "%d" 20 "%f" 20 "%d" 20 "%x" 00
end

Add Above

:GetConfigLine
0A8C: write_memory 0xB71848 size 0x200 value 0 virtual_protect 0
while 0AD7:   read_string_from_file 0@ to 0xB71848 size 0x200
    0A8D: 2@ = read_memory 0xB71848 size 1 virtual_protect 0
    if and
        8039:   not 2@ == 0xA
        8039:   not 2@ == 0xD
        8039:   not 2@ == 0x20
        8039:   not 2@ == 0x23
        8039:   not 2@ == 0x3B
    then
        0AA7: call_function 0x69DB50 num_params 1 pop 1 0xB71848 2@
        000A: 2@ += 1
        0A8E: 3@ = 0xB71848 + 2@
        0A8C: write_memory 3@ size 1 value 0 virtual_protect 0
    end
end
0AB2: ret 1 0xB71848

Hopefully it will help people having troubles with the script. I know a few people who want this mod to work on CLEO 4.


But perhaps in any future update, CLEO could be made to check whether the script is using something like "mode 0x6272" and return the file handle using the old CLEO 3 method? It would good to have file operations compatible with SA's functions.

Last edited by Deji (25-10-2010 23:03)

Offline

#73 27-10-2010 13:49

Alien
Registered: 12-10-2008
Posts: 564

Re: CLEO 4. Questions and bug reports.

Not tested, but i think, now everything should be OK.

Offline

#74 27-10-2010 13:59

Silent
Registered: 08-05-2010
Posts: 29

Re: CLEO 4. Questions and bug reports.

Ohwow, ASI now became huge. Any updates apart fron this?


And how about that sound bug (posted ages ago)? smile

Offline

#75 27-10-2010 15:17

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: CLEO 4. Questions and bug reports.

0A9A: 32@ = openfile "cleo\missile.dat" mode 0x6272  // IF and SET
for 33@ = 0 to 29
    0AA7: call_function 0x536F80 num_params 1 pop 1 32@ 11@
    0A8D: 12@ = read_memory 11@ size 1 virtual_protect 0
    if
    0039:   12@ == 0
    then
        break
    end 
    if
    0039:   12@ == 0x3B
    then
        000E: 33@ -= 1 
        continue
    end
    0AA5: call 3@(3@,1i) num_params 3 pop 3 11@ 13@ 14@
    000A: 14@ += 0xA0
    wait 5000  // for debugging.
end
0A9B: closefile 32@

In Ryosukes script first iteration works perfectly (returns to memory correctly) but crashes on 2nd iteration (cleo.asi+154C).

However, if there's a wait before the for loop (even with the wait 5000), it crashes on the first iteration (ntdll.dll+1B21A).

Missile Source

Offline

Board footer

Powered by FluxBB