You are not logged in.
Odd. I'll look into the code more. Maybe I forgot 0AE8.
Offline
Cleo 4 is not available below method : Variables expansion by Buffer Overrun
http://samc.blog123.fc2.com/blog-entry-485.html
there was a fault of R* (mismatching sizes of integers). it should work now.
Either this is a CLEO issue in general, or I'm doing something terribly wrong.
{$CLEO .cm} 0000: :Loop wait 0 gosub @Calculate gosub @Thread jump @Loop //[...] :Thread 20@ = 5 0AB1: call_scm_func @FloatToInt 1 20@ 21@ if 8039: not 21@ == 10 then 0ACE: show_formatted_text_box "Value of 21@ == %d" 21@ wait 1000 else 0ACA: show_text_box "YAY" wait 1000 end return :FloatToInt 0@ *= 2 0AB2: ret 1 0@ //[...] :Calculate 0@ = 20 returnOn running a script like the one above, I find that :FloatToInt uses variables outside of the scm function. This is not what a scm function is supposed to do, yet it seems to happen to me every time I attempt to use one.
However, I am using a CLEO Mission, not a CLEO Script. Maybe that is a reason for this bug? The same thing happens in CLEO 3 and CLEO 4. I've never been able to get returns to work properly with SCM Functions, which annoys me.
EDIT
It seems that this code displays the value "40".
This is 20 * 2... Which means that this:
0AB1: call_scm_func @FloatToInt 1 20@ 21@Isn't correctly passing the value to :FloatToInt - Which should make 0@ the same as 20@.
Instead, the scm_function is acting exactly like a gosub command... Except whatever value it returns is written to 21@, which is good. But the values aren't being passed like they should.
not tested, but i think, i should be OK now. But scm_func in mission threads still have only 32 local variables (it's just wasting memory - to make new array of 1024 variables for each function).
Offline
Yeah, I did it for ease. Send the variables to be operated on in one single thread. That way I don't have to type the long code over and over again (it's a float to integers thing). Also to save from wasting currently used variables.
The script in question no longer uses a mission, since I started using thread memory to store the data.
I think the 0AE7 error was due to my outdated CLEO4 version... But upon installing the newest one, very weird bugs occured.
I have loads of .asi files in the GTASA root that were renamed (stuff like cleo.asi.disabled and cleo.3asi). So I can enable/disable them quickly.
I believe these files may be being loaded. Once I started SA, it gave me the regular error message that occurs before using Ryosukes fast loader (even though the asi is renamed to "fastloader.asid").
With that error, I can just click continue. But it appears that now, in the main menu, the renamed CLEO 3 asi has been loaded. Because the CLEO 4 and CLEO 3 texts appear in the menu.
Edit
Odd, the newest CLEO 4 seems to have loads of bugs. I fixed the .asi thing by moving all the files, but it seems to crash every few times that I start a new game. Last time you said to give you the .log file:
26/04/2010 01:34:31.281 SPRINTF: MPACK//MPACK21//MPACK.DAT 26/04/2010 01:34:31.281 SPRINTF: MPACK//MPACK22//MPACK.DAT 26/04/2010 01:34:31.281 SPRINTF: MPACK//MPACK23//MPACK.DAT 26/04/2010 01:34:31.281 SPRINTF: MPACK//MPACK24//MPACK.DAT 26/04/2010 01:34:32.671 SPRINTF: 08:42 26/04/2010 01:34:32.671 SPRINTF: $00000000 26/04/2010 01:34:32.671 SPRINTF: 1 26/04/2010 01:34:32.718 pools have been cleared 26/04/2010 01:34:32.750 SPRINTF: radar00 26/04/2010 01:34:32.750 SPRINTF: radar01 26/04/2010 01:34:32.750 SPRINTF: radar02 26/04/2010 01:34:32.750 SPRINTF: radar03 26/04/2010 01:34:32.750 SPRINTF: radar04 26/04/2010 01:34:32.750 SPRINTF: radar05 26/04/2010 01:34:32.750 SPRINTF: radar06 26/04/2010 01:34:32.750 SPRINTF: radar07 26/04/2010 01:34:32.750 SPRINTF: radar08 26/04/2010 01:34:32.750 SPRINTF: radar09 26/04/2010 01:34:32.750 SPRINTF: radar10 26/04/2010 01:34:32.750 SPRINTF: radar11 26/04/2010 01:34:32.750 SPRINTF: radar12 26/04/2010 01:34:32.750 SPRINTF: radar13 26/04/2010 01:34:32.750 SPRINTF: radar14 26/04/2010 01:34:32.750 SPRINTF: radar15 26/04/2010 01:34:32.750 SPRINTF: radar16 26/04/2010 01:34:32.750 SPRINTF: radar17 26/04/2010 01:34:32.750 SPRINTF: radar18 26/04/2010 01:34:32.750 SPRINTF: radar19 26/04/2010 01:34:32.750 SPRINTF: radar20 26/04/2010 01:34:32.750 SPRINTF: radar21 26/04/2010 01:34:32.750 SPRINTF: radar22 26/04/2010 01:34:32.750 SPRINTF: radar23 26/04/2010 01:34:32.750 SPRINTF: radar24 26/04/2010 01:34:32.750 SPRINTF: radar25 26/04/2010 01:34:32.750 SPRINTF: radar26 26/04/2010 01:34:32.750 SPRINTF: radar27 26/04/2010 01:34:32.750 SPRINTF: radar28 26/04/2010 01:34:32.750 SPRINTF: radar29 26/04/2010 01:34:32.750 SPRINTF: radar30 26/04/2010 01:34:32.750 SPRINTF: radar31 26/04/2010 01:34:32.750 SPRINTF: radar32 26/04/2010 01:34:32.750 SPRINTF: radar33 26/04/2010 01:34:32.750 SPRINTF: radar34 26/04/2010 01:34:32.750 SPRINTF: radar35 26/04/2010 01:34:32.750 SPRINTF: radar36 26/04/2010 01:34:32.750 SPRINTF: radar37 26/04/2010 01:34:32.750 SPRINTF: radar38 26/04/2010 01:34:32.750 SPRINTF: radar39 26/04/2010 01:34:32.750 SPRINTF: radar40 26/04/2010 01:34:32.750 SPRINTF: radar41 26/04/2010 01:34:32.750 SPRINTF: radar42 26/04/2010 01:34:32.750 SPRINTF: radar43 26/04/2010 01:34:32.750 SPRINTF: radar44 26/04/2010 01:34:32.750 SPRINTF: radar45 26/04/2010 01:34:32.750 SPRINTF: radar46 26/04/2010 01:34:32.750 SPRINTF: radar47 26/04/2010 01:34:32.750 SPRINTF: radar48 26/04/2010 01:34:32.750 SPRINTF: radar49 26/04/2010 01:34:32.750 SPRINTF: radar50 26/04/2010 01:34:32.750 SPRINTF: radar51 26/04/2010 01:34:32.750 SPRINTF: radar52 26/04/2010 01:34:32.750 SPRINTF: radar53 26/04/2010 01:34:32.750 SPRINTF: radar54 26/04/2010 01:34:32.750 SPRINTF: radar55 26/04/2010 01:34:32.750 SPRINTF: radar56 26/04/2010 01:34:32.750 SPRINTF: radar57 26/04/2010 01:34:32.750 SPRINTF: radar58 26/04/2010 01:34:32.750 SPRINTF: radar59 26/04/2010 01:34:32.750 SPRINTF: radar60 26/04/2010 01:34:32.750 SPRINTF: radar61 26/04/2010 01:34:32.750 SPRINTF: radar62 26/04/2010 01:34:32.750 SPRINTF: radar63 26/04/2010 01:34:32.750 SPRINTF: radar64 26/04/2010 01:34:32.750 SPRINTF: radar65 26/04/2010 01:34:32.750 SPRINTF: radar66 26/04/2010 01:34:32.750 SPRINTF: radar67 26/04/2010 01:34:32.750 SPRINTF: radar68 26/04/2010 01:34:32.750 SPRINTF: radar69 26/04/2010 01:34:32.750 SPRINTF: radar70 26/04/2010 01:34:32.750 SPRINTF: radar71 26/04/2010 01:34:32.750 SPRINTF: radar72 26/04/2010 01:34:32.750 SPRINTF: radar73 26/04/2010 01:34:32.750 SPRINTF: radar74 26/04/2010 01:34:32.750 SPRINTF: radar75 26/04/2010 01:34:32.750 SPRINTF: radar76 26/04/2010 01:34:32.750 SPRINTF: radar77 26/04/2010 01:34:32.750 SPRINTF:
But I'm figuring that makes no sense... Windows throws the same function address at me each time, which is part of the cleo.asi.
Anyway, mods seem to crash more often now, too. I also noticed that the new CLEO 4 .asi file takes up a lot less space, so I'm curious to know why
Last edited by Deji (26-04-2010 03:32)
Offline
I have loads of .asi files in the GTASA root that were renamed (stuff like cleo.asi.disabled and cleo.3asi). So I can enable/disable them quickly.
I believe these files may be being loaded. Once I started SA, it gave me the regular error message that occurs before using Ryosukes fast loader (even though the asi is renamed to "fastloader.asid").
With that error, I can just click continue. But it appears that now, in the main menu, the renamed CLEO 3 asi has been loaded. Because the CLEO 4 and CLEO 3 texts appear in the menu.
I think this is an issue of my new asi loader. Now I corrected it.
Anyway, mods seem to crash more often now, too. I also noticed that the new CLEO 4 .asi file takes up a lot less space, so I'm curious to know why
In the previous version was found a critical error. Perhaps all the trouble in it. Regarding size - now I use linking with the msvcrt.dll to get c++ library's functions, from the abundance of which the size of executable files are growing by leaps and bounds.
Offline
Great to hear. Less load on the game means more room to stuff CLEO's
I was wondering what the .cleo files that also give new opcodes were for, exactly. I would've assumed they'd have been built into CLEO 4... They appear to install with CLEO, but I'm wondering what the plans are for these files and their opcodes.
I think they'd be very useful, but I'm not sure if they are staying as their current form or being changed at all.
Would you consider them as part of CLEO 4 or an additional thing? It's also helpful to know for the opcode database so I can decide if they belong in the CLEO 4 category... You also state there are 100 opcodes for CLEO 4, which wouldn't account for those .cleo files. Sorry to be such a bother
Offline
These plug-ins are a demonstration of possibilities of adding custom opcodes via CLEO 4. One man has already tried to write opcodes using this interface. His plug-in, though till not gained as much popularity, adds quite useful opcodes for trigonometric operations (See this post).
Since these plug-ins installed with CLEO 4, their functionality can be also used as the basic functionality of CLEO 4. I think, it is legitimate to add their opcodes in section of CLEO 4 opcodes.
Offline
I'm still experiencing crashes after a few New Games. I'm compiling/testing my script so I'm starting a new game a lot.
I downloaded the latest version 4.1.1.8 (the version in the screenshot was 4.1.1.7) and it has the same problem... Different memory function address, of course.
Happens every 2 or so New Games and it simply crashes when I click New Game.
Offline
file offset 0x29F6 corresponds to opcode 0A8C (write_memory) in cleo.asi 4.1.1.8 (in 4.1.1.7 may be too). Therefore with high probability the error may be caused by one of script. You can use ScmLog to check on which thread game crashes.
Offline
Hey in new 4.1.1.7 and 4.1.1.8 version don't work "CLEO_TEXT" .fxt files on my friends PC its working on my PC but not work on his PC with fresh install. why?
Offline
I was supposed to post this yesterday but no internets...
After spending ages editing multiple mods, it turns out this line causes the problem:
0ADF: add_dynamic_GXT_entry '_BMDTN_' text '~1~'
When run enough times, it crashes the game. Restarting the game over and over runs the opcode over and over.
I don't know why I ever uninstalled SCMLog... I think my game had problems with it or something.
Last edited by Deji (06-05-2010 16:06)
Offline
Hey, looks like opcode 0AE2 isn't working right. I wrote a test script:
{$CLEO .cs} 0000: NOP :NONAME_2 wait 10 Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@) if 0AE2: 3@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 10.0 find_next 0 pass_wrecked 1 //IF and SET jf @NONAME_2 4@ = Marker.CreateAboveCar(3@) :NONAME_58 wait 10 Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@) if 0AE2: 3@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 10.0 find_next 1 pass_wrecked 1 //IF and SET jf @NONAME_58 4@ = Marker.CreateAboveCar(3@) jump @NONAME_58
And it marks only first car, detected by condition with find_next flag set to 0. No more cars is marked.
Plus, 0AD3 crashes my game in that type of code:
[...] 0AE6: 0@ = find_first_file "AUDIO\*.MP3" get_filename_to 1@v //IF and SET 0AD3: string 5@v "audio\%s.MP3" 1@v 0ACA: show_text_box 5@v [...]
Also, whole audio seems to be a bit buggy. If I'm facing north-east direction, I'm hearing everything only in my left headphone, and if I'm facing south-west, only right headphone is playing. That's weird.
Last edited by SilentPL (08-05-2010 20:43)
Offline
I have a answer,
what for this opcode needs?
It such like just disable radio. About that must be a memory address...
ATP wrote:I have a question,
would it be possible to create an OpCode like that?XXXX: make_radio_stations_scrollable 0
This can easily be done by using the function instead. Furthermore, it can even be done by using other opcodes.
Yes, I found another way to do it. If somebody is intressted, check my 3rd post in this thread: http://www.gtaforums.com/index.php?act=ST&f=49&t=445929
@Alien,
would it be possilbe to create an OpCode like this?
XXXX: make_3d_coordinate $X $Y $Z to_2d_screen_coordinate 0@ 1@
Last edited by ATP (08-05-2010 20:55)
Offline
Hey in new 4.1.1.7 and 4.1.1.8 version don't work "CLEO_TEXT" .fxt files on my friends PC its working on my PC but not work on his PC with fresh install. why?
it looks like general problem in windows xp. Not sure, but may be this problem fixed in 4.1.1.9.
Hey, looks like opcode 0AE2 isn't working right. I wrote a test script:
You have a wrong logic struct. It must be used in such a way:
{$CLEO} 0000: while true wait 0 if 0AE2: 0@ = random_vehicle_near_point 0.0 0.0 0.0 in_radius 100000.0 find_next 0 pass_wrecked 1 //IF and SET then repeat 020B: explode_car 0@ until 8AE2: not 0@ = random_vehicle_near_point 0.0 0.0 0.0 in_radius 100000.0 find_next 1 pass_wrecked 1 //IF and SET end end
And also there is too many cars and too little markers in game. You can't add marker to each car.
Plus, 0AD3 crashes my game in that type of code:
[...] 0AE6: 0@ = find_first_file "AUDIO\*.MP3" get_filename_to 1@v //IF and SET 0AD3: string 5@v "audio\%s.MP3" 1@v 0ACA: show_text_box 5@v [...]
try this:
{$CLEO} 0AC8: 1@ = allocate_memory_size 260 0AC8: 2@ = allocate_memory_size 260 if 0AE6: 0@ = find_first_file "AUDIO\*.MP3" get_filename_to 1@ //IF and SET then repeat 0AD3: sprintf 2@ "audio\%s" params 1@ 0ACA: show_text_box 2@ wait 4000 until 8AE7: not 1@ = find_next_file 0@ //IF and SET 0AE8: find_close 0@ end 0AC9: free_allocated_memory 1@ 0AC9: free_allocated_memory 2@ 0a93:
Last edited by Alien (09-05-2010 10:08)
Offline
Jur1z wrote:Hey in new 4.1.1.7 and 4.1.1.8 version don't work "CLEO_TEXT" .fxt files on my friends PC its working on my PC but not work on his PC with fresh install. why?
it looks like general problem in windows xp. Not sure, but may be this problem fixed in 4.1.1.9.
Nop friend says text still don't shows
Offline
Jur1z wrote:Hey in new 4.1.1.7 and 4.1.1.8 version don't work "CLEO_TEXT" .fxt files on my friends PC its working on my PC but not work on his PC with fresh install. why?
it looks like general problem in windows xp. Not sure, but may be this problem fixed in 4.1.1.9.
Hey, looks like opcode 0AE2 isn't working right. I wrote a test script:
You have a wrong logic struct. It must be used in such a way:
{$CLEO} 0000: while true wait 0 if 0AE2: 0@ = random_vehicle_near_point 0.0 0.0 0.0 in_radius 100000.0 find_next 0 pass_wrecked 1 //IF and SET then repeat 020B: explode_car 0@ until 8AE2: not 0@ = random_vehicle_near_point 0.0 0.0 0.0 in_radius 100000.0 find_next 1 pass_wrecked 1 //IF and SET end endAnd also there is too many cars and too little markers in game. You can't add marker to each car.
SilentPL wrote:Plus, 0AD3 crashes my game in that type of code:
[...] 0AE6: 0@ = find_first_file "AUDIO\*.MP3" get_filename_to 1@v //IF and SET 0AD3: string 5@v "audio\%s.MP3" 1@v 0ACA: show_text_box 5@v [...]try this:
{$CLEO} 0AC8: 1@ = allocate_memory_size 260 0AC8: 2@ = allocate_memory_size 260 if 0AE6: 0@ = find_first_file "AUDIO\*.MP3" get_filename_to 1@ //IF and SET then repeat 0AD3: sprintf 2@ "audio\%s" params 1@ 0ACA: show_text_box 2@ wait 4000 until 8AE7: not 1@ = find_next_file 0@ //IF and SET 0AE8: find_close 0@ end 0AC9: free_allocated_memory 1@ 0AC9: free_allocated_memory 2@ 0a93:
First code works OK, thanks.
But second code isn't working correct. Game shows text box with '"audio\" text, without MP3 name.
Everything is correct, I was compiling in uppercase, and %s changed to %S. Is this possible to make %s in uppercase readable by game?
And what about that sound bug?
Edit:
0AA1 is bugged. With if and and 0AA1:
if and 0AB0: 17 0AB0: 18 0AB0: 82 0AA1: return_if_false [do something] return
..game acts like on if or condition. I have to replace 0AA1 with jf:
if and 0AB0: 17 0AB0: 18 0AB0: 82 jf @Return [do something] :Return return
Last edited by SilentPL (10-05-2010 16:24)
Offline
Is this possible to make %s in uppercase readable by game?
%S specifies the string in Unicode character set.
And what about that sound bug?
Ugh... One man already told me, that 3d-sounds incorrectly positioned. I'm reading this topic. If expicit setting of flag BASS_3DMODE_NORMAL wont have effect, i'll think about changing sound system...
0AA1 is bugged. With if and and 0AA1:
if and 0AB0: 17 0AB0: 18 0AB0: 82 0AA1: return_if_false [do something] return..game acts like on if or condition. I have to replace 0AA1 with jf:
if and 0AB0: 17 0AB0: 18 0AB0: 82 jf @Return [do something] :Return return
It's Sanny Builder's bug. In 00D6 should be real opcode parameter:
{$CLEO} if 2 0AB0: 17 0AB0: 18 0AB0: 82 0AA1: return_if_false
Offline
I'm still unable to get scmlog to work. It simply doesn't produce a scmlog.log file most of the time.
After a few crashes, it finally gives one, but I'm not sure how it works. Is the opcode at the bottom the last opcode run or does it do it on a per-thread basis. It seems to me that each thread has a number of sections in the log file and it's just too big to go routing through it for the answer.
Offline
You can try this version: http://sannybuilder.com/forums/viewtopi … 389#p10389
Scmlog.txt must be created after first exit game. Is file defined, it will be changed.
If game was crashed, you can know name of thread (it's last thread's name in the end of file) and name of opcode, which was done last before game crashing (it's last opcode's number in the end of file)
Last edited by Den_spb (11-05-2010 19:04)
Offline
log actually written not always, for example, if the program has fallen by handling an exception. This is due to the fact that scmLog uses buffered stream for output.
Offline
In my experience, the problem opcode is never at the bottom... It reports a thread that has nothing to do with the crash.
For example, I know this is the cause of my latest crash:
0AA7: call_function 0x50C8B0 num_params 3 pop 3 VAR1 VAR2 VAR3 // btw, does anyone know the camera movement function?
However 0AA7 isn't even logged. All threads have 0001 as their last opcode.
Offline
It reports a thread that has nothing to do with the crash.
It means that thread consists inderect reason of crash. Not always incorrect action causes momentary crash of game. Searching of mistakes at such cases is more difficult.
Offline
Yeah that's what I thought.. Which is why I didn't bother using it. I found that I've never had problems caused by my bad use of the opcode. It's just how the game handles whatever I've sent that is always the problem.
EDIT
It seems scripts started with 0A92 stay active after a New Game. Not sure if it's supposed to be like that but I'd like CLEO to hesoyam every time a New Game is started to keep consistancy.
Last edited by Deji (13-05-2010 04:16)
Offline
Still problems with 0AE7, don't know why. It seems to come down to variable usage.
{$CLEO} wait 0 0AC8: 2@ = allocate_memory_size 128 08D4: 1@ = create_panel_with_title 'DUMMY' position 29.0 170.0 width 180.0 columns 1 interactive 1 background 1 alignment 0 if 0AE6: 30@ = find_first_file "cleo\files\*.cs" get_filename_to 2@v then repeat wait 0 0AD3: 10@v = format "FAYLF%d" 3@ 0ADF: add_dynamic_GXT_entry 10@v text 2@v 08EE: set_panel 1@ column 0 row 3@ text_1number GXT 10@v number -1 3@ += 1 until 8AE7: not 2@v = find_next_file 30@ //IF and SET end 0ACE: show_formatted_text_box "search finished, %d CLEO scripts found" 3@ 0AE8: find_close 30@ 0AC9: free_allocated_memory 2@ 0A93: end_custom_thread
Here all code work fine except for an 0AC8 issue. The string is overlapping in 2@v and spoiling 3@. I assume I'm actually using 0AC8 correctly? Allocate enough bytes to store a string..
Last edited by Deji (08-08-2010 18:38)
Offline
First, the maximum number of rows in the panels - 12.
Secondly, if you use dynamic memory allocation, then work with it as with a pointer, not the SCM-line.
{$CLEO} wait 0 0AC8: 2@ = allocate_memory_size 260 08D4: 1@ = create_panel_with_title 'DUMMY' position 29.0 170.0 width 180.0 columns 1 interactive 1 background 1 alignment 0 if 0AE6: 30@ = find_first_file "cleo\Director\Scenes\*.cds" get_filename_to 2@ then repeat if 3@ >= 12 then break end 0AD3: 10@v = format "FAYLF%d" 3@ 0ADF: add_dynamic_GXT_entry 10@v text 2@ 08EE: set_panel 1@ column 0 row 3@ text_1number GXT 10@v number -1 3@ += 1 until 8AE7: not 2@ = find_next_file 30@ //IF and SET end 0AE8: find_close 30@ 0AC9: free_allocated_memory 2@ 0A93: end_custom_thread
Allocate enough bytes to store a string..
It is better to allocate 260 bytes to store a path in ANSI charset. It is Windows limitation (MAX_PATH constant).
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\<some 256-character path string><NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
Offline
Yeah, I was baring the max panel rows in mind for later. In the end I decided to use text draw instead since it can produce a nicer effect, although I'm having some odd problems with that (missing entries that appear with certain (but non-specific) filenames) are pretty rare and can be overlooked. Managed to hide file extensions and do such other tricks.
Thanks for all the help, CLEO 4 is a lot of fun.
Lol. Sorry for being annoying again, but could this be the weirdest bug ever?
{$CLEO} 0000: 0A99: chdir "CLEO" // or 0A99: chdir 1 070D: rebuild_player $PLAYER_CHAR 0A93: end_custom_thread
Crashes. I noticed it from using 0A99 in one script and 070D in another, so they have the same effect no matter where the lines are.
070D is somehow affected? It doesn't seem to crash when you use 0A99: chdir 0 on it's own.
Also, could audiostreams work on shortcuts? If not, I'm sure the shortcut path could just be read anyway.
Last edited by Deji (06-06-2010 20:38)
Offline