Need help with GotThere module

Started by MonkeySyrup, Fri 21/06/2019 17:04:07

Previous topic - Next topic

MonkeySyrup

I tried to use Khris's GotThere module, but it looks like I won't be able to understand it myself and I think that it is a little bit changed since latest mentions of this module in this forum. So here's my function:

Code: ags

function hGoLeft_Interact()
{
  if(!WalkFace(90, 660, eLeft))
  {
    player.ChangeRoom(2, 1320, 700);
  }
}


I'm just trying to change room when player reaches coordinates (90, 660), but when I click on hotspot, player moves to coordinates (mouse.x, mouse.y) and don't change room. Maybe I just use wrong function or just don't know how to use it correctly. As I understand, bool GotThere and function GoFace doesn't exist anymore. Hopefully, module's author will be able to help me

Vincent

This is how generally I do when using this module:

Code: ags

function hGoLeft_Interact()
{
  if (!GotThere()) GoFace(90, 660);
  else
  {
     player.ChangeRoom(2, 1320, 700);
  }
}

MonkeySyrup

But that doesn't work for me, because error "undefined symbol 'GotThere'" shows up. Do I need to write something more somewhere else or am I using wrong version of this module?

Vincent

Quote from: MonkeySyrup on Fri 21/06/2019 18:29:36
But that doesn't work for me, because error "undefined symbol 'GotThere'" shows up. Do I need to write something more somewhere else or am I using wrong version of this module?

I have GotThere module version 0.2. In the module header I have this:

Code: ags

enum Dir {
  eLeft,
  eRight,
  eDown,
  eUp
};

import void GoFace(int go_x, int go_y);
import bool GotThere();


I don't know maybe you have an early version of the module?

MonkeySyrup

Oh, mine shows

Code: ags

enum Dir {
  eLeft,
  eRight,
  eDown,
  eUp
};

import bool WalkFace(int x, int y, Dir d);


I'll search for 0.2 version then

Vincent

Quote from: MonkeySyrup on Fri 21/06/2019 18:35:47
Oh, mine shows

Code: ags

enum Dir {
  eLeft,
  eRight,
  eDown,
  eUp
};

import bool WalkFace(int x, int y, Dir d);


I'll search for 0.2 version then

Okay, in case you will not find it here it is: http://www.fileconvoy.com/dfl.php?id=g3cf0cdce9ab62bc21000177800e1bd3ad3a5abdb1b


Vincent


Khris

For the current version you don't need the  !:
Code: ags

function hGoLeft_Interact()
{
  if(WalkFace(90, 660, eLeft))
  {
    player.ChangeRoom(2, 1320, 700);
  }
}

MonkeySyrup

Oh, so that's what I was doing wrong. Now I'll know. Thanks!

SMF spam blocked by CleanTalk