Banks

From HIVE
Revision as of 06:16, 21 November 2010 by DevliN (talk | contribs) (1 revision: StarEdit.net Wiki)
Jump to navigation Jump to search

Banks are used to call data saved from a previous play. They are mostly used for Save/Load systems and Ranking systems.

Example: amount of time spent in a map

First of all, create those 2 variables:

Minutes spent in map (Bank) = No Bank <Bank>
Minutes = 0 <Integer>

You can now proceed to steal this work without giving any credits:

Trigger Reference

http://vgshorts.com/BBCode/BBCode3.php?ID=101

Initialization
   Events
       Game - Map initialization
   Local Variables
   Conditions
   Actions
       Bank - Open bank "Minutes" for player 1
       Bank - Preload and synchronize bank "Minutes" for player 1
       Variable - Set Minutes spent in map (Bank) = (Last opened bank)
       Variable - Set Minutes = (Load "Minutes" of section "Time Event" from bank (Last opened bank) as integer value)


http://vgshorts.com/BBCode/BBCode3.php?ID=102

Update
   Events
       Timer - Elapsed time is 60.0 Real Time seconds
   Local Variables
   Conditions
   Actions
       Variable - Modify Minutes: + 1
       Bank - Store integer Minutes as "Minutes" of section "Time Event" in bank Minutes spent in map (Bank)
       Bank - Save bank Minutes spent in map (Bank)
       UI - Display (Combine ("Minutes of your life wasted in this...", (Text(Minutes)))) for (All players) to Chat area

Note/Theorizing

Note: The "Preload ans synchronize" action, while looking useless, is extremely important. I've also heard there was a maximum of values we could store in Banks, though I do not have any source to quote nor do I even have numbers to share.

- "Preload and Synchronize Bank" can be put anywhere in your triggers, because it's executed before everything else during the loading screen (it basically makes Banks available to the map). You can't use variables for the bank name or the player number because variables aren't even initialized when that code is called. (Whiskee)