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 - dayowlron

#721
The Rumpus Room / Re: The Points Game
Fri 11/08/2017 22:13:25
dang, thought I might be onto something but the word "is" should score a point.
#722
The Rumpus Room / Re: The Points Game
Fri 11/08/2017 22:10:35
figure this giving that four letter sort
#723
Not sure I understand the question, but yes. in fact the standard status bar is a GUI.
#724
The Rumpus Room / Re: The Points Game
Fri 11/08/2017 20:09:38
I a is to
#725
The Rumpus Room / Re: The Points Game
Fri 11/08/2017 18:12:20
I a is to of be in if it
#726
The Rumpus Room / Re: The Points Game
Fri 11/08/2017 17:33:36
want figure this giving seems words that four letter sort clue
#727
The Rumpus Room / Re: The Points Game
Fri 11/08/2017 17:28:06
Can I get one clue? Basically want to know if there is a minimum number of letters that have to be in a word to score a point?
#728
The Rumpus Room / Re: The Points Game
Fri 11/08/2017 14:51:54
I want to figure this out so I am not giving up. seems like most of the words that give points are four letter words. Wondering if that is some sort of clue.
#729
Unable to test this, but here is some code that should work.
Call RemoveListboxItemByName(listboxcontrol,stringtoremove)
and
AddListboxItemByName(listboxcontrol,stringtoremove)
Code: ags

function RemoveItemByName ( GUIControl* listbox, String name )
{
	int i = 0;
	while ( i < listbox.AsListBox.ItemCount )
	{
		if ( listbox.AsListBox.Items[i] == name )
			listbox.AsListBox.RemoveItem ( i );

		i++;
	}
}

function AddListboxItemByName(GUIControl* listbox, String desc)
{
  int i = 0;
  String buffer = "";
  while (i < desc.Length) {
    if (GetTextWidth(buffer.AppendChar(desc.Chars[i]), listbox.Font) <= listbox.Width) buffer = buffer.AppendChar(desc.Chars[i]);
    else {
      while ((buffer.Contains(" ") != -1) && (buffer.Chars[buffer.Length - 1] != ' ')) {
        buffer = buffer.Truncate(buffer.Length - 1); // since there's no reverse-contains, take off one character at a time
        i--;
        }
      listbox.AddItem(buffer);
      i--;
      buffer = "";
      if (listbox.Items[listbox.ItemCount - 1].Contains("[") != -1) {
        int temp = listbox.Items[listbox.ItemCount - 1].Contains("[");
        buffer = listbox.Items[listbox.ItemCount - 1].Substring(temp + 1, listbox.Items[listbox.ItemCount - 1].Length);
        listbox.Items[listbox.ItemCount - 1] = listbox.Items[listbox.ItemCount - 1].Substring(0, temp);
        }
      }
    i++;
    }
  listbox.AddItem(buffer);
  if (buffer.Contains("[") != -1) {
    int temp = buffer.Contains("[");
    listbox.Items[listbox.ItemCount - 1] = buffer.Truncate(temp);
    listbox.AddItem(buffer.Substring(temp + 1, buffer.Length));
    }
}

function RemoveListboxItemByName(GUIControl* listbox, String desc)
{
  int i = 0;
  String buffer = "";
  while (i < desc.Length) {
    if (GetTextWidth(buffer.AppendChar(desc.Chars[i]), listbox.Font) <= listbox.Width) buffer = buffer.AppendChar(desc.Chars[i]);
    else {
      while ((buffer.Contains(" ") != -1) && (buffer.Chars[buffer.Length - 1] != ' ')) {
        buffer = buffer.Truncate(buffer.Length - 1); // since there's no reverse-contains, take off one character at a time
        i--;
        }
      RemoveItemByName(listbox, buffer);
      i--;
      buffer = "";
      if (listbox.Items[listbox.ItemCount - 1].Contains("[") != -1) {
        int temp = listbox.Items[listbox.ItemCount - 1].Contains("[");
        buffer = listbox.Items[listbox.ItemCount - 1].Substring(temp + 1, listbox.Items[listbox.ItemCount - 1].Length);
        listbox.Items[listbox.ItemCount - 1] = listbox.Items[listbox.ItemCount - 1].Substring(0, temp);
        }
      }
    i++;
    }
  RemoveItemByName(listbox, buffer);
  if (buffer.Contains("[") != -1) {
    int temp = buffer.Contains("[");
    listbox.Items[listbox.ItemCount - 1] = buffer.Truncate(temp);
    RemoveItemByName(listbox, buffer.Substring(temp + 1, buffer.Length));
    }
}

