Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Controlling self-switches. Please?

Anonymous

Guest

This is just background. Skip it if you wish.

Okay, for those who want to know why I am needing this, I have characters who use skills which need items. I want to make these items easy to stock up on, so I decided on being able to pick them up and having them re-appear upon re-entry of an area. (If you need an example, like cuting grass/trees on the pokemon games and coming back later to see they've re-appeared. This isn't really the kind of thing I can back up with screens, sorry.) I've tired doing this with switches and not only is it a pain in the arse, I'm wasteing a lot of switches. I'd like to be able to use self switches for this, but as far as I can tell, events can't alter each other's self switches.

Okay, If you skipped that part start reading here.

Basically what I need is:

Being able to alter (or just reset if it's easier, I only need them turned off) the self switches of events using a call script on a different event

Being able to say which events I want the switches changing on (to differentiate between harvestable and 'one-time' items. I don't want the player to find LOLULTIMATEWEPON in a chest and leave, return and get it again)

That's it, I think. It would be brilliant if it could get along well with the SDK, too, since I'm going to have my work cut out for me if it doesn't and I really don't understand these things.

I can't really offer much in return, If you wanted art I suppose I could do that.
 
Quite simple, really.
Code:
key = [map_id, event_id, switch]
$game_selfswitches[key] = bool
map_id and event_id are self explanitory, switch is either 'A', 'B', 'C' or 'D', and bool is either true or false.

Remember to $game_map.refresh after setting the switch.

(My not be 100% correct. I don't have RMXP on this comp.)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top