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

#1
Thank you Khris... I am an idiot!
#2
I've tried again and it works fine if I insert integers in params: myDynSprite.Crop(80, 75, 80, 50); //this works
If I write player.x and .y,likewise as cRoger or character as array it ends up returning a messed up draw.

I wonder if this is fixable, either I'll have to find another somethig else.

[EDIT] Maybe this method cannot read character position because the coordinates it takes has nothing to do with player's coordinates.
I ensured to get the right x and y before cropping.
I had already tried storing player coordinates in two integers before calling Crop but neither it worked.

#3
Thanks Khris, I have tried it but the result of the sprite was weird;

If you say it works I will try it again, maybe I made some errors!




#4
I would like to ask one more thing...

I'd like to fill the slot buttons image with a custom frame.

I have tried a lot with dynamic sprites and drawing surfaces functions,
but I'm not able to create an image containing a little part of the background(around player position),
including player and characters.


I've found an interesting function made by Khris but can't find the topic anymore.
Anyway, it wasn't perfectly suitable with my case and I've modified it do some tries.

I'm not able to merge background frame and player current frame and put them in slot graphic.
I was able to create them separetely and I wonder if it's possible to merge two dynamic sprites somehow.

Also, when I load game and open slots menu, no image appears.

Can you please help me?

Thanks,
Giacomo



#5
Hi people.

I created some custom functions that can be used to open and edit the selected slot in a multiple slots GUI.
Slots are stored as buttons.
Functions are working fine so far and I hope they could be helpful.

First of all I declared two global variables:
Spoiler
Code: ags
Button* selectedButton;
int selectedSlot;
[close]

In menu GUI a button open the slot menu.
Spoiler
Code: ags
function btnEditGame_OnClick(GUIControl *control, MouseButton button)
{
  _isSlotAvailable(); //check if there is any saved slot
  if(firstMenu && !slotAvailable) player.SayAt(160, 100, 60, "You can't do anything now!");  
  
  else 
  {
    gOpenSlot.Visible = true; //my way to open slot GUI
    gMenu.Clickable = false;
  }
}
[close]

Selecting any slot triggers the same function _openSlots(int mySelectedSlot, Button* mySelectedButton):
for example:
Spoiler
Code: ags
function btnEditSlot1_OnClick(GUIControl *control, MouseButton button)
{
  if(firstMenu && Game.GetSaveSlotDescription(1) == null) player.SayAt(160, 100, 60, "Empty slot!");
//if game has not started yet and slot is empty you can't open it 
  else _openSlots(1, btnEditSlot1);
}
[close]

Function to open selected slot:
Spoiler
Code: ags

function _openSlots(int mySelectedSlot, Button* mySelectedButton)
{
  selectedButton = mySelectedButton;
  selectedSlot = mySelectedSlot;

  gEditGame.X = mySelectedButton.X; //whatever you want
  gEditGame.Y = mySelectedButton.Y+102; //whatever you want

  if(Game.GetSaveSlotDescription(selectedSlot) != null) 
  {
    btnEditGameLoad.Visible = true;
    btnEditGameDelete.Visible = true;
  }
  
  if(!firstMenu) btnEditGameSave.Visible = true;
    
  gEditGame.Visible = true;
  gEditGame.Clickable = true;
  gOpenSlot.Clickable = false;
}
[close]

Function to edit selected slot. On header I declared an enum:
Spoiler
Code: ags
enum MyEventType {
  eLoad,
  eSave,
  eDelete, 
};

function _editSelectedSlot(  MyEventType myEvent)
{
  if(myEvent == eLoad)  RestoreGameSlot(selectedSlot);
  else if(myEvent == eSave)
  {
    SaveGameSlot(selectedSlot, dateTimeFormat);
    _slotBackground(); //function to get image for saved game, for which I'll soon ask a question!
  }
  else if(myEvent == eDelete) DeleteSaveSlot(selectedSlot);
  
  selectedSlot = 0;
  gMenu.Clickable = true;
  gOpenSlot.Clickable = true;
  btnEditGameDelete.Visible = false;
  btnEditGameLoad.Visible = false;
  btnEditGameSave.Visible = false;
} 
[close]

Function to check if any slot is available:
Spoiler
Code: ags
function _isSlotAvailable()
{
  slotAvailable = false;
  for (int k = 1;  k<4;  k++) //I use slots from 1 to 3
    if (Game.GetSaveSlotDescription(k) != null) slotAvailable = true;
}
[close]
#6
Thanks Khris!
Ok, maybe it takes less...haha

Thanks for the tip, I have tried something similar, but I'm still missing a lot of info! I will try it soon!

#7
Thank you, Khris.

I wanted 3 slot only because the game is a kind of prologue and it's quite short.
There's no multiple end but player's game is evaluated in the end, so I thought he might wish to try some quests again and so doesn't have to start the game from beginning.

Anyway, I have no clear idea about save/load functions yet and I would be happy to semplify the script; this is the only point for which I don't see a clear solution.

