RP Art Utilities


Helper functions for using RP Art mods

Internal
14 days ago
1.1 - 2.0
12.4K

g [Closed] Coding Assistance

2 years ago

Hello! I'm using this mod and the RP Plasma Turret 1 mod to reskin the turrets from the Shock Turrets mod, but I'm having trouble figuring out precisely what to replace the my_turret, my_item, and my_technology bits with format-wise. Here's what I have tried so far:

Replacing with "adikings-shock-turret" (get an 'attempt to concatenate field 'type' (a nil value) error)
Replaced with ["electric-turret"]["adikings-shock-turret"] with and without the quotes (get an 'unexpected symbol near [' error)

May I get advice on what I should be putting there and/or the proper format?

2 years ago

Are you sending the name of the entity instead of the entity object? my_turret needs to be the entity itself, not the name of it. Can you post some code?

2 years ago
(updated 2 years ago)

For the name of the turret, I went into the mod's zip and referenced the prototypes/entity/turrets.lua, and found the 'name' field. This is what it looks like in the file:
data:extend(
{
{
type = "electric-turret",
name = "adikings-shock-turret",
icon = "ShockTurret/graphics/icons/shock-turret.png",

etc

So my adapted reskin code based on your template looks like this:
local rp_art_util = require("rp_art_util/rp_art_util");
-- Note: tesla_turret_1 comes in a separate mod
local turret_art = require("rp_plasma_turret_1_art/plasma_turret_1");

-- Makes the turret look like tesla_turret_1
rp_art_util:use_sprites("adikings-shock-turret", turret_art);
2 years ago
(updated 2 years ago)

You need to send the actual entity through using data.raw["electric-turret"]["adikings-shock-turret"]

local rp_art_util = require("__rp_art_util__/rp_art_util");
-- Note: tesla_turret_1 comes in a separate mod
local turret_art = require("__rp_plasma_turret_1_art__/plasma_turret_1");

-- Makes the turret look like tesla_turret_1
rp_art_util:use_sprites(data.raw["electric-turret"]["adikings-shock-turret"], turret_art);
2 years ago

Ah, I see. Just tried it out, and works like a charm! Thanks a bunch for the help.

1 year, 1 month ago

I re-read the license terms of the original store and I do NOT think you can use these. I will add a DRM-esq thing to them later today.

11 months ago

Oookay. Assuming this mod and its art addons are meant to be used for reskins, may I ask how one is supposed to go about using them then? I guess I'm just confused about if the art mods are dead in the water given the license restrictions or if they're still usable.

11 months ago

I don't think they can be used for that. When I first purchased them the license was more permissive but they changed it at some point. I'm pretty sad and annoyed about it.

11 months ago

Ah. Definitely a shame, sorry to hear it got changed.

New response