Getting assembling machine crafting content.
Posted: Thu May 09, 2013 4:55 pm
Im going to change the way the underground mining drill works, you will need to select a recipe (normal drilling, fast drilling and soft drilling), at the beggining you only have normal drilling and you need to research the other, this allows me to add diferent tipes of drilling and to make the drill animated.
But my problem now is, that I want to get the assembly machine content (an object called normal drilling, fast drilling or soft drilling) so I did this:
But that doesnt seem to work, so I went to the game, and did this:
And it prints 0...
even when there is one... Whats the problem?
I think that the problem is that assembly machines arent inventories, so you cant place stuff inside with the code :S
But my problem now is, that I want to get the assembly machine content (an object called normal drilling, fast drilling or soft drilling) so I did this:
Code: Select all
if minerEntities[z].name=="underground-mining-drill-2" and math.random(5)<=glob.undergroundminer[i].richness and minerEntities[z].getitemcount("soft-drilling")>0 or minerEntities[z].getitemcount("fast-drilling")>0 or minerEntities[z].getitemcount("normal-drilling")>0 then
Code: Select all
game.getplayer().print(game.player.character.getselected().getitemcount("normal-drilling"))
even when there is one... Whats the problem?
I think that the problem is that assembly machines arent inventories, so you cant place stuff inside with the code :S