Forum

> > CS2D > Scripts > E_A_V when using string in imageframe
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch E_A_V when using string in imageframe

18 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt E_A_V when using string in imageframe

Mami Tomoe
User Off Offline

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

alt Re: E_A_V when using string in imageframe

DC
Admin Off Offline

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

alt Re: E_A_V when using string in imageframe

DC
Admin Off Offline

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

alt Re: E_A_V when using string in imageframe

Mami Tomoe
User Off Offline

Zitieren
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

alt Re: E_A_V when using string in imageframe

Masea
Super User Off Offline

Zitieren
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
.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht