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

#1
Completed Game Announcements / Gobyworld
Fri 14/04/2023 15:57:51
Gobyworld is now out on Steam for free!
You can also play on Itch or at www.Gobyworld.com


An absurd point-and-click adventure, where you help Goby, a piece of swallowed gum, in his quest to find freedom beyond the digestive system. Transforming the folky myth that swallowed gum remains in the stomach for seven years-- Gobyworld lets you experience the misadventures of an anthropomorphized gum named Goby.

  • Use mouse, WASD and keyboard to play.
  • Play time is around 30 minutes.
  • Explore seven levels and fifteen rooms including the stomach, small intestine, large intestine, rectum/anus, esophagus and mouth.
  • Meet tummy characters and collect tummy items.
  • GUMMY

Thank you to the AGS forum community who helped with numerous questions. I hope you all enjoy!
#2
Hi, does anyone know why my Background 1 (not the main background) is glitching? I have two backgrounds, the first one, and after the character walks through one time, it's supposed to show Background 1. Instead, it glitches and shows this. It worked for one of the rooms, but not for two others. The code is the same. I tried renaming and reuploading the background but it's still glitching. Also, it doesn't glitch when first loaded in, only after I've Run the game.


[link]https://imgur.com/a/VB6C5Fv[/link]
#3
Advanced Technical Forum / Wordle in AGS?
Wed 22/03/2023 15:27:35
Hi, I am trying to create Wordle in my game. I've finished most of it thanks to this [link] https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/wordle-in-ags/msg636645648/#msg636645648 [/link] However, if you do not guess the word by the last row, I'd like the game to reset.

Code: ags
// main global script file
#define WORD_LENGTH 5
#define MAX_GUESSES 6
 
// This represents a row in the Wordle grid (one guess)
struct WordleGuess
{
   Button* LetterField[WORD_LENGTH];
   import String ToString();  
};
 
String WordleGuess::ToString()
{
  return String.Format("%s%s%s%s%s", this.LetterField[0].Text, this.LetterField[1].Text, this.LetterField[2].Text, this.LetterField[3].Text, this.LetterField[4].Text); 
}

enum WordleFieldState
{
  eWordleFieldBlank = 0,      // Nothing entered
  eWordleFieldEntry,          // Filled field in current row during editing
  eWordleFieldInvalid,        // Feedback that the word is invalid
  eWordleFieldGray,           // A gray field in a submitted row (letter not in word)
  eWordleFieldYellow,         // A yellow field in a submitted row (letter in word in other position)
  eWordleFieldGreen           // A green field in a submitted row (letter in word in same position)
};

// This is our wordle grid: a set of Wordle rows
WordleGuess WordleGrid[MAX_GUESSES];
 
int currentGuess;
int currentInputLetter;

// This function just links up the buttons of the GUI with our Wordle grid
void SetupWordle()
{
  int control;
  for(int i=0; i<MAX_GUESSES; i++)
  {
    for(int j=0; j<WORD_LENGTH; j++)
    {
      WordleGrid[i].LetterField[j] = gWordle.Controls[control].AsButton;
      control++;
    }
  }
}

       bool checkValid(String guess)
      {
        // TODO: Just a placeholder. Need to add check against dictionary of valid guesses
        return true;
       }
       
  WordleFieldState[] checkGuess(String guessWord, String solutionWord)
{
  if(guessWord.Length != WORD_LENGTH || solutionWord.Length != WORD_LENGTH)
    AbortGame("Invalid Wordle data");
 
  WordleFieldState format[];
  format = new WordleFieldState[WORD_LENGTH];
 
  // Make sure we ignore case:
  guessWord = guessWord.LowerCase();
  solutionWord = solutionWord.LowerCase();
 
  // Color the green fields (and the other fields gray):
  for(int i=0; i<WORD_LENGTH; i++)
  {
    if(guessWord.Chars[i] == solutionWord.Chars[i])
    {
      format[i] = eWordleFieldGreen;
      solutionWord = solutionWord.ReplaceCharAt(i, ' ');  // Remove the letter from the solution so we don't match on it again
    }
    else
      format[i] = eWordleFieldGray;
  }
 
  // Color the yellow fields:
  for(int i=0; i<WORD_LENGTH; i++)
  {
    if(format[i] != eWordleFieldGreen) // Don't process letters that are already matches
    {
      int hitIndex = solutionWord.IndexOf(String.Format("%c",guessWord.Chars[i]));
      if(hitIndex != -1) // if letter in word
      {
        format[i] = eWordleFieldYellow;
        solutionWord = solutionWord.ReplaceCharAt(hitIndex, ' ');
      }
    }
  }
 
  return format;
}

