Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Apr 30, 2013 at 09:20 AM by Fattie for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by Azaroth · Apr 30, 2013 at 07:25 AM · itemdropmonster

Item drop on monster kill

So guys i have this problem. Should i create a list with all items? Its gonna be huge. If i create an array with just the names, i will have problem with the levels. What can i do?

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image moha · Apr 30, 2013 at 07:29 AM 0
Share

could you please rephrase your question. it's not clear. there is no logic in here...

avatar image Azaroth · Apr 30, 2013 at 07:37 AM 0
Share

Ok so when the enemy dies in the game, it must drop a random item based on player's class. So the item will be random, the item grade will be with chances, and the item level must be between monster level - 1 and monster level + 1. How can i do this? :D

avatar image moha · Apr 30, 2013 at 07:54 AM 0
Share

Ok, $$anonymous$$aybe you can try with a 2 dimensional array:

int[,] $$anonymous$$yItemArray = new int[2, 3];

with 3 = the number of level you got 2 = the number of items at this level.

then you pick a random number between your level - 1 & +1 and a random item number and your item is selected. is it clear ?

avatar image Azaroth · Apr 30, 2013 at 08:23 AM 0
Share

Pretty awesome actually, and i will have an extra item array with all the items that are from -1 & +1 level of the monster right?

avatar image Azaroth · Apr 30, 2013 at 08:44 AM 0
Share

But this is very hard, i will have to do this with every monster

Show more comments

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by moha · Apr 30, 2013 at 09:09 AM

You can put the script on your camera or in an empty gameobject. then you call the function which select the item from a script on you monster :

script on empty GameObject:

int[,] mytab = int[2,3]

public void PopRandomObject(int levelMonster) { generate a random number between lvl - 1 & +1; generate a other one for the seconde dimension; }

Script on you monter:

find the game object on the one is the first script; Gameobject.find("objectname").getComponent().PopRandomObject(levelofthis monster)

the second script call the function which pop a random object in the first one.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I want to know how to drop my item with a keyboard button 1 Answer

Random drop rate problem 2 Answers

Item Drop Help 1 Answer

inventory system: drop item with mouseclick 1 Answer

Same prefab getting instantiated for the different items 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges