Page 1 of 1

putting item in random position in metallic chest

Posted: Wed Aug 30, 2006 8:19 am
by GEEK
I have tryed to create an intem into a chest un random positions, but all attempts are failed:

item.x := RandomInt(150) + 20 + 1;
item.y := RandomInt(130) + 20 + 1;
fail


MoveItemToContainer(item, container, RandomInt(150) + 20 + 1, RandomInt(120) + 20 + 1);

fail

all fails.

Posted: Wed Aug 30, 2006 11:13 am
by Yukiko
Are you certain that the range is within the bounds of the container into which you are trying to drop the item? Also if you read the docs for the function it says "If the default values for x and y are passed, or if x or y does not fall within the legal bounds for a container as found in ITEMDESC.CFG, then a random location within the container will be chosen. " So if you don't send any values for x and y then the function automatically chooses a random location.

Posted: Wed Aug 30, 2006 11:41 am
by GEEK
I have tryed and

CreateItemInContainer(container, objname, quantity);

or

CreateItemInContainer(container, objname, quantity);
+
MoveItemToContainer(item, container);

put all items in the same position..... one over one.