04.07.2012, 20:36
Hei.
I've recently started development of a new gamemode/server and while originally the layout was okay, as it's building up more and more code it seems to be working less.
I have this issue where when I want to script something new, for example let's say I want to script some random weapon pickups - I need three things. The array of data, the creation and the OnPlayerPickUpPickup. First thing I do is the array - but I start to go 'WHERE DO I PUT THE ARRAY DO I PUT IT ABOVE ALL THE OTHERS OR AT THE BOTTOM OR A NEW SECTION FOR WEAPON PICKUPS OR WHAT' and yeah.
This is the current roughly layout of my gamemode (FROM MEMORY):
Includes
Defines
Enums/Arrays
Variables
Callbacks
Custom Functions
mySQL query callbacks
Timers
and I guess that's okay, but I seem to be losing track of where everything is.
Also I split my callbacks up in to sections, so like in OnGameModeInit I would do something like
Initial setup (DisableEnterExits and that sort of thing)
mySQL connection
Objects
Pickups
etc.
So yeah, let's discuss layout options. What do you do? What could I do to improve?
I know some people put different systems in different files and #include them, but I think that'd be a bit of a ballache. Instead of saying 'oh I need to add a new weapon to my weapon pickups, I'll just Ctrl+F and find the array and add it in' you'd have to find out what file it's in, find that file in your /include folder then Ctrl+F through that.
I dunno, it would make it more organized I guess. I'm also developing this server with another person (blewert \o/) and we need a way to contribute to the script at the same time. I guess having systems in separate files then including them would make our lives easier.
I've recently started development of a new gamemode/server and while originally the layout was okay, as it's building up more and more code it seems to be working less.
I have this issue where when I want to script something new, for example let's say I want to script some random weapon pickups - I need three things. The array of data, the creation and the OnPlayerPickUpPickup. First thing I do is the array - but I start to go 'WHERE DO I PUT THE ARRAY DO I PUT IT ABOVE ALL THE OTHERS OR AT THE BOTTOM OR A NEW SECTION FOR WEAPON PICKUPS OR WHAT' and yeah.
This is the current roughly layout of my gamemode (FROM MEMORY):
Includes
Defines
Enums/Arrays
Variables
Callbacks
Custom Functions
mySQL query callbacks
Timers
and I guess that's okay, but I seem to be losing track of where everything is.
Also I split my callbacks up in to sections, so like in OnGameModeInit I would do something like
Initial setup (DisableEnterExits and that sort of thing)
mySQL connection
Objects
Pickups
etc.
So yeah, let's discuss layout options. What do you do? What could I do to improve?
I know some people put different systems in different files and #include them, but I think that'd be a bit of a ballache. Instead of saying 'oh I need to add a new weapon to my weapon pickups, I'll just Ctrl+F and find the array and add it in' you'd have to find out what file it's in, find that file in your /include folder then Ctrl+F through that.
I dunno, it would make it more organized I guess. I'm also developing this server with another person (blewert \o/) and we need a way to contribute to the script at the same time. I guess having systems in separate files then including them would make our lives easier.