| 02-18-2006, 04:15 AM | #1 |
Is there any way I can get one item from a Item Table? For example: 3% Minor Potion 5% Potion 6% Major Potion etc. then it goes and grabs a random item from the table. |
| 02-18-2006, 02:26 PM | #2 |
I'm don't believe there are any function that interacts with the Item Tables that can be set up in WE. I'm not sure, but my guess would be that those are used pretty much exclusively for item drops when killing units that give a bounty. |
| 02-18-2006, 03:47 PM | #3 |
There is a way to use WE's items table, of course it requires JASS and that you actually inspect the map's script file. I think that making your own item table with triggers is easier |
| 02-18-2006, 05:13 PM | #4 |
Vexorian, are the Item Tables the type itempool in JASS? |
| 02-18-2006, 05:18 PM | #5 |
for some odd reasons nope. Item tables are functions that WE adds to the top of the map script |
| 02-18-2006, 06:32 PM | #6 |
What are item pools? And what are the item table functions, I looked on Jass Manual and found no item table functions. |
| 02-19-2006, 01:03 AM | #7 |
they are not in any manual because WE generates them it is something funky like this JASS:function ItemTable_0001 takes nothing returns nothing //do some operations on arrays and random numbers //create item in position of triggering unit // destroy this trigger endfunction Funny thing is that WE generated item tables have memory leaks. It is better to use your own item tables, really. Just make an array and pick an random number and stuff like that |
| 02-19-2006, 01:08 AM | #8 |
Custom made drop tables don't work correctly. I'm also finding WE item tables not to work right. I'm trying to make a drop system that works like WoW's. When I mean like WoW's i'm talking about how it works not the drops. I'm not 100% sure how WoW's drop system works. |
| 02-19-2006, 05:28 AM | #9 |
I created an itemarray and added the common items more times to it then the less common ones. For example Set FreeItem[1]= Wood Set FreeItem[2]= Telescope Set FreeItem[3]= Telescope Set FreeItem[4]= RandomUncommonItem And did a simply Hero -create FreeItem (Maths Random Number (1-10) Item. |
| 02-19-2006, 05:37 AM | #10 |
can you make a weighted version? im looking for a map of that |
| 02-19-2006, 02:25 PM | #11 |
pseudocode:
Chance[1]=20
Chance[2]=35
Chance[3]=1
Chance[4]=79
S=0
for i=1 to 4
{
S=S+Chance[i]
}
P=GetRandomInt(1,S)
for (i=1 to 4)
{
if (Chance[i+1]>P)
//Picked index is i
} |
