Giter Club home page Giter Club logo

cleoplus's Introduction

CLEO+

Full download with better information for end-users and change log:
https://www.mixmods.com.br/2022/02/cleoplus/

.cleo plugin for CLEO Library https://github.com/cleolibrary/CLEO4

plugin-sdk and CLEO SDK are required
https://github.com/DK22Pac/plugin-sdk

Tutorial/documentation (with long explanations, simple language, use cases etc):
https://forum.mixmods.com.br/f141-gta3script-cleo/t5206-como-criar-scripts-com-cleoplus

Documentation (proper docs for coding):
https://library.sannybuilder.com/#/sa/CLEO%2B

Suggestions:
https://forum.mixmods.com.br/f16-utilidades/t2878-sugestoes-cleo-moonloader

cleoplus's People

Contributors

juniordjjr avatar x87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cleoplus's Issues

Cleo+ affects the game

Bullet View mod that requieres Cleo+ has a strange glitch, just as reported at mixmods, triggering slow cam causes the game to become ultra bright and then it glitches, forcing you to close the game. It has been previously reported,

it's a great mod hope you can fix it.

It doesn't happen when you are in a savegame that hasn't unlocked any of the additional islands, I mean that such glitch happens only after completing the mission: the green sabre

Captura

Memory leak with DRAW_STRING

Looks like DRAW_STRING has a memory leak.
image

With "DRAW_STRING"
image

Without "DRAW_STRING"
image

I Understand, that such crazy numbers are not for practical use, but if your session is ~8-9 hours, you're in trouble.
Is this fixable? Is it CLEO+ related thing or GTASA related?
Looking for a fix, because I'd like to use DRAW_STRING a lot

UPD:
This works fine.
image
Results:
image

UPD2:
this struct:
tFontPrint* fontPrint = new tFontPrint();
Is not freeing it's memory on deletion in TextDrawer::ClearAll() for some reason. I'll continue my research...

0E84: Get_Weaponinfo Never Fails to Find a Pointer

In an effort to understand and document the use of CLEO+ opcodes for the Sanny Builder Library, I tried and failed to make the get_weaponinfo conditional command return False. It always returns a pointer, even if it points to bogus data.

In particular, weapon skills other than 1 point to the wrong data if the weapon ID is not within the range of skilled weapons - pistol (22) thru tec9 (32).

Similarly, out of range weapon IDs will return invalid pointers as True.

Seemann offered this script at a template for managing get_weaponinfo as a conditional command with standard limits. I'm not sure how modified weapon.dat files or limit adjusters might change these limits.

{$CLEO .cs}
{$USE CLEO+}
0000:
const WEAPON_ID     = 22  //(PISTOL)
const SKILL_LEVEL   = 2 //(PRO)
int weap_info

if
    cleo_call @getweapinfo 2 WEAPON_ID SKILL_LEVEL weap_info
then
    weap_info+=0x20
    int ammo
    read_memory ammo = weap_info 2 false
     
    print_formatted_now "Weapon: %d~n~Skill: %d~n~Ammo: %d" time 3000 WEAPON_ID SKILL_LEVEL ammo
else
    print_formatted_now "Can't get weapon_info for Weapon: %d~n~Skill: %d"  time 3000 WEAPON_ID SKILL_LEVEL
end
terminate_this_custom_script

:getweapinfo
const weaponId = 0@
const skill = 1@
const ptr = 2@

if and
    weaponId >= 0 
    weaponId <= 46
    skill >= 0
    skill <= 3
then
    if skill == 1
    then
        get_weaponinfo weaponId 1 ptr
        cleo_return 1 ptr
    end
    
    if and
        weaponId >= 22 
        weaponId <= 32
    then
        
        if skill == 0
        then weaponId += 25
        end
        
        if skill == 2
        then weaponId += 36
        end
        
        if skill == 3
        then weaponId += 47
        end
        
        get_weaponinfo weaponId 1 ptr
        cleo_return 1 ptr
    end
end
cleo_return 0

