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

Messages - (deleted)

#103
(deleted)
#104
(deleted)
#105
General Discussion / Re: Seattle suggestions?
Thu 02/10/2008 05:38:32
(deleted)
#106
AGS Games in Production / Re: Boryokudan Rue
Fri 19/09/2008 10:51:03
Wow.

Visuals are outstanding. Very stylish.

Good luck finishing! ...and extra good luck staying reclusive.
#107
I, uhh.. Heh, heh. I knew that.

Works now, btw. Thanks for your charitable assistance.
#108
Thanks for your help, fellas.

Laukku: No, not exactly. The idea is to create a single listbox which uses text to reflect details about the player's inventory.

The function in question serves two purposes:

1. Prevent duplicate entries in the list box.

2. Update constantly to reflect changes in player inventory.

Zabnat: Good idea with retrieving custom properties to supply the string text. (I'm using it, and you'll never see a red cent.)

KhrisMUC: Ahhh! It works! I may have omitted one or two elements, since (in the case of my project) there's only one List Box to be concerned with.

However, when calling this function in repeatedly_execute, it fills the list with the specified string, instead of adding only one. I'm using two functions (to disambiguate):

Code: ags


bool Contains(this ListBox*, String s) {
  int i = 0;
  bool found = false;
  while(i < this.ItemCount){
    if(this.Items[i] == s) found = true;
    i++;
  }
  return found;
}

bool Doesntcontain(this ListBox*, String s) {
  int i = 0;
  bool found = false;
  while(i < this.ItemCount){
    if(this.Items[i] != s) found = true;
    i++;
  }
  return found;
}

///--------Later, in Repeatedly_Execute...///--------------

if ((player.InventoryQuantity[Goo.ID] >0) && (Boxedlist.Doesntcontain("Goo Description"))) // -- List Doesn't Show Goo Description, yet.
{Boxedlist.AddItem("Goo Description");} // Add it.

if ((player.InventoryQuantity[Goo.ID] >0) &&  (Boxedlist.Contains("Goo Description"))) // -- List Does Show Goo Description
{} // -- Do nothing.


...so if it only adds to the list when it doesn't already contain the text, why is it filling up with duplicates?
#109
(After studying previous forum posts regarding this dilemma, it seems to become apparent that this question merits a new topic)

What I'm attempting to accomplish is a function which searches through the contents of a list box to see if a string of text exists there, or not. The ideal function would accommodate the list box's total item number changing.

For example, if the player has Goo in his inventory, the function (located in repeatedly_execute) would update the list box with an entry called "Goo Listbox Text." I've used the term contents in the code below:

Code: ags

function repeatedly_execute() 
{

   if (player.InventoryQuantity[Goo.ID] != 0){         // PLAYER'S GOT THE GOO.
       if (listbox.contents != ("Goo Listbox Text"))  // NO GOO ENTRY IN LIST BOX?
       listbox.AddItem("Goo Listbox Text");}         // ADD LISTBOX ENTRY
   }

}


...so right now, uhh... I'm stumped.

I've tried a few approaches which result in the "INVALID INDEX NUMBER" error, and others which depend on the  listbox.ItemCount remaining the same (so I can check each slot, numerically) - but as I mentioned earlier, the total number of items in the list box changes, so checking via "listbox.items#" won't work, since the index number needs to accommodate a variable total.

Is there, perhaps, a way to convert a list box's contents to a series of strings, which can be checked? ...this is all so daunting.

Here's another example, which I've tried. It results in the game hanging - eternal loop style - and I get the error: "Script appears to be hung in GlobalScript etc"

Code: ags


int TotalNumber;

while (TotalNumber == Listbox.ItemCount -1) {
 if ((Listbox.Items[TotalNumber] != "Goo Listbox Text")  &&  (player.InventoryQuantity[Goo.ID] !=0 ))
   {Menu.AddItem("Goo Listbox Text");}
 else {}
}



I'm absolutely sure there's a head-slappingly simple way of reaching a solution, so come on, you dogs. You have full permission to make me look like an incapable dunce.
#111
(deleted)
#112
Wow... Two first place winners, and I still get "second"? Nice!

This was my first ever contest entry, and I'm looking forward to more.

Thanks for the fun theme! What's next?
#113
(deleted)
#114
haha - Nice everybody.

#1 - Moment of Delight

#2 - Dangerous Seduction

#3 - Please I Said

These songs make me want to put up venetian blinds on all my windows.
#115
AGS Games in Production / (deleted)
Sun 13/07/2008 14:34:49
(deleted)
#116
(deleted)
#117
Critics' Lounge / Re: sprites for my rts
Mon 16/06/2008 10:39:03
(deleted)
#119
(deleted)
#120
(deleted)
SMF spam blocked by CleanTalk