how to change the hero sprite frame in plotscript?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Dani :)
Posts: 7
Joined: Mon Apr 30, 2018 6:59 pm
Location: Brazil

how to change the hero sprite frame in plotscript?

Post 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?
no, i'm not making my avatar transparent, deal with it
User avatar
Slime Knight
Posts: 221
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post 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)
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
Metal King Slime
Posts: 4097
Joined: Sun Apr 10, 2011 9:19 am

Post 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.)
Post Reply