if(gWordle.Visible)
  {
    int j=0;
    
    if(keycode >= eKeyA && keycode <= eKeyZ) // Typed a letter
    {
      if(currentInputLetter<WORD_LENGTH)
      {
        WordleGrid[currentGuess].LetterField[currentInputLetter].Text = String.Format("%c", keycode);
        //WordleGrid[currentGuess].LetterField[currentInputLetter].BackgroundColor = Game.GetColorFromRGB(0, 0, 0);
        currentInputLetter++;
      }
    }
    else if(keycode == eKeyBackspace) // Remove the last letter
    {
      if(currentInputLetter>0)
      {
        currentInputLetter--;
        WordleGrid[currentGuess].LetterField[currentInputLetter].Text = "";        
      }
    }
   else if(keycode == eKeyReturn)
    {
      if(currentInputLetter == WORD_LENGTH) 
      {
        String solution = "GUMMY";
        String guess = WordleGrid[currentGuess].ToString();
        if(checkValid(guess))
        {
          // Update state
          WordleFieldState formatRow[] = checkGuess(guess, solution);
          for(int i=0; i<WORD_LENGTH; i++)
          {
            switch(formatRow[i])
            {
              case eWordleFieldGreen:
                WordleGrid[currentGuess].LetterField[i].TextColor = Game.GetColorFromRGB(0, 128, 0);
                break;
              case eWordleFieldYellow:
                WordleGrid[currentGuess].LetterField[i].TextColor = Game.GetColorFromRGB(128, 128, 0);
                break;
              case eWordleFieldGray:
              default:
                WordleGrid[currentGuess].LetterField[i].TextColor = Game.GetColorFromRGB(200, 200, 200);
                break;
            }
          }
        
        if(guess.UpperCase() == solution.UpperCase())
        {
          SetTimer(1, 30);
          cGoby.LoseInventory(iSnowglobe0);
          cGoby.LoseInventory(iSnowglobe1);
          cGoby.LoseInventory(iSnowglobe2);
          cGoby.LoseInventory(iSnowglobe3);
          cGoby.LoseInventory(iSnowglobe4);
          cGoby.LoseInventory(iSnowglobe5);
          cGoby.AddInventory(iSnowglobes);
          cGoby.AddInventory(iSwimGear);
          aAlert.Play(eAudioPriorityLow);
          
        }
        
          currentGuess++;
          currentInputLetter=0;
          
      
          if(currentGuess >= MAX_GUESSES)
          {
      // THIS IS WHERE I NEED IT TO RESET, I can reset currentGuess to 0 here, but also need to reformat

          }
        }
      }
    }
  }
}

#4
I know this is easy, and I've done it before, but I can't seem to find information on the manuals or forum.

I am trying to animate a character in room_AfterFadeIn(). This should work, but it doesn't.

Code: ags
function room_AfterFadeIn(){
    cObies.Animate(0, 5, eRepeat, eNoBlock);
}


#5
I have a Wordle game in my game. When the player guesses the Wordle correctly, the letters turn green and the GUI panel closes. This happens basically simultaneously, so the user cannot see the letters turn green.

Is there a way to implement a pause or wait?

I tried using Pause and UnPause, Wait, creating an invisible animation, SetTimer/isTimerExpired and even writing my own for loop counter, but all of these did not work. The buttons or the whole screen has a filter of gray on them for the pause or wait functions. The for loop and timers just didn't do anything.

I think the timer will work, but it is only checking once if the timer is expired instead of repeatedly.

SOLUTION: I set the timer in the function, and then in repeatedlyexecute, I was checking if it was completed. 
#6
I would like to make the activeInventory = null when the player clicks on an empty space in the inventory GUI and have the activeInventory switch with what inventory they click on.

I assume in this function, I would have to find if the player activeInventory != null, then check where the cursor is. If in an empty space, activeInventory = null. If the cursor is on an item, then activeInventory = item, and the item gets added to inventory. Something like this:

Code: ags
function gIconbar_onClick(GUI *theGui, MouseButton button){
    if(player.ActiveInventory != null{
         if(InventoryItem.GetAtScreenXY(mouse.x,mouse.y) = null {
          inventory.AddActiveInventory
          player.ActiveInventory = null;
       } else {
       player.ActiveInventory = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
     }
   }
}




There's also this that is helpful, but I'm having a little of trouble interpreting it.
https://www.adventuregamestudio.co.uk/forums/advanced-technical-forum/putting-active-inventory-back-into-inventory-problems-solved/msg636473542/#msg636473542

#7
Hi, I have added a custom GUI to recreate Wordle within my game.


https://imgur.com/a/G4DhgR4


How do I make these buttons transparent/ white with no drop shadow?
I assume it has to do with the button classes, because that is where I changed the textColor, but I'm not sure where to find this documentation.

Thank you <3

[SOLVED]: I just uploaded a custom image for each button of a transparent png!
SMF spam blocked by CleanTalk