Jump to content
  • 0

"@" variable problem. Please help


Reborn

Question


  • Group:  Members
  • Topic Count:  104
  • Topics Per Day:  0.03
  • Content Count:  290
  • Reputation:   3
  • Joined:  09/29/13
  • Last Seen:  

Hi everyone. I am doing a custom Instance but I am having a problem with this one.

 

"@"      - A temporary variable attached to the character. 
           They disappear when the character logs out.
 
 
Is there a way to remove this variable to a specific character when he/she go inside a map?
let say for exaample "prontera", instead of logging out to remove this variable can it be possible to remove this when they go to a specific map?
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

4 hours ago, neXus said:

let say for exaample "prontera", instead of logging out to remove this variable can it be possible to remove this when they go to a specific map?

I just wanted to add on Akky's answer a little. I don't necessarily recommend either of these options because if your server has lots of players it can create stress. You should always remove the variable from the script that originally assigned it after it's done being used. With that said here are two ways of removing a variable/array when players enter a specific map.

Method one OnPCLoadMapEvent:

-	script	delete_var_123	-1,{
OnPCLoadMapEvent:
	if( strcharinfo(3) == "prontera" ) {
		deletearray player_array; // You can remove arrays with this command.
		player_variable = 0; // As Akky said remove variables by setting them to zero.
	}
}
prontera	mapflag	loadevent

 

Method two OnTouch:

prontera,1,1,1	script	delete_var_111	111,1111,1111,{
OnTouch:
		deletearray player_array; // You can remove arrays with this command.
		player_variable = 0; // As Akky said remove variables by setting them to zero.
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3126
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

Script_commands.txt suggests setting the variable to 0 in order to clear it. It basically removes the variable.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  104
  • Topics Per Day:  0.03
  • Content Count:  290
  • Reputation:   3
  • Joined:  09/29/13
  • Last Seen:  

@Skorm

15 hours ago, Skorm said:

I just wanted to add on Akky's answer a little. I don't necessarily recommend either of these options because if your server has lots of players it can create stress. You should always remove the variable from the script that originally assigned it after it's done being used. With that said here are two ways of removing a variable/array when players enter a specific map.

Method one OnPCLoadMapEvent:


-	script	delete_var_123	-1,{
OnPCLoadMapEvent:
	if( strcharinfo(3) == "prontera" ) {
		deletearray player_array; // You can remove arrays with this command.
		player_variable = 0; // As Akky said remove variables by setting them to zero.
	}
}
prontera	mapflag	loadevent

 

Method two OnTouch:


prontera,1,1,1	script	delete_var_111	111,1111,1111,{
OnTouch:
		deletearray player_array; // You can remove arrays with this command.
		player_variable = 0; // As Akky said remove variables by setting them to zero.
}

 

Is it going to be per character? I dont want this variable remove to each character everytime someone goes in to this map.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3126
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

Skorms example will affect all characters. You can add your own restrictions based on your own requirements.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  104
  • Topics Per Day:  0.03
  • Content Count:  290
  • Reputation:   3
  • Joined:  09/29/13
  • Last Seen:  

All character that goes in to this map only or all characters that will be logging in to the server?

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3126
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

As they both say "prontera", I think it's safe to assume they run on the Prontera map.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  104
  • Topics Per Day:  0.03
  • Content Count:  290
  • Reputation:   3
  • Joined:  09/29/13
  • Last Seen:  

14 hours ago, Akkarin said:

As they both say "prontera", I think it's safe to assume they run on the Prontera map.

 

is it going to be per instance map or the whole map itself? (copied or original map)

Cause this will be an instance.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3126
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

It's the "prontera" map.

If you want to remove a variable for specific members leaving an instance, use the OnInstanceDestroy: label in your instance script instead.

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