customplates icon indicating copy to clipboard operation
customplates copied to clipboard

multiple plates

Open wolfrunner86 opened this issue 3 years ago • 2 comments

i was tinkering with this and came up with a way to replace all the plates in one rescource

--- IMAGE CONFIG HERE --- imageUrl1 = "https://i.imgur.com/NmnAbCE.png" -- Paste your image URL here (doesn't have to be from imgur) imageUrl1n = "https://i.imgur.com/9yBqgfV.png" -- this URL doesn't need to be edited used for bumpmap imageUrl2 = "https://i.imgur.com/fdYKraW.png" -- Paste your image URL here (doesn't have to be from imgur) imageUrl2n = "https://i.imgur.com/9yBqgfV.png" -- this URL doesn't need to be edited used for bumpmap imageUrl3 = "https://i.imgur.com/hoKpfsF.png" -- Paste your image URL here (doesn't have to be from imgur) imageUrl3n = "https://i.imgur.com/9yBqgfV.png" -- this URL doesn't need to be edited used for bumpmap imageUrl4 = "https://i.imgur.com/RNwHuWr.png" -- Paste your image URL here (doesn't have to be from imgur) imageUrl4n = "https://i.imgur.com/9yBqgfV.png" -- this URL doesn't need to be edited used for bumpmap imageUrl5 = "https://i.imgur.com/kdLNlJQ.png" -- Paste your image URL here (doesn't have to be from imgur) imageUrl5n = "https://i.imgur.com/9yBqgfV.png" -- this URL doesn't need to be edited used for bumpmap imageUrl6 = "https://i.imgur.com/RNwHuWr.png" -- Paste your image URL here (doesn't have to be from imgur) imageUrl6n = "https://i.imgur.com/9yBqgfV.png" -- this URL doesn't need to be edited used for bumpmap

-- The actual script -- local textureDic = CreateRuntimeTxd('duiTxd') -- Create custom texture dictionary only needs to be done once local object = CreateDui(imageUrl1, 540, 300) -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate01', 'duiTxd', 'duiTex') -- Applies "duiTex" from "duiTxd" to "plate01" from "vehshare"

local object = CreateDui(imageUrl1n, 540, 300) -- this URL doesn't need to be edited, its just the 2d model for the plate -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex2", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate01_n', 'duiTxd', 'duiTex2') -- Applies "duiTex2" from "duiTxd" to "plate01_n" from "vehshare"

-- The actual script -- local textureDic = CreateRuntimeTxd('duiTxd') -- Create custom texture dictionary only needs to be done once local object = CreateDui(imageUrl2, 540, 300) -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate02', 'duiTxd', 'duiTex') -- Applies "duiTex" from "duiTxd" to "plate02" from "vehshare"

local object = CreateDui(imageUrl2n, 540, 300) -- this URL doesn't need to be edited, its just the 2d model for the plate -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex2", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate02_n', 'duiTxd', 'duiTex2') -- Applies "duiTex2" from "duiTxd" to "plate02_n" from "vehshare"

-- The actual script -- local textureDic = CreateRuntimeTxd('duiTxd') -- Create custom texture dictionary only needs to be done once local object = CreateDui(imageUrl3, 540, 300) -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate03', 'duiTxd', 'duiTex') -- Applies "duiTex" from "duiTxd" to "plate03" from "vehshare"

local object = CreateDui(imageUrl3n, 540, 300) -- this URL doesn't need to be edited, its just the 2d model for the plate -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex2", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate03_n', 'duiTxd', 'duiTex2') -- Applies "duiTex2" from "duiTxd" to "plate03_n" from "vehshare"

-- The actual script -- local textureDic = CreateRuntimeTxd('duiTxd') -- Create custom texture dictionary only needs to be done once local object = CreateDui(imageUrl4, 540, 300) -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate04', 'duiTxd', 'duiTex') -- Applies "duiTex" from "duiTxd" to "plate04" from "vehshare"

local object = CreateDui(imageUrl4n, 540, 300) -- this URL doesn't need to be edited, its just the 2d model for the plate -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex2", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate04_n', 'duiTxd', 'duiTex2') -- Applies "duiTex2" from "duiTxd" to "plate04_n" from "vehshare"

-- The actual script -- local textureDic = CreateRuntimeTxd('duiTxd') -- Create custom texture dictionary only needs to be done once local object = CreateDui(imageUrl5, 540, 300) -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate05', 'duiTxd', 'duiTex') -- Applies "duiTex" from "duiTxd" to "plate05" from "vehshare"

local object = CreateDui(imageUrl5n, 540, 300) -- this URL doesn't need to be edited, its just the 2d model for the plate -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex2", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'plate05_n', 'duiTxd', 'duiTex2') -- Applies "duiTex2" from "duiTxd" to "plate05_n" from "vehshare"

-- The actual script -- local textureDic = CreateRuntimeTxd('duiTxd') -- Create custom texture dictionary only needs to be done once local object = CreateDui(imageUrl6, 540, 300) -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'yankton_plate', 'duiTxd', 'duiTex') -- Applies "duiTex" from "duiTxd" to "yankton_plate" from "vehshare"

local object = CreateDui(imageUrl6n, 540, 300) -- this URL doesn't need to be edited, its just the 2d model for the plate -- Load image into object local handle = GetDuiHandle(object) -- Gets DUI handle from object CreateRuntimeTextureFromDuiHandle(textureDic, "duiTex2", handle) -- Creates the texture "duiTex" in the "duiTxd" dictionary AddReplaceTexture('vehshare', 'yankton_plate_n', 'duiTxd', 'duiTex2') -- Applies "duiTex2" from "duiTxd" to "yankton_plate_n" from "vehshare"

wolfrunner86 avatar Mar 06 '21 04:03 wolfrunner86

Doesn't look the prettiest, but does indeed work. Try opening a merge request.

hoxsec avatar Aug 15 '21 10:08 hoxsec

It works, but I have a problem and a question. I used the same image for all the plates and all other plates than the first, kinda gets a gray filter over it making it look quite off. Do also anyone know if it is possible to not have yellow text on some of the plates?

kongelg avatar Mar 12 '23 20:03 kongelg