Code: Select all
lady.save_all('savegame', player)
Code: Select all
lady.save_all('savegame', player)
Code: Select all
image = love.graphics.newImage("assets/items/small/"..fileName..".png"),
imageLarge = love.graphics.newImage("assets/items/large/"..fileName.."LG"..".png"),
Code: Select all
for i = 1, #itemsOnMap do
lady.register_class(itemsOnMap[i], 'item'..i)
end
Code: Select all
lady.register_resource(resource, name)
Code: Select all
lady.register_resource(image, fileName)
lady.register_resource(imageLarge, fileName.."LG")
Code: Select all
itemsOnMap = {
Item:new(itemw,itemh,32, 32, 1, "Wooden Bat","woodenBat",2,nil, 0, "", 1, 1),
Item:new(300,50,32, 32, 2, "Vital Ring","vitalRing",nil,nil, 5, "Health", 1, 7),
Item:new(70,250,32, 32, 3, "Rusty Dagger", "rustyIronDagger",2,nil, 0, "", 1, 1),
Item:new(60,110,32, 32, 1, "bronzeSpear","bronzeSpear",2,nil, 0, "", 1, 1),
Item:new(390,70,32, 32, 2, "Cloth Robe","clothRobe",nil,1, 0, "", 1, 5),
Item:new(100,250,32, 32, 3, "Pine Plank Shield", "pinePlankShield",nil,2, 0, "", 1, 3),
Item:new(80,100,32, 32, 1, "Wooden Bat","woodenBat",2,nil, 0, "", 1, 1),
Item:new(350,50,32, 32, 2, "Ox Ring","oxRing",2,nil, 2, "Strength", 1, 8),
Item:new(90,250,32, 32, 3, "Cloth Robe", "clothRobe",2,nil, 0, "", 1, 5),
Item:new(20,110,32, 32, 1, "bronzeSpear","bronzeSpear",2,nil, 0, "", 1, 1),
Item:new(10,70,32, 32, 2, "Cloth Hood","clothHood",nil,1, 0, "", 1, 2),
Item:new(50,250,32, 32, 3, "Cotton Boots", "cottonBoot",nil,2, 0, "", 1, 4),
Item:new(50,250,32, 32, 3, "Vital Necklace", "vitalNeck",nil,2, 7, "Health", 1, 6)
}
Code: Select all
function Item:new(x,y,w,h,itemID,itemName,fileName,atk,def,specialPercent,specialType, itemAmount, type)
local ItemO = {
x = x,
y = y,
w = w,
h = h,
id = itemID,
name = itemName,
image = love.graphics.newImage("assets/items/small/"..fileName..".png"),
imageLarge = love.graphics.newImage("assets/items/large/"..fileName.."LG"..".png"),
attack = atk,
defense = def,
health = 1,
amount = itemAmount,
itemType = type
}
setmetatable(ItemO, { __index = Item })
return ItemO
end
This is starting to annoy me now. Right. I am registering the image but then I thought maybe the registered class is missing. So then I try it all and still see this message about unregistered userdata. What on earth is going on?Trying to serialize unregistered userdata image
Code: Select all
for i=1,#itemsOnMap do
lady.register_class(itemsOnMap[i], itemsOnMap[i].fileName)
lady.register_resource(itemsOnMap[i].image, itemsOnMap[i].fileName)
lady.register_resource(itemsOnMap[i].imageLarge, itemsOnMap[i].fileName.."LG")
end
In the future, you can edit your last post in the thread to put in the new things you want to say if less than a day or so has passed. That way you don't spam the thread like you did today.Lacotemale wrote:Apologies for all the posts. xD
Users browsing this forum: Bing [Bot], Todespreis and 90 guests