Object disappears before walking to it. (Solved in 3.09878 seconds)

Started by Jack Sheehan, Fri 22/02/2008 23:53:03

Previous topic - Next topic

Jack Sheehan

This is really irritating me because it's so simple and it was easy to do in 2.72. When I set a simple object interaction, he walks towards it and picks it up, but it disappears before he reaches it.

The code is:
function oBlock_Interact()
{
cEric.Walk (217, 154);
oBlock.Visible=false ;
}

How can I make it disappear after he stops walking? Cheers.

OneDollar

By making the walk function blocking, which means the program waits until the walk has finished before executing the rest of the commands (like the block disappearing). Just replace your walk line with cEric.Walk(217, 154, eBlock);

There are two optional parameters you can add to the walk command (as the script guide thing will tell you), the first using eBlock or eNoBlock to indicate if the command should be blocking, and the second using eAnywhere or eWalkableAreas to indicate whether the character should follow the walkable areas or not when walking.

Jack Sheehan

Thats perfect, thanks a million. I may not be good at scripting, but I'm getting there. Thanks again.

SMF spam blocked by CleanTalk