Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 3 posts ] 
    jayje
  Thu May 18, 2017 1:49 pm
Member

I'm working on a custom crafting system for my game and was wondering if there was a way of adding a selected item's ID to a variable. Meaning if I choose an item, it's ID gets added to a variable to use later. Any thoughts or feedback are welcome.


Top Top
Profile      
 

    coyotecraft
  Thu May 18, 2017 9:07 pm
User avatar
Sponsor

Big Dumb Guy
I don't know the exact syntax and class names off the top of my head. But your itemlist is an array, and the cursor index tells you what position you are in. The thing to remember with index positions is that the first element is 0. Second item is 1 and so forth...

array = [item1, item2, item3]
cursorIndex = 0
array[cursorIndex] #=> item1

So you want to do something like...
newVar = array[cursorIndex].id #=> newVar = item1.id


Top Top
Profile      
 

    jayje
  Fri May 19, 2017 12:32 am
Member

HHMM... Thanks for the input. Something to think about.


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group