RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
EZ ?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 87
how would i call a different array based on class? ( call array_1 if actor.class_id == 1, call array_2 if actor.class_id == 2)

******
Revolution is not a bed of roses.
Rep:
Level 91
Project of the Month winner for July 2009
You need to be more specific, I'm not sure what you mean. Try this though.
Code: [Select]
if actor.class_id == 1
  arraycode
elsif actor.class_id == 2
  arraycode
end

***
Rep:
Level 87
umm sort of the way u can call bitmaps and files in the cache by saying 'bitmap_'+@actor_id'.bmp'
« Last Edit: September 11, 2007, 01:18:50 AM by da good king »

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
Explain what you're trying to do and I'll be able to help. Anyways, here's how you would call a graphic from the cache.

Code: [Select]
RPG::Cache.cache_type(file name, picture hue)
cache_type is what folder you're trying to pull a graphic from.
file name is the name of the graphic you're trying to use.
picture hue is the hue of the graphic.
I.E If you want to use a battler, it'd be RPG::Cache.battler(file name, picture hue)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
If what you are trying to do is change the identifier (possibly incorrect term, but the name of the array), then do what Falcon says. As far as I know there is no way to add on something like '_2' or '_1' to a variable name. Better to do it more or less like this:

case actor.class_id
when 1
  array = array_1
when 2
  array = array_2
when 3...
end

You can add things like that to Symbols, but to be honest I don't know much about Symbols, and I do not think they work in the same manner as Identifiers.

***
Rep:
Level 87
well thx ill try that