What dunde said and:
- $current_town is a party id, just a number, and is used to get town properties, correct
- Slots are arrays of integers that belong to an item, party, troop etc. (each item, party etc. has their own separate integer array.) Their definitions are in module_constants.py, and you can add your own slots, and remove existing ones - each slot is just an index in an array. They are indispensable for advanced features. Once you understand slots, you are past the beginner phase.
- Get a nice editor like Notepad++, or any that can search for strings over multiple files.
- Write test code (typically placed in a Camp submenu) that prints variable values when you experiment with code. Also insert debug messages (display_message) to print variable values in the code that interests you.
Example.. let's say you are baffled by $g_encountered_party. What is it and what does it do? (I'm preempting your next question here lol):
1. Do a global search for $g_encountered_party. Many hits, but it's set only in one place (I think
).
At the start of script_game_event_party_encounter:
(store_script_param_1, "$g_encountered_party"),
2. You read the description of script_game_event_party_encounter and deduce it is the party id of the encountered party.
3. You further see how it's used all over the module system. It can be a lone party, one of the parties in battle, or a location (which are parties too).
4. You get sidetracked by script_game_event_party_encounter and want to see how does it really work, so you insert temporary debug code:
(store_script_param_1, "$g_encountered_party"),
(store_script_param_2, "$g_encountered_party_2"),# encountered_party2 is set when we come across a battle or siege, otherwise it's a negative value
(str_store_party_name, s5, "$g_encountered_party"),
(display_message, "@{!}DEBUG: You encountered a party named {s5}!"),
You build the module system, run the game, and get interesting debug messages.
5. Profit