Page 1 of 1

how to change the hero sprite frame in plotscript?

Posted: Wed Dec 04, 2019 12:55 pm
by Dani :)
let's say i load a hero sprite from a slice collection, how would i go about changing its animation frame with plotscript commands?

Posted: Wed Dec 04, 2019 2:15 pm
by Bird
Is it "set sprite frame"? I've used it like that once on a walkabout sprite:

Code: Select all

global variable (1,g)
plotscript,examplename,begin
g := load walkabout sprite (313,100) # Load Walkabout nr. 313 with palette nr. 100
put slice (g,240,110) # Put the sprite on position x=240 and y=110
set sprite frame (g,1) # Change the graphics
end

Posted: Wed Dec 04, 2019 2:25 pm
by TMC
Yes. The frame number would be 0 to 7.

Just an aside: this is in contrast to the "set hero frame" or "set npc frame" commands, which take a frame number of 0 to 1, and you have to set the NPC/hero direction to get all 8 frames. (And you can't use "set sprite frame" on NPC or hero sprite slices because builtin hero/NPC animation will override your changes. Only works on sprite slices you create yourself.)