How do I start a modular project?
#2

Quote:
Originally Posted by Josh_Lotus
Посмотреть сообщение
PAWNO scripting
Pawn scripting. Pawno is an editor.

All files are still included into the main gamemode and you can access functions and global variables across those files without problems, provided they aren't declared 'static'. Static functions and static globals are only visible to the file they have been declared in. This is comparable to 'private' keyword in OO languages where private variables can only be used inside the class they've been declared in.

Public functions should only be used for callbacks. That includes the default callbacks, functions that are called by timers and certain specific callbacks that are called by plugins. For a function to be stock, it should be able to be used by anyone in any script. That means that it should be a stand-alone function that does not depend on gamemode specific variables to work.

As far as modules are concerned: they should be able to be disabled and enabled without affecting anything else. If this is not possible then I like to consider this a "core" module: without it the gamemode cannot function. You can, for example, create a module "House" which stores their locations, their prices, all the necessary commands, etc. A module is usually built by hooking into the existing callbacks (see ALS hook method). In OnGameModeInit, for example, you may wish to create icons or pickups. But these shouldn't be added if the module isn't enabled.

Compiler: there is only one compiler. Or actually two if you count Zeex' fixes. The compiler (pawncc.exe) can be invoked manually or through an editor, with the right parameters. More information can be found in the manual (pawn-lang.pdf).

Plugins: there are several plugins you may wish to use. I consider the most useful and commonly used ones to be Sscanf, Streamer and MySQL, but there are other ones that you may find useful such as MapAndreas or FileManager.
Reply


Messages In This Thread
How do I start a modular project? - by Josh_Lotus - 12.01.2016, 12:00
Re: How do I start a modular project? - by Vince - 12.01.2016, 12:36
Re: How do I start a modular project? - by Runn3R - 12.01.2016, 12:40
Re: How do I start a modular project? - by AriF786 - 12.01.2016, 12:50
Re: How do I start a modular project? - by Josh_Lotus - 12.01.2016, 13:22
Re: How do I start a modular project? - by Josh_Lotus - 12.01.2016, 13:29
Re: How do I start a modular project? - by Josh_Lotus - 12.01.2016, 18:27
Re: How do I start a modular project? - by Runn3R - 13.01.2016, 08:43

Forum Jump:


Users browsing this thread: 1 Guest(s)