RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator

Home Page:https://www.rigsofrods.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[AS]- BeamClass::setTotalMass not working?

Lepes opened this issue · comments

commented

Steps to reproduce

  1. load any map
  2. load any truck and/or trailer attached and enter into it
  3. Press ingame "T" to see actual truck weight.
  4. load AngelScript code attached as a log file
    The code is:
    void main()
    {
    BeamClass @vehicle = game.getCurrentTruck();
    float totalCon = vehicle.getTotalMass(true);
    print("total mass is "+ totalCon);
    vehicle.setMass(18000.f);
    print("new mass should be 18 tons "+ vehicle.getTotalMass(true));
    }
    output:
    16:09:03: total mass is 5300.39
    16:09:03: new mass should be 18 tons 5300.39

Expected behaviour

mass should be changed dinamically from 5300.39 to 18000

Actual behaviour

mass doesn't change at all. Did I made something wrong? Do I miss something?

Vehicle / map tested:

It doesn't mind, It doesn't work as expected for any truck/trailer.
Pasted output is with Atego-CoMaxB (Pedro's Mercedes Atego).

Tested also with Pricorde Daf and Semi 37 Tons , the output mass is 49 tons no matter what quantity I setup on setTotalMass:
16:34:37: Executing main() in mass.as(category:CUSTOM,unique ID:1)
16:34:37: total mass is 49356.2
16:34:37: new mass should be 18 tons 49356.2
16:34:37: The script finished successfully.

mass.as.log

System configuration

OS: Kubuntu Linux 22.04 , (64 bits)
Renderer used: OpenGL on X11