Jump to content
  • 0

Proper variable type for instances?


michaelsoftman

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  410
  • Reputation:   29
  • Joined:  04/04/12
  • Last Seen:  

So, quick question.


Say I have an instance map, with 5 mobs, all with the same OnMobDead: label.

 

I want to have a variable that keeps count of the dead mobs, something like this:

 

OnMobDead:

set mobdead,mobdead+1;

if (mobdead > 4) {

etc etc...

 

But I was just wondering what the proper type of variable is to use for this, since it's an instance?  Would it just be an NPC variable, like .@mobdead?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

NPC variables (.var) are shared across all duplicate NPCs, so they'll be set in every instance. This is rarely what you want.

If mobcount() won't work for you, you can try using instance variables ('var) to store data, but be sure to initialize them as necessary - they won't be reset when executing @reloadscript.

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