GTA SA Game crashes Unhandled Exception

Hello again my friend! and sorry for the late answer, it took me a lot of time to discover this.

https://www.youtube.com/watch?v=kfdSM6fRujk

The first person mod (just used 3.0 version with BoPoH's logo so you can see that's the mod) crashes with the log 0x006D1080

According to crashlist it's related to a Failure to handle a vehicle. Please I beg you to fix it if possible

I strongly believe this mod is also causing the ultra random ntdll.dll crash. But I still don't have enought evidence.

Game version: GTA SA 1.0 US
Unhandled exception at 0x006D1080 in gta_sa.exe (+0x2d1080): 0xC0000005: Access violation reading location 0x00000384.

Backtrace (may be wrong):
    =>0x006D1080 in gta_sa.exe (+0x2d1080) (0x0028F5F0) 
      0x74CA19FE in FirstPerson.sp (+0x19fe) (0x0028F600) 
      0x74E2113E in Hooks.asi (+0x113e) 

And here is the log for the ntdll.dll crash

Game version: GTA SA 1.0 US
Unhandled exception at 0x77DFF017 in ntdll.dll (+0x3f017): 0xC0000005: Access violation writing location 0x00000014.

Backtrace (may be wrong):
    =>0x77DFF017 LdrFindResource_U+0x184 in ntdll.dll (+0x3f017) (0x0727FF28) 
      0x77DFEF26 LdrFindResource_U+0x93 in ntdll.dll (+0x3ef26) (0x0727FF50) 
      0x1100A3AC in BASS.dll (+0xa3ac) (0x0727FF58) 
      0x1100E065 BASS_Update+0xe7 in BASS.dll (+0xe065) (0x0727FF6C) 
      0x1102106E BASS_Init+0xa41 in BASS.dll (+0x2106e) 

0E33: GET_PICKUP_THIS_COORD can break 0214: HAS_PICKUP_BEEN_COLLECTED

There are two issues related to 0E33: get_pickup_this_coord

  • If the Only_Available param is True, then the if (!onlyAvailable || !CPickups::IsPickUpPickedUp(pickupRef)) check can prevent a collected pickup from being detected as picked up again by the script that "owns" the pickup. When a pickup is detected as collected by opcode 0214, it's handle is cleared from the CollectedPickups array so it won't be detected as collected again - unless it respawns and is collected again. Save disks can be picked up but won't show the save screen. Property is payed for but the mini-mission won't unlock the property.
  • I suspect that the purpose of the Only_Available param is to filter out pickups that have been permanently collected, deleted, or never used so that only valid pickup handles are returned. Checking the type of the pickup might provide a better test as any pickup that is not type 0 is a valid pickup.

More information and a cleo repro script can be provided if needed. I suspect that you'll figure it out quickly enough. Seemann and I argued out the logic of the issue in the Sanny Discord server's #sdk-and-plugins channel. This discussion may provide additional details and context.
https://discordapp.com/channels/911487285990674473/938823120242999326/1106000841841848392

A minor compatibility issue

Your CLEO+ contains some opcodes for the newopcodes plugin. But there seems to be two OP ID registration errors, which makes it incompatible with CLEO using newopcodes.

Newopcodes:

0D3C=2,get_colpoint_data %1d% surface_to %2d%
0D3D=2,get_colpoint_data %1d% lighting_to %2d%
0D3E=2,get_colpoint_data %1d% depth_to %2d%

CLEO+:

0D3C=2,get_colpoint_depth %1d% store_to %2d%
0D3D=2,get_colpoint_surface %1d% store_to %2d%

They are not the same. You should modify to 0D3C and 0D3E

Memory Error 0x7364de70 pops up after installing cleo+

First of all I just want to thank you for helping so much the GTA SA community :)

I get this error everytime I install cleo+ on my game

I have: No modded GTA SA V1.0 USA running on windows 7
latest cleo version installed
latest modloader version installed
exdisp.asi to extend display

