Scripts:Change hero sprite when standing still

From OHRRPGCE-Wiki
Jump to navigation Jump to search

These scripts let you change the hero walkabout sprite to a standing still frame when the hero isn't moving, and use a normal two-frame walking animation otherwise.

First you need to include the scripts from scripts:hero will move, which these depend upon. Draw two walkbout sprite sets: one with 2-frame walking animations and each direction, and one where both frames in each direction show the hero standing still. Set walking animation onkeypress as the onkeypress script on all your maps, and walking animation eachstep as the each-step script on all maps.

Note that these scripts won't work if you move your heroes manually with "walk hero" and similar commands. You will have to add "set hero picture" commands to your script to change to the walking spriteset, and momentarily disable the each-step script below (eg by added a tag check).

plotscript, walking animation onkeypress, begin
  if (hero is walking (me) == false) then (
    # Standing on a tile, might start movement
    if (hero will move) then (
      # Walking spriteset
      set hero picture (me, 0, outside battle)   ## CHANGE THIS
    )
  )
end

plotscript, walking animation eachstep, begin
  if (hero will move == false) then (
    # Standing still spriteset
    set hero picture (me, 3, outside battle)   ## CHANGE THIS
  )
end


See Also[edit]