error when trying to load images

Description: Archive discussion
============================
Original description:
Official subforum for LunaLua - an extension framework for SMBX Engine Version 1.3 (which a core of SMBX 2.0). Share your creations that require the use of LunaLUA. You may also share info/tutorials on how to use LunaLUA.

Sambo M
Topic author, Count
Count
Avatar
Sambo M
Topic author, Count
Count
Age: 25
Reputation: 15
Posts: 264
Joined: 27 Jun 2014

Post #1by Sambo » 20 Dec 2014, 23:39

When I try to use the loadImage function, I get this error message:
Image
Here are my codes:

Code: Select all

function onLoad()
  loadImage ("hud.png", 1, ff00dc)
  loadImage ("dcind.png", 2, ff00dc)
  loadImage ("dcslot.png", 3, ff00dc)
  placeSprite (1, 1, 174, 8)
end


Will someone tell me what I'm doing wrong here? (images are in the same directory as my lunaworld file)
Also, how do I put in a path for filenames, and what is the "type" parameter that goes with the placeSprite function for?
Image
Current Project:
Image

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 30
Reputation: 493
Posts: 1747
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #2by Wohlstand » 21 Dec 2014, 2:02

Try the GIF images for a test.

EDIT: Ouch, Kevin is right (message below), I missed wrong heximals

Kevsoft M
Angry developer
Angry developer
Avatar
Kevsoft M
Angry developer
Angry developer
Age: 24
Reputation: 93
Posts: 379
Joined: 26 Apr 2014
Location: Austria
Website

Post #3by Kevsoft » 21 Dec 2014, 9:43

For hex you need to add a '0x' as prefix.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Sambo M
Topic author, Count
Count
Avatar
Sambo M
Topic author, Count
Count
Age: 25
Reputation: 15
Posts: 264
Joined: 27 Jun 2014

Post #4by Sambo » 22 Dec 2014, 22:18

There's not an error message now, but the codes still don't do anything. And now SMBX crashes when trying to open some of my levels, even when I get rid of the lunaworld file completely.
I found out that I had somehow deleted the background folder, and that was causing the crash. And the codes work, they just can't find the images to load. I must have the path to the file put in wrong. How am I supposed to put in the path so it will work? Currently the path in the code is "HUD\hud.png" The full path is
"C:\SMBX\worlds\Mario & the 7 Orbs\HUD\hud.png" I tried both those for the path, actually, and neither of them worked.
Here's my code after I modified it:

Code: Select all

function onLoad()
  loadImage ("HUD\hud.png", 1, 0xff00dc);
  loadImage ("HUD\dcind.png", 2, 0xff00dc);
  loadImage ("HUD\dcslot.png", 3, 0xff00dc);
end
function onLoop()
  placeSprite (1, 1, 174, 8);
end


Also, I was wondering, does the placeSprite function work if triggered on level load, or does it need to be on the onLoop function?
Image
Current Project:
Image


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest