Splitting one big script to more smaller ones.
#1

Hello people!

As title says, I want to know is it possible to split one big script( 26k lines ) to more smaller scripts.
If yes, should I do it with filterscripts, includes ( not sure if possible ) or something else?
I want to do that to make debugging and bug fixing better and faster by splitting systems(vehicles, jobs, factions, etc.) in special files.

Tell me what you think. Thank you for your time
Reply
#2

Put them in different includes, and just include them in the main gamemode pwn.
Using tons of filterscripts is slow as hell, and communication between them is even slower and unhandy.
Reply
#3

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Put them in different includes, and just include them in the main gamemode pwn.
Using tons of filterscripts is slow as hell, and communication between them is even slower and unhandy.
I hoped to hear this. One more question. By doing this with includes, can I split callbacks.
For example if in my OnPlayerConnect in Gamemode looks like this:
Код:
public OnPlayerConnect(playerid)
{
    SendClientMessage(TextOne);
    SendClientMessage(TextTwo);
...
}
am I able to split it like this:
Код:
//INCLUDE#1
public OnPlayerConnect(playerid)
{
    SendClientMessage(TextOne);
    return 1;
}
//INCLUDE#2
public OnPlayerConnect(playerid)
{
    SendClientMessage(TextTwo);
    return 1;
}
//INCLUDE#2
public OnPlayerConnect(playerid)
{
    ...
    return 1;
}
Thank you for your response
Reply
#4

If you want to use the same callback in your includes like you said, you will need to hook the callback.

y_hooks makes it easy to hook callbacks.

Good read if you don't know what callback hooking is: Advanced library sytem (ALS)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)