#730
every place you find the code lstRoomDesc.AddItem add in the code for the remove call passing in the same string. I saw it in 3 separate places. Perhaps you missed one of them? probably the first one.
#731
well SetTimer(1,800) says to not fire off for 20 seconds. try moving the 800 down to like 40.
#732
not able to test this but this should work. Where are you putting this call? on_mouse_click?
Code: ags

InventoryItem *item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
player.SayAt(26, 0, 270,String.Format("To my knowledge %s and %s do not mix.",player.ActiveInventory.Name, item.Name));
#733
Something else I noticed.
You have the timer starting if you have isTimHideandSeeking set to true and you are running this from the room_FirstLoad event.
Does the flag get set to true before you enter this room for the first time? if not then the timer would never be started so it would never "expire".
Maybe that code belongs somewhere else. maybe room_Load instead?

you need him to count down every second 20...19...18...17, not 20 then 20 seconds later say 19.

Just remove the 20* and it should work
#734
It appears that the word wrapping function is dividing up the strings into multiple strings and adding each individual item.
so if you had "phrase1 phrase2" and you added it to the list box then it is splitting the phrases and adding "phrase1" as 1 entry then "phrase2" as the second entry. Then when you try to find the item to be removed you are looking for 1 entry that has "phrase1 phrase2" and not finding it in the listbox.
What needs to be done is in the removing of the item from the list box you need to do the same splitting you did when you added the entry and then search the list for each item. I could help with the coding there but not right now. I am still at work.
#735
room_RepExec gets executed with every game loop which by default is 40 times per second (if i remember correctly)
The call to IsTimerExpired checks during that execution of the function whether the timer has expired and if it has then it returns true causing the statements to be executed every second.

Khris, why did you have SetTimer(1, 20 * GetGameSpeed()) and not just SetTimer(1, GetGameSpeed())? He needs it to go into the if statement every second so you see the countdown.

By saying none of the solutions work can you tell us more about what it is doing?
#736
well I am sure someone can jump in and give you some code examples but a few things I see is:
1) there is nothing to initialize counter to be 20 so I suppose you are doing that fine.
2) I see you setting the timer but never checking to see if the timer has expired. SetTimer does not stop the program from executing for the specified amount of time, it just sets a timer that you need to call IsTimerExpired(timer#).
3) the reason you only see "0" is it runs through all 20 say backgrounds in the very first processing loop.

Something you can try and not sure if it will work but in the room_RepExec change
while(counter > 0)
to
if (IsTimerExpired(1) && counter>0)
#737
The Rumpus Room / Re: The 4 word story thread
Thu 10/08/2017 15:15:00
skeleton key revealed the
#738
The Rumpus Room / Re: The Points Game
Wed 09/08/2017 14:27:29
point joint he went back pack
#739
The Rumpus Room / Re: *Guess the Movie Title*
Tue 08/08/2017 20:15:04
I was thinking the guy in the first pic looks a little like a young Richard Masur, so:
My Brothers Keeper
or
The Patriots?
#740
The Rumpus Room / Re: Name the Game
Tue 08/08/2017 20:08:29
Quote from: Amayirot Akago on Tue 08/08/2017 17:57:57
Sol 0: Mars Colonization.
Correct Amayirot
SMF spam blocked by CleanTalk