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.

Permanent Event Action

Hi, I'm new here and I don't know to speak very good English so I hope you will understand me:

I make a chest in a room for example. From it I take 2 potions and delete the event then I get out of the room. Now I'm on another map and when I go back in the room, the chest is there and again I can pick up the potions.
So I want the changes to be permanent not by using switches because that I know... ( Maybe there is a script )

Thanks,
 

khmp

Sponsor

"Erase Event" only temporarily erases the event. Its a tad misleading. If you erase an event and leave and come back the event exists again.

The specifics:
If the $game_map.events(the current map's events) contained an event named "Toadie" and after it ran it was erased through "Erase Event". Then I leave the map and load another map. $game_map.events gets replaced with the new events from the new map. But now I go back to the previous map with the "Toadie" event. $game_map.events does not save the fact that the "Toadie" event was erased so it runs again and erases. This is done every time the map is reloaded. You need to utilize something outside $game_map to make an event remember it isn't needed. Which is why we use $game_switches, $game_variables and $game_self_switches. These are saved outside of the map($game_map).

Good luck with it Sheogorath! :thumb:

By the way excellent choice in name. He is by far the most entertaining character in Oblivion.
 
Many thanks. Now I know that the switches and the variables are the only solution. But I'm afraid: how many switches or variables you can make? If there are more 200 for example, the game will lag? Because in my game, I want all the containers to be looted.

btw, my current project is named The Amulet of Kings, a tribute to Oblivion.
 

khmp

Sponsor

The amount of switches/variables you can make is 5000. Even though when you start up the editor it only shows like the first 200. Plus even that number can be manipulated from within the script editor. Self switches depend on the total number of events you have in your game. For example if you have a total of 100 events across all your maps you would just multiply that number by 4. Also lag isn't necessarily created from switches and/or variables. The game has a set amount of them created as soon as the game runs. I think. What creates game lag are tons of events on the screen simultaneously. But there are some scripts(Anti-lag) that reduce lag by weeding out the events that don't need to be used. If that's what you are worried about.

Good luck with your game I'll be keeping tabs on it! :thumb:
 

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