Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Jono

#1
I have two functions called AddReminder and LoseReminder. I want to use them in room scripts as well as the global script. I have exported them at the end of the global script, and imported them into the global header. However, when I try to use LoseReminder in the middle of a function in my room script, it comes back with a parse error.

I've used it within the function hDoor_Interact() as follows:

Code: ags


LoseReminder("Phone Mum.");

#2
Hi, I'm making my first game in AGS, and I want to put in a feature which can allow the player to review objectives.
This would be done with a "notebook" inventory item, which when looked at brings up a GUI displaying the objectives that haven't been completed yet. Because the game isn't completely linear, I can't have each new objective taking the place of the last.

I did have a search around the forums for similar threads and found one from a while back: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=31624.0

I don't know it was ever solved. The last post was by Ashen, who suggested an untested piece of code:

function AddReminder(String text) {
  lstMemo.InsertItemAt(0,text);
}

function LoseReminder(String text) {
  int Temp;
  while (Temp < lstMemo.ItemCount) {
    if (lstMemo.Items == text) {
      lstMemo.RemoveItem(Temp);
      Temp = lstMemo.ItemCount;
    }
  Temp ++;
  }
}

The description sounded perfect for what I want to do, which is to have a ListBox within a GUI that displays strings as they are requested, that would be stored elsewhere.

However I don't fully understand how this script works. What do I put in the place of "text"?

From what I do understand I need to put in an array index somewhere, but where and how? I've never used them before, and the section in the manual didn't clarify with me how exactly I was supposed to use them in my script.

Apologies if I'm asking too many little questions. I'm just trying to establish what I do and don't understand.
SMF spam blocked by CleanTalk