Reborn Posted January 23, 2017 Posted January 23, 2017 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? Quote
1 Skorm Posted January 23, 2017 Posted January 23, 2017 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. } 1 Quote
0 Akkarin Posted January 23, 2017 Posted January 23, 2017 Script_commands.txt suggests setting the variable to 0 in order to clear it. It basically removes the variable. Quote
0 Reborn Posted January 23, 2017 Author Posted January 23, 2017 @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. Quote
0 Akkarin Posted January 23, 2017 Posted January 23, 2017 Skorms example will affect all characters. You can add your own restrictions based on your own requirements. Quote
0 Reborn Posted January 23, 2017 Author Posted January 23, 2017 All character that goes in to this map only or all characters that will be logging in to the server? Quote
0 Akkarin Posted January 23, 2017 Posted January 23, 2017 As they both say "prontera", I think it's safe to assume they run on the Prontera map. Quote
0 Reborn Posted January 23, 2017 Author Posted January 23, 2017 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. Quote
0 Akkarin Posted January 23, 2017 Posted January 23, 2017 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. Quote
Question
Reborn
Hi everyone. I am doing a custom Instance but I am having a problem with this one.
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.