How do I trigger an event by the player standing somewhere?

Started by highkingtorygg, Mon 27/07/2015 19:55:57

Previous topic - Next topic

highkingtorygg

So far I'm just using if statements to have them able to pick up the thing. The bad part about that is that i'm a very basic programmer and can only trigger the events on a certain pixel.

Slasher

i assume you mean hard to click on object/hotspot....

could be:
if the hotspot for a mouse cursor is not set in the best place it can be awkward to click on things. The hand interact hotspot should ideally be on the end of the middle finger for example, or in the center of the eye of look cursor.

check mouse cursor modes and their graphic hotspot x y.

Or do you mean from a region? you can use if functions like hotspots as well. like if player walks on...




Dualnames

Also a silly way to solve this is by doing the most common checks. Rectangle checks.

So you can do this, not very advised when regions exist, but here it is anyway.
Code: ags

function repeatedly_execute()
{
  //this will constantly run a check on a 40x20 rectangle area.
  if (cEgo.x >= 50 && cEgo.x <= 90 && cEgo.y >= 100 && cEgo.y <= 120)
  {
    //do ur thing
  }
}


Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk