Object interaction basics

Started by stars, Wed 12/08/2009 23:30:04

Previous topic - Next topic

stars

okay here goes.

I have started a new game with a moving character and several rooms etc.

I am using the default template for now.

I want it so that the character cannot pick up or look at an object until they are near it.

By default the character could be one end of the room and still view or pick up the object.

This does not work for me as I need the character to explore the room.

I am sure it is simple but I am having trouble getting scripts to complile etc.

The concept is simple and easy to code in straight C or basic but I cannot get to grips with setting it all out in AGS.

Any help would be appreciated. Code and where to place it etc.

Thanks in advance.





Matti

Just make a region around the object and ask in the objects interaction (like the pickup event) if the character is standing on that region.

Like this:

if (Region.GetAtRoomXY(player.x, player.y) == region[1])
  // pick up object


Khris

Or, if you meant you want the character to move near the object first, use a blocking walk command.

SMF spam blocked by CleanTalk