Skip to content

SetCartPartMaterial

Gives a part of a cart another of the game’s materials - its wood a different colour.

slot is "body", "axle", "wheels" or "load"; material one of the game’s .mtl files made for that part’s mesh - another mesh’s material draws it wrong (parts of it vanish). The b wagon parts (the bodies "b", "b_plain", "b_covered", both axles, the wheels "b" and "b_covered") take the game’s wood variants objects/manmade/vehicles/wagons/wagon_b_new.mtl (their own), wagon_b_darker.mtl, wagon_b_new_b.mtl, wagon_b_new_c.mtl, wagon_b_prague.mtl and wagon_b_gypsy.mtl; the a and c bodies ("a" is the default) and the polygonal wheels have their own material only - give a cart a b body first (SetCartPart) to change its wood. The two-wheeler’s take objects/manmade/vehicles/carts/cart_a.mtl to cart_e.mtl (cart_b.mtl its own). nil gives the part its own back. It stays when SetCartPart changes the slot. A free colour is not offered: the game’s materials do not take one.

SetCartPartMaterial(id, slot [, material])
Parameter Type
id number the cart
slot string "body", "axle", "wheels" or "load"
material string a .mtl path of the game’s; nil = the part’s own (optional)

boolean - false for no cart, a horse slot, a slot its kind has not or a bad path

-- a dark wagon on new wheels
SetCartPartMaterial(cart, "body", "objects/manmade/vehicles/wagons/wagon_b_darker.mtl")
SetCartPartMaterial(cart, "wheels", "objects/manmade/vehicles/wagons/wagon_b_new_c.mtl")

GetCartPartMaterial · SetCartPart · AddCartProp · the Carts group of the index