Log in to reply
 

Object scaling?



  • Hey,
    I can't fully remember where I've read it but I've seen someone talking about realtime object scaling via script. It's probably possible somehow via memory editing but that's none of my business. Is there anyone who could help me out with that? Cause that would be very useful for my upcoming mod. Btw I'm using C++.

    If anyone can help, then it's probably @CamxxCore I guess?



  • @Oskar I'm not personally aware of any way to do this with objects. I know it can be done with peds.



  • @CamxxCore Hm, okay. So it's not possible to do the same with props? (Not talking about real map objects)



  • @Oskar It may be possible but I haven't really looked into it enough. With peds, the game just checks a config flag and adjusts the scale based on that. Objects are handled quite differently and obviously don't use config flags. There could be something useful buried deep in the relevant drawing functions but I haven't been inspired to look.



  • @Oskar Try scaling the objects matrix. i.e. myObject.Matrix *= 2.0



  • @CamxxCore Is there a native for that or is it a custom function from ScripthookDotNet? (cause I'm using C++)



  • @Oskar There is a GET_ENTITY_MATRIX function. Don't think there is one to set it though. Try this:

    typedef __m128 CVector;
    #pragma pack(push, 1)
    struct CMatrix
    {
    CVector right;
    CVector forward;
    CVector up;
    CVector pos;
    };
    #pragma pack(pop)
    
    auto address = getScriptHandleBaseAddress(entity);
    
    auto matrix = reinterpret_cast<CMatrix*>(address + 0x60);
    
    //  manipulate the matrix..

  • MODERATOR

    @CamxxCore I would manipulate this one as well:

    auto phInstGtaMatrix = reinterpret_cast<CMatrix*>(*reinterpret_cast<uintptr_t*>(address + 0x30) + 0x20);
    


  • @Unknown-Modder @Oskar Yeah probably good idea. I guess the collision wouldn't be right otherwise...



  • As mentioned scaling can be done for peds, but also, any entities attached to the ped will also scale according...


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.