When I start the game with the CLEO+ script it goes smoth and fine, but after adding any additional cleo script the game shows this error after exiting the game, sometimes it freezes my desk and have to force detention

the instruction at 0x7364de70 referenced memory at 0x7364de70 the memory could not be read

This does not happen if I remove the CLEO+ script from the folder.

0E4D: Random_Percent Favors True

I was researching Random_Percent for the Sanny Builder Library documentation and noticed that it slightly favored True.
Another test returned True approximately 1% of the time with a percentage of 0.

Changing the random number generation min and max values to 1 and 101 should provide more accurate results.

Game crashes when loading a savegame

Hello again my friend! I finally identified the issue I couldn't show you the last time,

Sometimes when using a cleo+ script like vehicle attach, and after playing a savegame and load another one the game crashes.

Here is my log...

Game version: GTA SA 1.0 US
Unhandled exception at 0x76FC138C in ntdll.dll (+0x4138c): 0xC0000005: Access violation writing location 0x112DBE20.
Register dump:
EAX: 0x36FF86F9 EBX: 0x112DBE28 ECX: 0x00D60000 EDX: 0x00000003
EDI: 0x00D60000 ESI: 0x112DBE20 EBP: 0x0028DC5C EIP: 0x76FC138C
ESP: 0x0028DC20 EFL: 0x00010206 CS: 0x00000023 SS: 0x0000002B
GS: 0x0000002B FS: 0x00000053 ES: 0x0000002B DS: 0x0000002B

Stack dump:
    0x0028DC20:  00D60000 00CB3C98 00D6012C 76FBF3B0 00D60000 00000000
    0x0028DC38:  04010888 00000000 0D090400 00EBB880 70909680 5148423B
    0x0028DC50:  02A80011 00000000 7091234D 0028DD54 76FA4D1F 04010888
    0x0028DC68:  04010888 00000800 00000000 77BFD0D7 00000000 00D60000
    0x0028DC80:  04010890 00EDEE40 00D61340 1AFD6E00 00000148 00D60000
    0x0028DC98:  00800000 00EDE3C8 0028DD90 76FA3941 00D60000 00D63C30
    0x0028DCB0:  77BFD013 00000000 00D60000 00EDED70 0028DCE0 76FC9AF1
    0x0028DCC8:  00EBB880 00000000 00000010 00000003 00EFBB48 00000000
    0x0028DCE0:  00D60000 040A3C20 00D60150 0000000E 002F0048 00000000
    0x0028DCF8:  00D60000 04028868 80000181 040A3258 00000000 00000000
    base: 0x00090000   top: 0x0028DC20   bottom: 0x00290000
    
Backtrace (may be wrong):
    =>0x76FC138C RtlDosPathNameToNtPathName_U_WithStatus+0x6e0 in ntdll.dll (+0x4138c) (0x0028DC5C) 
      0x76FA4D1F RtlInitializeCriticalSection+0x11f in ntdll.dll (+0x24d1f) (0x0028DD54) 
      0x76FA3515 RtlQueryPerformanceCounter+0x281 in ntdll.dll (+0x23515) (0x0028DD74) 
      0x76FBFB0B _allmul+0x48b in ntdll.dll (+0x3fb0b) (0x0028DDC4) 
      0x76FA8083 LdrUnlockLoaderLock+0x7b1 in ntdll.dll (+0x28083) (0x0028DE00) 
      0x76F9E9E3 RtlFreeHeap+0x7e in ntdll.dll (+0x1e9e3) (0x0028DE18) 
      0x757914BD HeapFree+0x14 in kernel32.dll (+0x114bd) (0x0028DE2C) 
      0x717213C7 GetPluginData+0x3f187 in modloader.asi (+0x613c7) (0x0028DE40) 
      0x7170CCB5 GetPluginData+0x2aa75 in modloader.asi (+0x4ccb5) (0x0028DE58) 
      0x716E0A2A in modloader.asi (+0x20a2a) (0x0028DE7C) 
      0x716E10DD in modloader.asi (+0x210dd) (0x0028DE90) 
      0x716E5EE0 GetPluginData+0x3ca0 in modloader.asi (+0x25ee0) (0x0028DEB0) 
      0x716E5BA5 GetPluginData+0x3965 in modloader.asi (+0x25ba5) (0x0028DFF0) 
      0x716DEE28 in modloader.asi (+0x1ee28) (0x0028E00C) 
      0x716DE1AC in modloader.asi (+0x1e1ac) (0x0028E094) 
      0x716DB3CD in modloader.asi (+0x1b3cd) (0x0028E0A0) 
      0x716C949B in modloader.asi (+0x949b) (0x0028E0B4) 
      0x757D03CB GetProfileStringW+0x12def in kernel32.dll (+0x503cb) (0x0028E13C) 
      0x0082D885 in gta_sa.exe (+0x42d885) (0x0028E158) 

