Walking to object before picking it up?

Started by Gribbler, Fri 01/09/2006 19:15:58

Previous topic - Next topic

Gribbler

Hi

I have a problem. When I put object in a room and get the player to pick it up object is removed from room no matter where the character is standing. I want him to first go to the object and THEN pick it up (maybe add bending animation too). So here's the question: how can I do it?
I tried various scripts. None worked.

thanks in advance for any help

Candle

#1
See below.

Gribbler

I'm not exactly sure what you mean. Should I use hotspot for that? I know there is 'walk point' but its for hotspots not for objects.

Candle

Sorry about that.
Let me see if I can find it.

Candle


Gribbler


Khris

Aside from this question having been asked here about a million times already, there are various ways.
If you want to simply code it every time, use something like this:
player.Walk(x, y, eBlock);
player.LockView(VIEW); // change this to the pick up-view 
player.Animate(...); // play pick up-animation, make sure it's blocking
oItem.Visible=false; // turn off object
player.AddInventory(iItem);
player.UnlockView();
Alternatively, you could use a custom function:
function WalkPickUp(int x, int y, int dir, int obj, InventoryItem*inv) {
Ã,  player.Walk(x, y, eBlock);
Ã,  player.LockView(VIEW); // change this to the pick up-view 
Ã,  player.Animate(...dir...); // play pick up-animation, make sure it's blocking
Ã,  object[obj].Visible=false; // turn off object
Ã,  player.AddInventory(inv);
Ã,  player.UnlockView();
}
You could use Custom Properties to store the walk-to coords for objects.
Ã,  player.Walk(object[obj].GetProperty("x"), object[obj].GetProperty("y"), eBlock);


SMF spam blocked by CleanTalk