Eventually, using a single slot is a good idea. Indeed, playing the game following a walktrough would take less than an hour to complete it so maybe multiple slots are useless. Autosave is also a good idea, but if the player wants to obtain a better evalutation when game ends he will have to restart it from the beginning...

I will rephrase my idea and make it simpler.
Should post be deleted? It ended up being quite useless...

Cheers,
Giacomo
#8
Hi, people of community.
I'd like to ask you help to create a custom edit game function.

I created a button on gui menu called "edit game".

To save/load/delete a slot push the button "edit game".

If there's no saved slot and game has not began yet, display the message: "You can't edit any game now!"

Else 3 rectangles appear(available slots).

Each rectangle, when clicked, let show max 3 buttons: save, load, delete

These 3 buttons appear only when needed, under the selected slot rectangle;
if game has not began and there are saved slot, you can only load or delete them for example,
as you can't load or delete an empty slot. If you started playing you can only save on empty rectangles.

I thought to build a function for which the position of 3 buttons depends from selected slot position,as it should appear right down the rectangle once it's clicked.

Each action depends from selected rectangle, for this I thought to insert some booleans to determine which rectangle was selected before any action is triggered; once button is pressed, action is triggered and let you save/load/delete game on selected slot.
When done, reset booleans.

Thank you,
Giacomo
#9
Sure, I wanted to write "you" as you all.

This to say that the editor is cool because it's "easy" to use for
newbies like me, but things get more interesting when you dive deeper
into script...and you all help me see better into it..

PS:I'm a fan of adventure games since I was 5 yo and MI left me the most visible mark ever in my life.
I'm having a lot of fun making a stupid game and you can't tell how much this community made my life funnier!
#10
That's great, Khris. I am gonna work on it soon.
I hope to issue my first game in he early summer!

Anyway, the many times I ask or look for answers I find out
you give solutions that seem to be simpler and more efficient
than many function in AGS editor...It's getting more interesting
and I'm enjoying scripting the game always more, thanks again!
#12
Thank you, Khris, point 1 is accomplished!

I just had to empty button text because it seems to be in front of the drawn sprite, but it's fine so!
I guess there's no problem for transaltion till I'm creating new strings..

I'm still having a hard time in achieving point 2 but it's because my skills are still too low(and maybe my IQ too).

I have followed eriOo's instructions and made a new script in which i pasted all the lines he wrote. I'm trying to put the
function inside there and do some useful imports in global but nothing good is happening. Anyway, I'm not sure about how
key press function works, but since I am using mouse only maybe I should modify on mouse click func and insert the iteration here
Code: ags
function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{
  int d_x = info.X;
  int d_y = info.Y;
  if(button == eMouseLeft) {
    if(IsMouveOverScrollUp(d_x, d_y)) 
    {
      ScrollUp();
      info.Update();
    }
    
    if(IsMouseOverScrollDown(d_x, d_y)) 
    {
      ScrollDown(info.DialogToRender.OptionCount);
      info.Update();
    }
    
    if (info.ActiveOptionID > 0) {
      info.RunActiveOption();
    }
  }
}

Thanks eriOo, this module is very helpful for my learning!
#13
Khris, let me ask you just one more thing.

I have an issue about character walk function.

I'd like him to walk automatically to hotspots, chars and objcets, but I don't want
to set eBlock in params, despite I'd like to block following functions and let them run
only once he reached the target.

I saw some options about this but my game is not working as I'd like, and I don't like to always use eBlock
to prevent next functions to run. About this matter and eBlock param I'd have a couple of more questions to ask...
I would open a post to make all these specific questions about it, but if you tell me that there are older posts that
can help me, I will take a deeper look in the forum!

Sorry if I'm fullfilling you with these stupid questions, but my first game is almost done and I spent several days
looking for an answer to these problems!
#14
Thank you Khris!

I'm using BASS template.

About the baloon animation, I still have to try to assign it an idle animation and set the shortest timer possible
between one animation and the other; I wonder if doing so reduce the waiting to zero, letting the animation run
continually... If this works, I could delete the baloon object and merge its sprite to the character sprite, setting idle
to -1 everytime he starts walking and resetting it to right view once he stops.

I'm gonna try your code later in the day!

Thank you again,
Giacomo
#15
Hello everybody.

I'd like to ask you a couple of questions about labels and arrows buttons.

I searched a lot in the forum and in the manual to find out a solution but I'm still
having my first experience in scripting and I need your help before I compromise my code.

I saw two interesting posts in which eri0o and Khris talked about the matter.

https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/changing-number-dialog-options-in-general-settings-doesn-t-make-any-change/msg636653127/#msg636653127

https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/about-dialog-options-and-templates/msg636637797/#msg636637797

Thanks for these answer, they helped me a lot despite I'm not able to resolve these problems yet!

What'd I like to do is the following:

1)once you open Menu GUI, passing cursor over buttons should highlight their text

To accomplish this I thought to create an empty sprite, assign this sprite to every MouseOverImage button functions in the GUI, then create a Dynamic Sprite and Surface from the button graphic and text.
I wonder if I can use button text and background together to create a Dynamic Sprite.