Not Issue at all, Just want to thank you!

**First of all I'm feeling very happy with latest cleo 4.4.3 release which fixes incompatibility issues I had with ugly cleo 4.4/.1

Now I can finally have new and old mods in the same game :,)

Thanks for all the love dedicated to the SA**

Just if possible for you to help me out:

I did a lot of research about the ntdll.dll crash but I get it randomly when doing ambulance mission. The log also blames bass.dll but such library is updated:

Removing imported model file at index 387
Removing imported model file at index 387
Removing imported model file at index 388
Removing imported model file at index 388
Removing imported model file at index 300
Removing imported model file at index 301
Removing imported model file at index 290
Loading default decision maker "m_empty.ped"
Loading default decision maker "m_empty.ped"

Game version: GTA SA 1.0 US
Unhandled exception at 0x773DF017 in ntdll.dll (+0x3f017): 0xC0000005: Access violation writing location 0x00000014.
Register dump:
EAX: 0x00000000 EBX: 0xFFFFFFFE ECX: 0x00000000 EDX: 0x00000002
EDI: 0x033D6CC0 ESI: 0x033D6CBC EBP: 0x072FFEEC EIP: 0x773DF017
ESP: 0x072FFE9C EFL: 0x00010213 CS: 0x00000023 SS: 0x0000002B
GS: 0x0000002B FS: 0x00000053 ES: 0x0000002B DS: 0x0000002B

Stack dump:
    0x072FFE9C:  033D6CBC 033D6CC0 000000C8 773B04F9 75A910D3 00000204
    0x072FFEB4:  00000000 072FFED0 702828CD 00000204 70283807 072FFF00
    0x072FFECC:  0BD6AD88 072FFF20 11001363 00000000 00000000 00000000
    0x072FFEE4:  FFF9A000 00000530 072FFF14 773DEF26 00000000 00000000
    0x072FFEFC:  000000C8 0332EFD0 033D5C08 00000002 00000000 00000003
    0x072FFF14:  00000004 11008832 033D6CBC 033D6CEC 1100C7B1 00000000
    0x072FFF2C:  0011F4E7 00000000 00000000 1101F2BF 00000000 00000000
    0x072FFF44:  072FFF80 019799C8 753F1287 00000000 520948D4 00000000
    0x072FFF5C:  00000000 019799C8 C0000005 072FFF54 072FF8C4 072FFFC4
    0x072FFF74:  75408CD5 2019A5C4 00000000 072FFF88 753F1328 072FFF94
    base: 0x07100000   top: 0x072FFE9C   bottom: 0x07300000
    
Backtrace (may be wrong):
    =>0x773DF017 LdrFindResource_U+0x184 in ntdll.dll (+0x3f017) (0x072FFEEC) 
      0x773DEF26 LdrFindResource_U+0x93 in ntdll.dll (+0x3ef26) (0x072FFF14) 
      0x11008832 in BASS.dll (+0x8832) (0x072FFF20) 
      0x1100C7B1 BASS_Update+0xf3 in BASS.dll (+0xc7b1) (0x072FFF34) 
      0x1101F2BF BASS_Init+0xce6 in BASS.dll (+0x1f2bf) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.