putting item in random position in metallic chest

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
GEEK
New User
Posts: 29
Joined: Sat Jul 22, 2006 8:25 am

putting item in random position in metallic chest

Post 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.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post 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.
GEEK
New User
Posts: 29
Joined: Sat Jul 22, 2006 8:25 am

Post 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.
Post Reply