how to change the hero sprite frame in plotscript?
Moderators: marionline, SDHawk
how to change the hero sprite frame in plotscript?
let's say i load a hero sprite from a slice collection, how would i go about changing its animation frame with plotscript commands?
no, i'm not making my avatar transparent, deal with it
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
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.)
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.)