Jump to content
  • 0

Variables and RAM


badneko

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   1
  • Joined:  06/09/14
  • Last Seen:  

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 ? (.@)

 

After create a temporary npc vartiable .@, this variable return to 0 , or disappear ?

 

Im trying to avoid the consume of ram in Npc variables, .@ variables are the best options ?

 

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

Second question !

 

for example if i have .@Apples.

Delete this script, in the next boot this .@apples still exist ?

Exist as .@apple = 0 

or just erased from all existence ?

Edited by badneko
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  74
  • Topics Per Day:  0.02
  • Content Count:  420
  • Reputation:   89
  • Joined:  01/30/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   1
  • Joined:  06/09/14
  • Last Seen:  

@Antares

Roockie Bro Fist !

Thanks dude, but i still doubting about .@ :P

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...