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

#1
Hello!

I'm Fanomatic and I'm currently working on an old school 'Lucasarts style' game called "Animal Cruelty". It's a game kind of similar to 'Day Of the Tentacle' where you alter between three different animals who has to join together to escape the castle of the evil Doctor Petson.


Let the maniacal laughter commence!

This is my first game in AGS. It started out when me and a friend participated in a game-jam at Idle Thumbs and came up with the initial idea. He drew the nice looking background for the first room while I focused on code and characters. We didn't come so far back then, but we decided to resume working on the game after the game jam. After some time my friend decided to honorably withdraw from the project and ever since I've worked mostly solo, but with some input and feedback from another friend as well as the AGS forums.



So far I have put together a fully playable PC windows demo of the first room. It features two playable characters, sounds, music, an NPC and many interactions. The game uses the 9-verb system by Abstauber, so there's quite a lot of dialogue for you to find. For the full game I will also include a how-to-play so people who didn't grow up with the 9-verb system can easily get into the game as well :)

If you feel like trying the demo out you can do so here:

https://fanomatic.itch.io/animal-cruelty-demo


Character concepts

The full game will be free and will include two more playable rooms (plus an intro and an outro) as well as one more playable character. I try to keep it somewhat small and manageble.

I will post updates here, but you can also follow my progress on Twitter:
https://twitter.com/munchercow

And on Facebook:
https://www.facebook.com/Animalcrueltygame/

Full game status:
- graphics 33%
- puzzles 33%
- scripting 60%
- music/sound 50%

Current version:
Demo 1.2

Latest Changes:
* Changed character talk positions (Characters now walk to specific position when talking to NPC and Fuzzy)
* Player characters now faces each other when speaking!
* Minor bugfixes and tweaks
#2
Hello there! I have an issue with my 9-verb GUI that I hope somebody can help me with.

See, I have multiple characters the player can switch between (DoTT-style) and in order to make it easier to see what PC is currently active, I want to change the color of the interface reflecting who is active.

I tried creating a function for this in globalscript that just changes the sprites of the verbs to a sprite of another color when you switch character, like so:

Code: ags
function change_interfacecolor (int interfaceColor)
{
  if (interfaceColor == 0)
  {
    Action0.NormalGraphic = 1602;
    Action0.MouseOverGraphic = 1601;
  }
  else if (interfaceColor == 1)
  {
    Action0.NormalGraphic = 125;
    Action0.MouseOverGraphic = 138;
  }
}


However, for some reason the sprite only momentarily changes to the new sprite when I trigger the function (for a frame or so) and then quickly changes back to the default one. I suspect that it might have something to do with this function in the guiscript:

Code: ags
function InitGuiLanguage()
{
  AdjustLanguage();
  int i;
  GUIControl*gc;
  Button*b;
  
  while (i < A_COUNT_) 
  {
    gc = gMaingui.Controls[action_button[i]];
    b =  gc.AsButton;
    b.NormalGraphic=action_button_normal[i];
    i++;
  }
}


Since it's a while-loop it might be that it's continously changing the image back to the default one. Not sure on how to go about this. If anybody have any ideas I would be glad to hear them out. Thanks :)
#3
Hello there dear forum users, I have a problem related to regions that I hope you can help me with. I've tried for days, but I can't seem to figure this one out. I'm using the 9-verb add-on and this could potentially be related to how that is set up, but I'm a bit new to this so if somebody have any ideas I'd be glad to hear them.

The game I'm working on features three playable characters that you can switch between similar to how Day of the tentacle works. The first room of the game is a jail where the room is divided into different sections of which some can only be reached by certain characters, so each player character is somewhat restricted in where they can go. The region setup looks a bit like this:



Since I don't want the player characters to be able to give items to other characters that are not in the same ”section” I've divided the room up into regions and walkable areas and are doing a check every time I'm giving something from one player character to another player character to determine if they should be allowed to do that.

The way I've set this up currently is that every time the player clicks inside a region (inside the play area) the region is saved to a global variable (clickedRegion) like this:

Code: ags
function on_mouse_click(MouseButton button)
{
  
  //If the mouse cursor is above the verb-GUI
  if (mouse.y <= 153)
  {
    clickedRegion = Region.GetAtRoomXY(mouse.x + GetViewportX(), mouse.y + GetViewportY());
    lblDebug3.Text = String.Format("Clicked region: %d", clickedRegion.ID);
  }
  
}


Then I have a ”check area” function that compares the region the player just clicked to the region the active player is in:

Code: ags
// Check if what the player clicks are in the same region as the player.
function checkArea()
{
  Region*playerRegion = Region.GetAtRoomXY(player.x, player.y); //get current player region
  
    //If the player clicks the same region the player is in it can always interact.
    if (clickedRegion.ID == playerRegion.ID)
    {
      canWalkToObject = true;
    }
    
    //If player clicks on region 1
    if (clickedRegion == region[1])
    {
      if (playerRegion == region[2])
        {
            sayCantReach();
            canWalkToObject = false;
        }
      else if (playerRegion == region[3])
        {
          if (cellDoorIsOpen == false)
          {
            sayCantReach();
            canWalkToObject = false;
          }
          else
          {
            canWalkToObject = true;
          }
        }
      else if (playerRegion == region[4])
        {
          sayCantReach();
          canWalkToObject = false;
        }
      
    }
    //If player clicks on region 2
    else if (clickedRegion == region[2])
    {
      if (playerRegion == region[1])
        {
            sayCantReach();
            canWalkToObject = false;
        }
      else if (playerRegion == region[3])
        {
          if (cellDoor2IsOpen == false)
            {
              sayCantReach();
              canWalkToObject = false;
            }
          else
            {
              canWalkToObject = true;
            }
        }
      else if (playerRegion == region[4])
      {
        sayCantReach();
        canWalkToObject = false;
      }
    }
    
    //If player clicks on region 3
    else if (clickedRegion == region[3])
    {
      if (playerRegion == region[1])
        {
          if (cellDoorIsOpen == false)
          {
            sayCantReach();
            canWalkToObject = false;
          }
          else
          {
            canWalkToObject = true;
          }
        }
      else if (playerRegion == region[2])
        {
          if (cellDoor2IsOpen == false)
          {
            sayCantReach();
            canWalkToObject = false;
          }
          else
          {
            canWalkToObject = true;
          }
        }
      else if (playerRegion == region[4])
      {
        sayCantReach();
        canWalkToObject = false;
      }
    }
    //If player clicks on region 4
    else if (clickedRegion == region[4])
    {
      if (playerRegion == region[1])
        {
        sayCantReach();
        canWalkToObject = false;
        }
      else if (playerRegion == region[2])
        {
        sayCantReach();
        canWalkToObject = false;
        }
      else if (playerRegion == region[3])
      {
        sayCantReach();
        canWalkToObject = false;
      }      

    }
  }


And lastly, this is an example of code from the "giveto" part of an item. Basically it sees if the player can reach the region and then either gives the item or says that it can't because the character is too far away:

Code: ags
  // GIVE TO (characters only)
  else if(UsedAction(eGA_GiveTo))
  {
      if (player.ActiveInventory == iChili)
      {
        checkArea();
        if (canWalkToObject == true)
        {
            if (player == cFive)
            {
              cFuzzy.Say("Oh, Fuzzy like!");
              cFive.LoseInventory(iChili);
              cFuzzy.AddInventory(iChili);
            }
            else
            {
              
            }
        }
        else
        {
          sayCantReachPlayer();
        }
      }
  } 


The mouse region variable normally works and registers correctly, but when I press the ”give” verb and try to hand an inventory item to a character it doesn't for some reason. It's still set to the region I clicked before I clicked the ”give” verb, so the check doesn't work...

Here's some images that explains the scenario:



I guess this has something to do with how 9-verbs works. Maybe I need to change something in the global "give" function? Unfortunately I don't know where to look.  ???
#4
Hello there everyone, I'm a beginner at AGS and I've run into a problem related to regions.

I've tried but I can't seem to figure it out on my own, so I thought I'd check with the forum. I haven't found another instance of this issue, so I don't 'think' anyone has asked it before, but if so I apologize :)

It bears mentioning that I'm using the 9-verb extension.

So, I've made a room that is a prison. The room is divided by wall/bars the player can't pass through until they open locked doors that allows them to, so the player shouldn't be able to perform actions that affects objects in the part of the room they aren't in, provided they haven't opened the door to let them through.

The region setup looks roughly like this.



Currently I'm doing a check every time I click on something, like this:

(Global script)
Code: ags
// Check if what the player clicks are in the same region as the player.
function checkArea()
{
  Region*playerRegion = Region.GetAtRoomXY(player.x, player.y); //get current player region
  Region*clickedRegion = Region.GetAtRoomXY(mouse.x, mouse.y); //get current mouse region
  Wait(10);

  //debug dialog
  player.Say("Player region is %d.", Region.GetAtRoomXY(player.x, player.y));
  player.Say("Mouse region is %d.", clickedRegion);
  
    //If the player clicks the same region the player is in it can always interact.
    if (clickedRegion == playerRegion)
    {
      canWalkToObject = true;
    }
    
    //If player clicks on region 1
    if (clickedRegion == region[1])
    {
      if (playerRegion == region[2])
        {
            sayCantReach();
            canWalkToObject = false;
        }
      else if (playerRegion == region[3])
        {
          if (cellDoorIsOpen == false)
          {
            sayCantReach();
            canWalkToObject = false;
          }
          else
          {
            canWalkToObject = true;
          }
        }
      else if (playerRegion == region[4])
        {
          sayCantReach();
          canWalkToObject = false;
        }
      
    }
    //If player clicks on region 2
    else if (clickedRegion == region[2])
    {
      if (playerRegion == region[1])
        {
            sayCantReach();
            canWalkToObject = false;
        }
      else if (playerRegion == region[3])
        {
          if (cellDoor2IsOpen == false)
            {
              sayCantReach();
              canWalkToObject = false;
            }
          else
            {
              canWalkToObject = true;
            }
        }
      else if (playerRegion == region[4])
      {
        sayCantReach();
        canWalkToObject = false;
      }
    }
    
    //If player clicks on region 3
    else if (clickedRegion == region[3])
    {
      if (playerRegion == region[1])
        {
          if (cellDoorIsOpen == false)
          {
            sayCantReach();
            canWalkToObject = false;
          }
          else
          {
            canWalkToObject = true;
          }
        }
      else if (playerRegion == region[2])
        {
          if (cellDoor2IsOpen == false)
          {
            sayCantReach();
            canWalkToObject = false;
          }
          else
          {
            canWalkToObject = true;
          }
        }
      else if (playerRegion == region[4])
      {
        sayCantReach();
        canWalkToObject = false;
      }
    }
    if (clickedRegion == region[4])
    {

    }
  }


Then in the room script I do this (verb check area example)

Code: ags
  // Push
  else if(UsedAction(eGA_Push)) 
  {
    checkArea();
    if (canWalkToObject == false)
    {
      return;
    }
    else
    {
      if (player == cFive)
      {
        player.Say("No, I like the Feng Shui here.");
      }
      else if (player == cFuzzy)
      {
        player.Say("Fuzzy can't move it!");
      }
      else
      {
        player.Say("");
      }
    }
  }


The problem is that when I use ”push” on the chili as in the example I get:

Player region is 0.
Mouse region is 0.

And it doesn't matter what I click on, I still get 0.

I'm not very experienced at programming yet, so if you have any ideas on how to do this better I'm thanksful for tips. :)

Thanks beforehand!
SMF spam blocked by CleanTalk