Reborn Posted January 23, 2017 Group: Members Topic Count: 104 Topics Per Day: 0.02 Content Count: 290 Reputation: 3 Joined: 09/29/13 Last Seen: December 28, 2024 Share 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 Link to comment Share on other sites More sharing options...
1 Skorm Posted January 23, 2017 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share 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 Link to comment Share on other sites More sharing options...
0 Akkarin Posted January 23, 2017 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1630 Joined: 03/26/12 Last Seen: Tuesday at 10:17 AM Share Posted January 23, 2017 Script_commands.txt suggests setting the variable to 0 in order to clear it. It basically removes the variable. Quote Link to comment Share on other sites More sharing options...
0 Reborn Posted January 23, 2017 Group: Members Topic Count: 104 Topics Per Day: 0.02 Content Count: 290 Reputation: 3 Joined: 09/29/13 Last Seen: December 28, 2024 Author Share 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 Link to comment Share on other sites More sharing options...
0 Akkarin Posted January 23, 2017 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1630 Joined: 03/26/12 Last Seen: Tuesday at 10:17 AM Share Posted January 23, 2017 Skorms example will affect all characters. You can add your own restrictions based on your own requirements. Quote Link to comment Share on other sites More sharing options...
0 Reborn Posted January 23, 2017 Group: Members Topic Count: 104 Topics Per Day: 0.02 Content Count: 290 Reputation: 3 Joined: 09/29/13 Last Seen: December 28, 2024 Author Share 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 Link to comment Share on other sites More sharing options...
0 Akkarin Posted January 23, 2017 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1630 Joined: 03/26/12 Last Seen: Tuesday at 10:17 AM Share Posted January 23, 2017 As they both say "prontera", I think it's safe to assume they run on the Prontera map. Quote Link to comment Share on other sites More sharing options...
0 Reborn Posted January 23, 2017 Group: Members Topic Count: 104 Topics Per Day: 0.02 Content Count: 290 Reputation: 3 Joined: 09/29/13 Last Seen: December 28, 2024 Author Share 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 Link to comment Share on other sites More sharing options...
0 Akkarin Posted January 23, 2017 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1630 Joined: 03/26/12 Last Seen: Tuesday at 10:17 AM Share 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 Link to comment Share on other sites More sharing options...
Question
Reborn
Hi everyone. I am doing a custom Instance but I am having a problem with this one.
Link to comment
Share on other sites
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.