• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fast question about optimalization

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hey, i have question about optimalization.
So.. What its better or it work same, and geting same resources of server.

When i make script, where i have few items, and when i use one of them, i sending X message (TALKTYPE_MONSTER_SAY) every 2-3s (max 4-5 messages per one item), and now
Better is when i make it in one script, with tables etc, or when i make every item in other script? Or it working same and getting same rescoures of server?

Sorry for my bad english and if something is incomprehensible then i try it explain again with translator not by my bad english
 
Performance wise it probably does not make a noticeable difference. I recommend you have a separate script for each item because it is the most structured way to write code (instead of ending up with a single huge spaghetti script).

Only when you notice your script is slowing down your server, you may look into suitable alternative options.
 
It doesn't really matter, something on this scale can't impact the server enough for you to worry about.
Personally I wouldn't even think about doing it in different files.
 
if the functionality of your items is close to each other and easy to generalize with a single function (for example potions - requirement check, healing, magic effect, leaving a vial, sending orange message), you can do it on a single script
 
It doesn't really matter, something on this scale can't impact the server enough for you to worry about.
Personally I wouldn't even think about doing it in different files.

i maked it in one file, but in few "scripts?", in data/scripts folder.
And after maked all, my super brain got super idea.. And im here.. :D

if the functionality of your items is close to each other and easy to generalize with a single function (for example potions - requirement check, healing, magic effect, leaving a vial, sending orange message), you can do it on a single script

All items doing same work, they only sending other text. But when i maked it (all item in other "script?" but in one file in data/scripts), my brain get better idea about make it in one script, and this is why i asked about optimalization it, cuz i don't know must to change it or i can leave as is


(More about script: It after use item, sending to player few lines text, one line per 2-3s + magic effect (one per text))
 
Back
Top