2)I need an upload function to display correctly the dialogs GUI, as everytime I switch off an option state, a blank space
remains in the dialog windows, as if the option was still active; same goes for arrows, as they should appear and disappear
only when needed. This works fine for inventory window, but I'm not able to export the function over dialogs.


I also have a question about characters animation on standing frame, which is not in the title. I read about similar problems
but I'm not able to create a fine function. Please let me know if I can expand the post and put the question here, or should I
put the issue in a new post?

A character walks randomly in a certain area. He stops and after a little time he starts walking again.
I created a function with two timer calling each other everytime one of them is expired.
Character is carrying a ballon, so when he's standing the baloon should float.
I tried to split the animation, making of the baloon an object following character, but I don't find this is a good solution.
The function works fine except when the character stop moving, as he changes view but no animation starts.

Please let me know if I can put some code regarding this matter in this post!

Thank you all in advance,
Giacomo
#16
AGS Games in Production / Re: Future Flashback
Wed 07/07/2021 18:40:09
I'm sorry Darth Mandarb, the next time I will send a PM.
#17
AGS Games in Production / Re: Future Flashback
Tue 06/07/2021 18:35:12
Man, this is so cool, I love your style!

Let me also thank you for your activity in the forum,
it helped me a lot.
#18
Quote from: Danvzare on Thu 01/07/2021 11:44:33
Welcome to the forums Giacomo. I look forward to seeing what you make.
Good luck with becoming a programming. It sounds like you're making great headway on that, so I'm happy for you.

Also a little bit of advice. If you want to get better at pixel art, but you're not very good at art in general. I highly recommend practicing drawing with a pencil and paper. It might not seem like it, but traditional art skills carry over to all types of art, including pixel art. My pixel art came along in leaps and bounds when I started learning myself how to draw. If you already have a reasonable drawing ability though, then you can ignore what I just said.  :-D

Thank you so much, Danzvare, I'm so happy to take part in the community!

I know what you mean and indeed I have always drawn with my own hands before I knew aseprite.
I am not so bad in drawing, neither so good, but I had no sense of perspective.

On last months I indeed started studying perspective illustration in order to create my own graphic for games, as color theory but, most of all,
I obsvered a lot. I observe landscapes, tiny figures like insects, leaves, surfaces details..shadow projections, the difference between same colors at
different distances, like th mountains or hills etc etc etc. I think I got what you mean!

Despite I'm still a newbie even in pixel art, I'd anyway like to show you something and listen to your guys critics. I will do it
in the right thread of course!

Thank you again, see you around the forum!

Welcome Ruslan and all new users!

#19
Hello everyone!

My name is Giacomo, I am 31 yo and I live in Italy.
I am a super fan of LucasArts and Sierra games, and graphic adventure is
the genre of game I prefer.

Thanks to a game I played, almost one year ago, which was made with AGS,
I found about the software and community, and, during the boring, infinite days of lockdown,
I decided to give a try myself and took my first steps into scripting and coding.

Before I decided to intoruce myself, I wanted to learn more and made a very little donation
to thank you for your great job, AGS is awesome and I want to learn more in order to produce my
own games.

I will soon begin a Java course certified by Oracle and the reason is
that I am probably going to lose my job; that's why I decided that I would become a programmer!

I'd wish to thank so many users who helped me understanding AGS scripts but I'd not know where to start and
neither I'd like to miss someone, so please let me give you all a special thanks because thanks to this community
I made up my mind about what kind of job I am looking for!

Actually I "work" (on payroll subsidies) as light designer and produce 3D projects for calculating light emission in the enviroment; 
for my (still few) knowledges about light, I have a little dream and wish to create a module for
implementing shadow projecting (I saw Khris video on YT and, dude, that was really cool!).

I play music since I was 8 yo and I have a pretty good knowledge of it.
I can play piano, guitar and bass, drums, harps, accordion and xylophone.
I can compose and write music, but be aware that I am not a music master!
I can use GuitarPro(actually I use TuxGuitar on Linux), Pro Tools and Garage Band.
I can compose and record music with these softwares, but I am not very good at mixing instruments,
preferring writing and recording.
I offer my free help for music composing.

I have a bachelor's degree in history and I particularly studied 17th century's piracy.
Why did I study piracy? You can answer yourself! Thank you a lot, Gilbert and Co!
Maybe I can give my little help in story design concerning modern ages' piracy.

My italian is pretty good as I really like my language, so surely I can help translating english into italian.

I'm into pixel art since few months and I learned pretty well the use of aseprite for my drawing productions,
but I am not good enough to be called pixel artist yet.
With aseprite, I am also learning sprite animation and background design.

Me and my friends are trying to create our own old-style game with AGS; one of them can script better than me.
Soon I will ask for your help about somethings I need to understand for scripting.

I am very happy to meet you all!
Please, test my capacities!

Thank you,
Giacomo

SMF spam blocked by CleanTalk