English E_A_V when using string in imageframe

18 replies
Goto Page
To the start Previous 1 Next To the start
Up
Goo
User
Offline Off
Hi!
Doing this will crash my CS2D (EXCEPTION_ACCESS_VIOLATION)
Code:
1
PLAYERS[id].tmp.equip[i].image = image("<spritesheet:"..ITEMS[newitems[i]].eimage..":48:96:m>", 2, 1, (ITEMS[newitems[i]].ground and 100 or 200)+id)


I do have
imageframe(PLAYERS[id].tmp.equip[i].image, 1)
below it if anyone cares.

Is there a way to fix this?
23.05.17 06:51:12 pm
Up
DC
Admin
Offline Off
Hm.. I didn't implement the spritesheet image feature but did you double check the sizes of the frames and made sure that the image has enough frames?

I assume that this might occur when the image is not big enough to provide enough frames of that size. Would have to check the source code if that isn't the issue.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
23.05.17 06:55:14 pm
Up
Goo
User
Offline Off
The image is 48x96 (only 1 frame) I want to test it first before I go and add multiple images.
Also http://cs2d.com/help.php?luacat=all&luacmd=imageframe#cmd
23.05.17 07:39:12 pm
Up
DC
Admin
Offline Off
Okay... well.. then it has an error I guess
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
23.05.17 07:44:08 pm
Up
Goo
User
Offline Off
Will it be fixed in the next release?
23.05.17 07:47:28 pm
Up
DC
Admin
Offline Off
Maybe. Can't promise anything. As I said: I didn't implement that feature and I will have to take a look at it.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
23.05.17 08:02:42 pm
Up
Goo
User
Offline Off
It only crashes when I use a string, it works when I just type the full location.

local loc=gfx/file.png

Using loc will not work but using gfx/file.png will.
23.05.17 08:06:10 pm
Up
DC
Admin
Offline Off
Are you sure? This doesn't really make any sense to me. Can you please give 2 full examples, one crashing one not, showing what you just described?
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
23.05.17 08:31:27 pm
Up
Goo
User
Offline Off
Code:
1
2
3
4
5
6
if ITEMS[newitems[i]].effect==1 then
     PLAYERS[id].tmp.equip[i].image = image("<spritesheet:"..ITEMS[newitems[i]].eimage..":48:96:m>", 2, 1, (ITEMS[newitems[i]].ground and 100 or 200)+id)
     imageframe(PLAYERS[id].tmp.equip[i].image, 1)
else
     PLAYERS[id].tmp.equip[i].image = image(ITEMS[newitems[i]].eimage, 2, 1, (ITEMS[newitems[i]].ground and 100 or 200)+id)
end


This crashes when I reach line #2
If I print the value of
ITEMS[newitems[i]].eimage
I will get
Code:
1
gfx/terraria/equipment/special/ashe_bow.png
23.05.17 08:36:08 pm
Up
Gaios
Security Supporter
Offline Off
What I just made some spritesheets and all worked for me.
IMG:https://i.imgur.com/itOslkM.gif
This community is a meme.
23.05.17 08:39:15 pm
Up
Masea
Super User
Offline Off
Can you upload that sprite?
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
23.05.17 08:43:55 pm
Up
Goo
User
Offline Off
IMG:http://i.imgur.com/AuiUApj.png


that
23.05.17 08:46:11 pm
Up
Masea
Super User
Offline Off
Well, I don't know.
Code:
1
Images.PlayerBow=image("<spritesheet:gfx/ufra/items/"..ITEMS[Player.Inventory["Bow"][Player.Equipment["Bow"]][1]].use_image..":32:40>",2,0,1+200)
I used something like this once before and it was working right.

EDIT: Oh wait, I think I found the issue. Looks like you were confused while setting up coordinates. Not
48:96
, the true one is
96:48
.
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
23.05.17 09:06:41 pm
Up
Goo
User
Offline Off
Oh it doesn't crash now, seems good for now I will continue tomorrow.
It should've printed an error though.
23.05.17 09:11:18 pm
Up
Masea
Super User
Offline Off
@user Goo: Did you even try mine?
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
24.05.17 10:20:08 am
Up
Goo
User
Offline Off
Yeah it works now I've found the problem and I can assure you I blame MSPaint for confusing me.
24.05.17 10:46:02 am
Up
Yates
Reviewer
Offline Off
Paint.NET is the way to go √
24.05.17 11:37:39 am
Up
Goo
User
Offline Off
I use paint.net but I (used to) use MSPaint for quickly getting the x and y of an image and it shows the y first and the x below it! Go figure...
24.05.17 11:49:39 am
Up
Masea
Super User
Offline Off
@user Goo: Not for me.
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
To the start Previous 1 Next To the start