Pulp hide help: help wanted!

I need to know how to use PulpScript to hide something that is not the player. And I need to know how to make it apeer and then hide again.

The player is able to use "hide" which shows the tile behind the player, (so your background tiles,) instead of the actual player tile. Because the tiles are the background, hiding them wouldn't work. I think what you may be able to do is identify which tile you'd like to hide, figure out what you'd want to display in place of that tile, and use "swap" to change that tile. The easiest way to do this is to use a tile type that supports code, (So an item or a sprite) and use that in place of whatever tile you're trying to hide. You can insert the following into a sprite tile to see an example.

on interact do
 swap "white"
end

If you want to be able to have it hide without interacting with it, then just swap out "interact" for your own event name and call it from the player code.

One option if you're not using animated tiles is to set the fps to 0, and add a second frame that's blank. Then you can just use that frame to hide the tile, but keep the tile itself in place.

eg. if the first frame shows the actual tile and the second frame is blank, use

  tell tile_x, tile_y to
    frame 0
  end

to show it, and

  tell tile_x, tile_y to
    frame 1
  end

to hide it.

Or to extend Lucian's interaction example, you could show/hide a sprite on each interaction by doing:

on interact do
  current_frame = frame
  if current_frame == 0 then
    frame 1
  else
    frame 0
  end
end

you could also use 'draw' to cover it up with your background tile to hide it and then just stop drawing when you want it to appear again.

this will not stop the tile from having interactions though; if the tile itself has interactions you'll need to either

  • move them somewhere else
  • have them check whatever flag you use to know if it should be hidden
  • use swap so that it just is another tile instead of drawing or changing the frame (like someone above suggested)

if you need something to be solid and then walkable you'll basically HAVE to use swap unless you want to code in some manual player movements with 'goto' or something