Jump to content

How to modify a property of standard item?


Eggon

Recommended Posts

Hi, is it possible to modify via a mod particular properties of standard in-game items without having to copy the whole object definition?

 

Eg, if this is standard Stone item definiton:

  item Stone
    {
        Type                =        Normal,
        DisplayName            =        Stone,
        Icon                =        TZ_Stone,
        Weight                =        1.5,
    }

And I simply want to change the Weight property to 2.0, can I do it without overwriting the whole definition?

Something like this:

Stone.Weight = 2.0

Is it possible? How to achieve it? I haven't seen anything on this in the basic tutorials.

Link to comment
Share on other sites

@ProjectSkythanks a lot! That worked for an item! :D

Do you know how to access vehicles definitions in a similar way? I'm looking at the docs for the ScriptManager: https://projectzomboid.com/modding/zombie/scripting/ScriptManager.html , but there's no "getVehicle()" method and I guess vehicles are not items? the only "getVehicle()" I found on this forum related to player object and the car the player is in. I didnt find anything pn the global object either.

Edited by Eggon
Link to comment
Share on other sites

16 hours ago, Eggon said:

@ProjectSkythanks a lot! That worked for an item! :D

Do you know how to access vehicles definitions in a similar way? I'm looking at the docs for the ScriptManager: https://projectzomboid.com/modding/zombie/scripting/ScriptManager.html , but there's no "getVehicle()" method and I guess vehicles are not items? the only "getVehicle()" I found on this forum related to player object and the car the player is in. I didnt find anything pn the global object either.

Maybe VehicleScript.class, I’m not sure.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...