Jump to content


Photo

Ruby/RGSS3 questions that don't deserve their own thread


  • Please log in to reply
1647 replies to this topic

#1641 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 1,108 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 23 January 2015 - 02:38 PM

Neato! Make sure it works solidly in all cases, like moving at weird angles if you can though I guess.



#1642 SoulPour777

SoulPour777

    Crownless King

  • Ace Member
  • 1,403 posts
  • LocationPhilippines
  • RM Skill - Coder

Posted 24 January 2015 - 05:34 AM

Hey I have this crazy idea of making dying or decaying items. Somehow, I got stuck why it isn't getting the item_number or the id of the item considering what I've done. Here is the full code:

 

Spoiler

 

I forgot a lot about coding, I went into a total vacation in RGSS3, so please bear with me. Isn't it that the ones I am passing here should be the item.id or am I doing it wrong? I want to pass the id so I can give these probable functions:

 

The return 400 there is like how many seconds the item dies away in your inventory via Graphic frames. The return 33 is the item going to be returned or added to your inventory once the item decays. For example, I gave you an item "Fresh Meat". After a while, it rots, so in your inventory, instead of having Fresh Meat, you now have "Rotting Meat".


Edited by SoulPour777, 24 January 2015 - 09:06 AM.

 
 
My Games:
 
slender-8-torches1.jpg attack-on-trees.png?w=625
 
I support the following projects and people:
 
Spoiler

 


#1643 DrDhoom

DrDhoom

    *wink~*

  • Ace Member
  • 72 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 24 January 2015 - 08:10 AM

I think this

@perishable.push[item_id].push(perish_time)

supposed to be this

@perishable[item_id].push(perish_time)


#1644 SoulPour777

SoulPour777

    Crownless King

  • Ace Member
  • 1,403 posts
  • LocationPhilippines
  • RM Skill - Coder

Posted 24 January 2015 - 09:04 AM

Oh wait, fixed it.

 

Something is wrong, it does not still detect my item_id on this line: perish_time = calc_soul_perish(item_id)


 
 
My Games:
 
slender-8-torches1.jpg attack-on-trees.png?w=625
 
I support the following projects and people:
 
Spoiler

 


#1645 DrDhoom

DrDhoom

    *wink~*

  • Ace Member
  • 72 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 24 January 2015 - 09:40 AM

because in the argument you use "item_id", but in the case statement, you use "item_number".

Change both into "item_id" or "item_number".


Edited by DrDhoom, 24 January 2015 - 09:41 AM.


#1646 SoulPour777

SoulPour777

    Crownless King

  • Ace Member
  • 1,403 posts
  • LocationPhilippines
  • RM Skill - Coder

Posted 24 January 2015 - 09:52 AM

I changed it and it stays the same. It does not read item_id as it is undefined. I changed it to item.id and still the same error. Somehow I am missing something small here...


 
 
My Games:
 
slender-8-torches1.jpg attack-on-trees.png?w=625
 
I support the following projects and people:
 
Spoiler

 


#1647 DrDhoom

DrDhoom

    *wink~*

  • Ace Member
  • 72 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 24 January 2015 - 09:59 AM

Change every "item_id" to "item.id" in def gain_item and lose_item

And you should check the item's type, because the item could be armors and weapons too.



#1648 SoulPour777

SoulPour777

    Crownless King

  • Ace Member
  • 1,403 posts
  • LocationPhilippines
  • RM Skill - Coder

Posted 24 January 2015 - 10:09 AM

Oh there, I got it. Thanks, that was a good help. It seems I really have to review myself up, I forgot everything.


 
 
My Games:
 
slender-8-torches1.jpg attack-on-trees.png?w=625
 
I support the following projects and people:
 
Spoiler

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users