Topic: .resource and .resource_amount
Tibor Topic Opener |
Posted at: 2014-01-14, 21:37
Hi, I found another thing that does not behaves as expected. I am allocating resources like water or fish via f.resourse='xxx' and f.resource_amount=x, it seems that variables are changed (print confirms this), but there is no update within editor - no image of fish appears over the field...? Also, how could I get rid of a resource on the field? I tried f.resource='' and f.resource=nill but to no avail.... Top Quote |
SirVer |
Posted at: 2014-01-15, 05:35
Removing the resource should work by setting the resource_amount to = 0. I do not think that the Editor is updating the overlays properly - have you tried to save and reload the map after changing the resources? Note that scripting in the Editor is not perfectly supported and pretty rough around the edges. Top Quote |
Tibor Topic Opener |
Posted at: 2014-01-15, 22:20
Yes, reload of map helped. Not best solution ever but at least something... Top Quote |
Tibor Topic Opener |
Posted at: 2014-01-15, 22:23
yet another (related) question: removal of immovables? (via lua scripting) Top Quote |
SirVer |
Posted at: 2014-01-16, 17:33
. It is what it is - as said, what you are doing right now is not really supported, more of a debug aid. Feel free to provide patches to make it more user friendly. Top Quote |
SirVer |
Posted at: 2014-01-16, 17:33
map:get_field(13,13).immovable:remove() Top Quote |
Tibor Topic Opener |
Posted at: 2014-01-16, 21:11
I would like to, but this is far behind my capabilities, if it was like 5 or 10 hours of my time... but I would end up with no result and only with frustration... Top Quote |
Tibor Topic Opener |
Posted at: 2014-01-16, 21:51
Well, another problem, the code is:
Top Quote |
SirVer |
Posted at: 2014-01-17, 05:21
Probably. It means that whatever you wanted to place on this node does not have enough space to be placed there, likely another immovable is already on the field. Top Quote |