Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> How to disable a 'link'?
Twin Matrix
post Oct 10 2011, 02:05 AM
Post #1


Level 19
Group Icon

Group: Revolutionary
Posts: 390
Type: Artist
RM Skill: Masterful




Say that I want to store the old stats in a variable like so:

@old_stats[i][2] = $game_party.actors[i].states

What happens is that when the states update, the old_stats actually update as well without me directly touching them. I'm guessing this is because it's a link -- because I directly made old_stats[i][2] the states.

If I do this it works:

@old_stats[i][2] = []
for i2 in 0...$game_party.actors[i].states.size
@old_stats[i][2][i2] = $game_party.actors[i].states[i2].to_i
end

But to be honest I've never seen this before and it looks pretty crappy. I'm sure there's a better way of disabling the link? Of making @old_stats[i][2] a simple variable on its own that doesn't automatically update. (Though if such a thing doesn't exist and the fault lies somewhere else, please do correct me.)


__________________________
Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th May 2013 - 12:39 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker