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 - fratello Manu

#41
Ok, I found the answer.
#43
Hi everyone! I think this is a quite simple thing to do but I didn't find any answer.

I just want to make something happen (e.g.: playing a cutscene) when player "interacts" with an item which is already in inventory.

So I implemented the item's "interact inventory item" event:

Code: ags
function iMyItem_Interact()
{

    // do something;

}


...but instead of processing this code (I put a breakpoint and I see that code is not processed), it seems that the standard Use inventory mode is activated. Which would be correct, safe that for this item I want my code to be executed.

I'm missing something basic for sure... but what?

thanks!
bye
Manu
#44
Hi everyone!
I have a GUI with a textbox. I'd like the user to write something, and then to get a confirmation pressing Return (e.g. make something happen)
How could I do it?

I put in global script:

Code: ags
// called when a key is pressed
function on_key_press(eKeyCode keycode)
{
if (keycode == eKeyReturn) 
  {
    // Text box input accept:
    if (gGuiText.Visible == true)
    {
      // Hide GUI 
      gGuiText.Visible = false;
      
      //..........DoSomethingElse();
    }
  }
}


I think the text box which is in GUI has the focus, so it prevents the Return key to be processed by the on_key_press function.

Any idea?

Thanks!
manu
#45
Quote from: Darth Mandarb on Sat 05/12/2020 16:46:40
Is this being made with AGS?

Also; please review the forum rules and update your post accordingly (two in game screenshots and some details about the game).

Good luck with the production!

Sorry about that! I'll edit the post as soon as possible. Yes, made with AGS, of course!
Bye!
#46
Hi everyone! Just a little preview of a retro-style game I'm developing
I know it will take me quite a lot of time, but at least the "core engine" is ready. Now I just need to go on with the plot!



Since I'm a musician and software developer, I decided to look for a way to quiclky realize the graphics. So I start using some open source resources from OpenGameArt.org, making backgrounds with tile art. All the characters are created with a online character generator by sanderfrenken. Most of the assets are part of the LPC collection (Liberated Pixel Cup) on OpenGameArt.org
Screen resolution is 800 x 450 and I will release the game for Windows and Linux (...and possibly Android, with slighly different viewport and UI)



The adventure is about a dead pirate who comes back to life at present days. He wants to get back his treasure, but the place he was living in is now totally different!
I decided to add a bit of action, not usual in adventure games, so I developed also a "battle system".



Music from OpenGameArt.org:
Battle theme A by cynicmusic
Heroic Demise by Matthew Pablo


Have a nice day!  8-)
#47
Quote from: eri0o on Sat 28/11/2020 13:18:22
If you do need to instantiate something, you can have a bunch of pre-created dummy characters that you pickup from a room that's not part of your game, moved from there to the current room, do what you must, and put them back in that room once business are taken care. In this way you are not creating them dynamically but you still get to do similar things.

Thanks!! I did like that.
#48
Hi everyone!

I'm quite sure this is a really naive question but I couldn't find any similar previous thread.

I want to define a temporary object (or even a DynamicSprite as well) locally in a function, just to display a one-shot animation on screen (e.g. explosion of something, not suitable as a permanent object).

I created the explosion View, then I made a function as:

Code: ags

function ShowExplosion(int x, int y)
{
    Object* objExplosion;
    objExplosion = new Object;

   objExplosion.X = x;
   objExplosion.Y = y;
   
   objExplosion.SetView(......proper view...);
   objExplosion.Animate(...proper animation....);
}


but I get a compiler error: built-in tipe "object" cannot be instantiated directly.

Then I tried to declare the objExplosion object globally instead of inside my function to see if something changes, according to instructions for the New statement on manual.... Nope.

Obviously, in C# I'd just write:

Code: ags

Object objExplosion = new Object();


So, I don't understand what I'm doing wrong.

Thanks!
#50
Hello everyone!

is there some way I didn't find to move / reorganize the sprites subfolders without deleting and re-creating them?
maybe with some module or plugin I'm missing?

thanks!

manu
#51
Hello everyone!

Since I found this thread, I try to write here instead of starting a new one.

I have the same case, I need to instance multiple "entities". Let's say I have a bee and I want a bunch of bees flying around.

Is it possible using objects and moving them through multiple instances, instead of characters?

bye!
manu
#52
Hi everyone!

I searched the forum and the manual too, but I couldn't find the answer: is it possible to force the default load and save dialogs to the center of the screen?
And maybe to resize them?

My game has a 800 x 450 resolution and when the dialogs show up, they are placed at the middle-bottom of the screen, so they are a bit cropped. Especially the save dialog.
Is it possible to place them at center of the screen?

thanks!
bye
manu
#53
Quote from: eri0o on Wed 25/11/2020 11:25:59
You can also convert the coordinates (if you are using the newest versions of AGS) using

Code: ags
Point* room_point = Screen.ScreenToRoomPoint(mouse.x, mouse.y);
player.FaceLocation(room_point.x, room_point.y);


I actually haven't understood quite yet what's going on but other idea I would have is adding some offset in the y position to see if this fix FaceLocation. You can also write your own logic using FaceDirection. But I have trouble understanding text descriptions because I am a more visual person  :P .

Great!  8-) It works!!
Really thank you
#54
Quote from: Crimson Wizard on Tue 24/11/2020 23:49:47

Regarding why it may face wrong direction, for instance FaceLocation requires room coordinates, so proper use would be:
Code: ags

player.FaceLocation(mouse.x + Game.Camera.X,  mouse.y + Game.Camera.Y, eBlock);



I'll try! Thanks!
#55
Quote from: eri0o on Tue 24/11/2020 23:47:17
Does this room scrolls? (Is it bigger than the game screen?) I ask because FaceLocation uses Room coordinates and not screen coordinates.

YES! it is!
#56
Guys, first of all thanks anyone for helping. Unfortunately, I didn't fix it yet...

Adding a Wait(1) or even more, I didn't solve, it was exactly the same.

I also already tried like this, before posting:

Code: ags

player.LockView(10);
player.FaceLocation(mouse.x,  mouse.y, eBlock);
player.Animate(player.Loop, 1, eOnce);
player.UnlockView();


Behaviour is different but still wrong (with eBlock): player always turns UP before animating...

So, with eNoBlock option it seems slightly better (at least MC faces the proper direction). But in both cases, the FaceLocation statement seems not to work

any idea?

Thanks!

Bye! Manu
#57
Hi everyone!

My I'd like my MC to to play an animation in the proper direction (e.g. slash with a sword, give a punch, atishoo.... whatever!) when I press the right mouse button, while using a custom mouse mode. Left button will be for walking around.
So I defined my custom mode (let's say: Fight mode)  and I created 2 views: the first of character walking (with the 8 loops for the standard directions as usual), and the second with 8 animations for the Fight mode as well.
For some reason I don't understand, I can't get the character to face the proper direction, before animating, when pressing just the right mouse button.

E.G.

1. LB click, Player walks left
2. RB click, with cursor still at left side of character: Left fight animation is played (correct)
3. I move the mouse cursor at the right side of character and I press RB: still left fight animation is played (wrong!)
4. I move the character right (with LB) and then I press RB: right fight animation is played (correct)

I tried in several ways, with Player.Loop to catch its current direction, or with .Direction as well, but I can't fix it.

Here is an example on one of my attempts.
View 6 is for walking, and 10 for fighting:

Code: ags

function on_mouse_click(MouseButton button)
{
 
  if (IsGamePaused())
  {
    return;
  }

  if (button == eMouseLeft)
  {
    // if in fight mode, left click just has to move player:
    if (mouse.Mode == eModeUseWeapon)
    {
      Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
    }
    else
    {
      Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);
    }
  }

  else if (button == eMouseRight)
  {

    if (mouse.Mode != eModeUseWeapon)
    {
      SetWalkToMode();  // a custom function which sets walk-to mode
    }
    else

    // In weapon-on mode, right-click = attack
    {

      MyPlayer.LockView(10, eStopMoving);
      MyPlayer.FaceLocation(mouse.x,  mouse.y, eNoBlock);
      int currentDirection = MyPlayer.Loop;
      
      MyPlayer.Animate(currentDirection, 1, eOnce, eBlock, eForwards);
      MyPlayer.UnlockView(eStopMoving);

    }
  }
}




For some reason, it seems that  MyPlayer.FaceLocation(mouse.x,  mouse.y, eNoBlock);  is not working (while in other contexts in game, of course it works).

Any suggestion?

thanks!

Manu
#58
Quote from: eri0o on Wed 18/11/2020 09:40:47

If you are going this route, on the indexed palette, the FIRST color will be the 0 (ERASER) in walkable area, the second color in the indexed palette will be the 1 (Walkable 1, the blue one), the third will be the 2 (Walkable area 2, the green one), and so on.

If you can, use Aseprite since it's easier to deal with pallettes in it. People also say good things of Graphics Gale.

Hey, thanks a lot! Thanks everyone for helping.

Actually, I already set up *almost* everything as you guys wrote. But, I didn't realize that none of the image editors I was using, was showing me the real palette with the colors in the proper index. (I don't know why, I'm more experienced in programming than drawing...)

So, using GraphicsGale i finally understood which color I had to use!

#59
AGS Games in Production / Re: Kola Queen
Thu 19/11/2020 07:23:54
I'm looking forward to get a demo!  8-)
#60
Hi everyone,

since I'm wasting a lot of  time on this, I try asking here.
I tried every way but I couldn't figure out how to import a working walk-behind mask. Without this mask I can't define the walk-behind areas, which would be too complicated to be hand-painted of AGS room editor.

So, from my external map editor I create a pic with just the areas which has to become a walk-behind: I just keep visible the layer containing these areas and save the pic. The result is a pic with too many colors.



According to AGS message, I have to upload a .bpm 8 bit and 256 colors image, and the first 16 colors will be used to define the walk-behind areas.

So with GIMP or PINTA as well I try to obtain a 2 colors image: a background color and a color for shapes.
I de-saturate the image and then I increase brightness and contrast to maximum and I get an image with white shapes and black backround.
Then, I didn't catch how to properly save as a 256 color image (I tried to select indexed-mode with maximum of 255 or 256 colors as well, but AGS keeps telling me it's not the proper format).

So, I load the image in MSPaint and save as 256 colors. Before saving I replace the white shape color with a color between the first 16 in palette, e.g.



Now  AGS seems to be happy with my image format, but... nothing happens.
The color I chose seems not to feed any walk-behind area.

I tried every possible way but I can't get it to work.

Any suggestion?

Thanks!
bye

Manu

SMF spam blocked by CleanTalk