Jump to content
  • 0
badneko

Variables and RAM

Question

Its said variable consume ram.

But exactly wich ram?

every step in the game, or just the first loading of the server (char,map,login)

 

Npc variables are dangerius in big numbers?, how many exactly ? 100-200-300-1000 ?

And even temporary variables are problematic ? ([email protected])

 

After create a temporary npc vartiable [email protected], this variable return to 0 , or disappear ?

 

Im trying to avoid the consume of ram in Npc variables, [email protected] variables are the best options ?

 

---------------------

Second question !

 

for example if i have [email protected]

Delete this script, in the next boot this [email protected] still exist ?

Exist as [email protected] = 0 

or just erased from all existence ?

Edited by badneko
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

I'm a rookie, but as I understand, you may use variables freely. They consume very little ram, unless you create them in an infinite loop. :D

 

http://rathena.org/wiki/Variables#Temporal_vs_Permanent

 

I suggest to always use the lowest possible scope for a variable, eg: If a variable is only used during a calculation in an event (like OnPCKillEvent), and it is not required after, then make it a temporary script variable, but of course if you want to store a quest progress, make it a permanent character variable, and if you want a server-wide setting/progress variable make it a permanent global variable.

 

But the wiki is the best description. Read it and you will understand everything :)

http://rathena.org/wiki/Variables

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.