Forum

> > CS2D > Scripts > E_A_V when using string in imageframe
Forums overviewCS2D overview Scripts overviewLog in to reply

English E_A_V when using string in imageframe

18 replies
To the start Previous 1 Next To the start

old E_A_V when using string in imageframe

Mami Tomoe
User Off Offline

Quote
Hi!
Doing this will crash my CS2D (EXCEPTION_ACCESS_VIOLATION)
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?

old Re: E_A_V when using string in imageframe

DC
Admin Off Offline

Quote
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.

old Re: E_A_V when using string in imageframe

DC
Admin Off Offline

Quote
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?

old Re: E_A_V when using string in imageframe

Mami Tomoe
User Off Offline

Quote
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
1
gfx/terraria/equipment/special/ashe_bow.png

old Re: E_A_V when using string in imageframe

Masea
Super User Off Offline

Quote
Well, I don't know.
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
.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview