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

#1
Hello,
I' d like to ask if there is a way to convert left and right clicks of the mouse into single tap / double fast taps, to use the BASS module on phones.

I took a look in the forum and I found a solution that I also had thought about, that is to use a GUI on the clicked hotspot, object or character(with AnyClick), and then choose one of the two function of the module, look / interact, by the GUI. But I don't like this solution so much.

Searching on the internet I read about this file called "AndroidManifest.xml" where it should be possible to set the keyboard or mouse input for android, but I didn't understand so much about it; also, the android version of the game is full of folders and has more files with that name so I don't know which is the right one.

I think that a double tap can be easy and intuitive for a graphic adventure that uses the BASS module and I wonder if there will ever be the possibility, some day, that this option can be enabled in "Touch to mouse emulation" in Default Setup page.

Is it possible to configure the app inputs in the way I described? If yes, what do I have to do?

Thank you,
Giacomo
#2
Hello, everybody I have a problem that I cannot solve.
It's about a dialogues series in which you have to give three right answers, otherwise you will have restart from the beginning.

The first dialogue opens some topics of the second dialogue, depending from the answer given. Then, the second dialogue opens some topics in a third dialogue, always depending from the answer. Because the topics were many, the third dialogue has been split in two dialogues.
If you give the wrong answer in the third dialogue, the options of the last two dialogues are set off and you restart from the first dialogue.

Before I had another problem: if I continued to say the wrong answer, restarting the dialogue for about 15 times, the game crashed displaying a message concerning a recursive call.
I solved this problem by forcing the player to give the solution after a certain number of attempts(and he gets a negative point!), but I felt there was still something to fix.

The new problem shows up in the web version of the game only. If I say the right answer at the first attempt, the problem won't show up. But if I miss the answer just once and then restart the dialogue, a javascript exception gets thrown with these error messages:

Aborted(RuntimeError: unreachable executed)
Uncaught RuntimeError: Aborted(RuntimeError: unreachable executed). Build with -sASSERTIONS for more info.

I'll try to reduce the script removing the recurring parts.

FIRST DIALOGUE(8 AVAILABLE ANSWERS):
Spoiler
Code: ags
// Dialog script file
@S  // Dialog startup entry point

  if(ominoTentativi == 12) //force to skip to final dialogue
  {
omino: Dad, I'm tired!
cUomoAppeso: Me too!
omino: You are too weak...
  Wait(20);
omino: I want sugar candies...
cUomoAppeso: Finally!
  dOminoPapaFinale.Start();
  }
  
  else if(ominoTentativi > 0) //after the first attempt, say the following
  {
omino: Wrong answer!
omino: Again, what am I thinking about?
  }
  
return

@1 //wrong answer, like options 2, 6
  _ominoDialoghi(1, 0); //see functions below
  if(ominoGiocattoli) //global var bool, a kind of "if option has been choosen"
omino: Maybe no...

  else
omino: Maybe.
    dOminoPapa2.Start();
stop

(...)

@3 //right answer
  _ominoDialoghi(7, 0);
omino: Maybe.
  dOminoPapa2.Start();
stop

@4 //options 4, 5, 7, 8 will return to current dialogue
  dOminoPapa1.SetOptionState(4, eOptionOffForever);
return

(...)
[close]

SECOND DIALOGUE(3 AVAILABLE ANSWERS):
Spoiler
Code: ags
// Dialog script file
@S  // Dialog startup entry point
return

@1
  if(ominoGiocattoli) //same global var bool, used for the three available options
omino: Maybe no!
  else
omino: Maybe...
  _ominoDialoghiCanc(33); //see function below
  _ominoDialoghi(1, 1); //see function below
  dOminoPapa31.Start(); //open part one of third dialogue
stop

@2
  if(ominoGiocattoli)
omino: Maybe no!
  else
omino: Maybe...
  _ominoDialoghiCanc(33);
  _ominoDialoghi(4, 1);
  dOminoPapa31.Start();
stop

@3
  if(ominoGiocattoli)
omino: Maybe no!
  else
omino: Maybe...
  _ominoDialoghiCanc(33);
  _ominoDialoghi(7, 1);
  dOminoPapa31.Start();
stop

(...)

@6
  if(ominoVideogame)
omino: Maybe no!
  else
omino: Maybe...
  _ominoDialoghiCanc(33);
  _ominoDialoghi(16, 1);
  dOminoPapa31.Start();
stop

@7
  if(ominoCiboCarne)
omino: Maybe no!
  else
omino: Maybe...
  _ominoDialoghiCanc(33);
  _ominoDialoghi(1, 2);
  dOminoPapa32.Start(); //open part two of third dialogue
stop

@8
  if(ominoCiboPizza)
omino: Maybe no!
  else
omino: Maybe...
  _ominoDialoghiCanc(33);
  _ominoDialoghi(4, 2);
  dOminoPapa32.Start();
stop

(...)

@12
  if(ominoTravestimenti)
omino: Maybe no!
  else
omino: Maybe...
  _ominoDialoghiCanc(33);
  _ominoDialoghi(16, 2);
  dOminoPapa32.Start();
stop
[close]

THIRD DIALOGUE(SPLIT IN 2, 3 AVAILABLE ANSWERS):
Spoiler
Code: ags
// Dialog script file
@S  // Dialog startup entry point
return

@1
  if(Game.DoOnceOnly("dOminoPapa3101")) //say once when the answer was choosen
  {
omino: I don't like that doll...
omino: ...I only like the video-game of Monkey Donk@!
  }
  if(Game.DoOnceOnly("ominoGiocattoli")) _ominoDialoghiFinale(0); //say once when the previous answer was choosen
  else _ominoDialoghiFinale(4); //the second time say another thing
  _ominoDialoghiCanc(34);
  dOminoPapa1.Start(); //restart
stop

(...)

@10
  if(Game.DoOnceOnly("dOminoPapa3110"))
omino: I want it but it's not here.

  if(Game.DoOnceOnly("ominoVideogames")) _ominoDialoghiFinale(1);
  else _ominoDialoghiFinale(5);
  _ominoDialoghiCanc(34);
  dOminoPapa1.Start();
stop

(...)
[close]

Spoiler
Code: ags
// Dialog script file
@S  // Dialog startup entry point
return

@1
  if(Game.DoOnceOnly("dOminoPapa3201"))
omino: That's what YOU want!

  if(Game.DoOnceOnly("ominoCibo")) _ominoDialoghiFinale(2);
  else _ominoDialoghiFinale(60);
  _ominoDialoghiCanc(35);
  ominoCiboCarne = true;
  dOminoPapa1.Start();
stop

@2
  if(Game.DoOnceOnly("dOminoPapa3202"))
  {
  cOmino.FaceDirection(eDirectionLeft);
omino: Like those?
cUomoAppeso: Yes!
  cGiostraia.FaceDirection(eDirectionRight);
giostraia: No way!
  cOmino.FaceDirection(eDirectionRight);
  cGiostraia.FaceDirection(eDirectionDown);
omino: Dad, I don't like chicken!
  }
  if(Game.DoOnceOnly("ominoCibo")) _ominoDialoghiFinale(2);
  else _ominoDialoghiFinale(60);
  _ominoDialoghiCanc(35);
  ominoCiboCarne = true;
  dOminoPapa1.Start();
stop

(...)

@7
  if(Game.DoOnceOnly("dOminoPapa3207"))
omino: I would like it but where can you see it?

  if(Game.DoOnceOnly("ominoCibo")) _ominoDialoghiFinale(2);
  else _ominoDialoghiFinale(62);
  _ominoDialoghiCanc(35);
  dOminoPapa1.Start();
stop

@8 //right answer
omino: Yes!
omino: You guessed it, daddy!
  dOminoPapaFinale.Start();
stop

@9
  if(Game.DoOnceOnly("dOminoPapa3209"))
omino: Maybe but it's not here.

  if(Game.DoOnceOnly("ominoCibo")) _ominoDialoghiFinale(2);
  else _ominoDialoghiFinale(62);
  _ominoDialoghiCanc(35);
  dOminoPapa1.Start();
stop

(...)

[close]

FUNCTIONS TO RESET DIALOGUES:
Spoiler
Code: ags
function _ominoDialoghi(int topic,  int dialogNumber) //set options state in next dialogue
{
  int w = topic;
  while(w <= topic + 2) //if I choose 1st answer, set option 1, 2, 3 on, 2nd answer set 4, 5, 6 on etc etc.
  {
    if(dialogNumber == 0) dialog[33].SetOptionState(w ,eOptionOn);
    else if (dialogNumber == 1) dialog[34].SetOptionState(w ,eOptionOn);
    else dialog[35].SetOptionState(w ,eOptionOn);
    w++;
  }
}

function _ominoDialoghiCanc(int dialogNumber) //reset options of the choosen dialogue
{
  for(int o = 1; o <= dialog[dialogNumber].OptionCount; o++)
  {
    if(dialog[dialogNumber].GetOptionState(o) == eOptionOn) dialog[dialogNumber].SetOptionState(o, eOptionOff);
  }
}

function _ominoDialoghiFinale(int field) //custom functions for a dialog
{
  if(field == 0) //toy
  {
    //say something
    ominoGiocattoli = true;
  }
  else if(field == 1) //videogame
  {
    //say something
    ominoVideogame = true;
  }
  else if(field == 2) //food
  {
   //say something once, this is the right field so I manage it in another way
  }
  else if(field == 3) //disguise
  {
    //say something once
    ominoTravestimenti = true;
  } //say these things if you choose a field twice, the field food has 3 different phrases because it is the right first answer and I reply according to what you chose for as next answer(1st answer: food --> 2nd answer: meat/flours/sweets) 

  else if(field == 4) cOmino.Say("I said it's not about toys!"); //toy 2nd time
  else if(field == 5) cOmino.Say("I can't get any video-game here!"); //videogame 2ndtime
  else if(field == 60) cOmino.Say("I don't want meat right now!"); //food/meat
  else if(field == 61) cOmino.Say("I don't want anything like pizza, pasta or panini!"); //food/flours
  else if(field == 62) cOmino.Say("A sweet may be interesting!"); //food/sweet
  else if(field == 7) cOmino.Say("I only want that football shirt and I can't have it!"); //disguises 2nd time
  ominoTentativi++; //this function is called when the chose answer is wrong, so I count the attempts at the end
}
[close]

If it can help, I can share a video where you can see the moment in which the game crashes and when the error message shows up.

I know that the question might be complex and I hope I wrote enough to understand how the script works. I tested it a lot and the logic seems to be correct (maybe the script can be reduced as well), I don't know what triggers the error in the web version. I hope there's a solution.

Thank you,
Giacomo
#3

                                                                    (lighting strike in town festival)

PLOT

Falco is a popular police commissioner of the homicides department who works in the capital city of a certain old country.
After 20 years spent investigating murders, he chose to take a long break to return home, a small hill town in the north of the country where people loves drinking.
He just set foot in town when the mayor promptly contacted him to ask him for a favour, knowing his affection for drinks and parties, and gave him the task to free up the town party that is supposed to go on all night long.



Indeed, a lot of noisy drunkards gather there for town festivals to have party until late in the night, and no police officer was able to stop them, especially during the festival of Baucco.
Falco is happy to accomplish the task as to join the old men to drink with them, but the meeting with an old acquaintance of school times will make the story more interesting.



MAKING OF THE GAME

Falco is my first game ever made. I didn't know anything about scripting and graphic, so it took me a lot to make it, especially to draw animations and backgrounds.
I also composed the music and wrote the dialogues, for the last with a little but essential help from my friend.
The game is quite short and it's supposed to be a kind of demo or introduction for the character, which I'd like to develop to make some noir stories, without forgetting of the humour element proper of adventure games.

LANGUAGES:
Italian
English

DOWNLOAD:
AGS game page
There could be minor glitches.
Now the game is available for web, but I can't take screenshot for saved games yet.

Thanks to AGSers:
@Crimson Wizard
@eri0o
@Snarky
@edmundito
@7yp0
@The Last To Know
@Yanek_Crispbread

Special thanks to AGSer:
@Khris
#4
Hello,
I'd like to ask a question about visual effects.

Imagine there is a object falling down from the sky.
On a certain moment the object lights up because it enter in a light ray action.
Then the object goes up and gets dark again.

Is it possible to create a shadow effect that covers the pixels within a sprite and on a certain range?
if I use region light then all the object changes tint and I'd like to give the shadow effect.

Eventually, I can do it manually on sprite editor, but I wonder if there is a faster way using
overlays or dynamic sprites.

Thank you.
#5
                                             
                                                                                                                (lighting strike in town festival)

PLOT

Falco is a popular police commissioner of the homicides department who works in the capital city of a certain old country.
After 20 years spent investigating murders, he chose to take a long break to return home, a small hill town in the north of the country where people loves drinking.
He just set foot in town when the mayor promptly contacted him to ask him for a favour, knowing his affection for drinks and parties, and gave him the task to free up the town party that is supposed to go on all night long.



Indeed, a lot of noisy drunkards gather there for town festivals to have party until late in the night, and no police officer was able to stop them, especially during the festival of Baucco.
Falco is happy to accomplish the task as to join the old men to drink with them, but the meeting with an old acquaintance of school times will make the story more interesting.



MAKING OF THE GAME

Falco is my first game ever made. I didn't know anything about scripting and graphic, so it took me a lot to make it, especially to draw animations and backgrounds.
I also composed the music and wrote the dialogues, for the last with a little but essential help from my friend.
The game is quite short and it's supposed to be a kind of demo or introduction for the character, which I'd like to develop to make some noir stories, without forgetting of the humour element proper of adventure games.
The character is inspired by a famous detective of an old TV series, despite his personality quite differs from his. Guess who!

Current Progress:
UPDATE 2024/09/29
Completed!
There could be minor glitches.
Completed game thread

Release Date:
September 2024

Languages:
Italian
English
#6
Hello everybody,I wrote a function that switch music when called and it just works fine when I define it in room script. But, as I have to use it, together with another one, inside a dialog, I put them both in global.

In global.ash 
Spoiler
Code: ags
enum actions
{  
  eGoUp,  
  eGoDown  
};  

import void SetBackgroundMusic(actions action);
import void stopMusic();

AudioChannel* channel[5];
AudioClip * clip[5];
int position[5]; //position of the clip once it's paused
int choice = 1;  //clip ID for channel 1 only
int number = 0; //clip and audio channel ID
[close]

In global.asc
Spoiler
Code: ags
void SetBackgroundMusic(actions action)
{ 
  switch(choice)  
  {
    case 1: clip[1] = aSong11;
    break;
    case 2: clip[1] = aSong12;
    break;
    case 3: clip[1] = aSong13;
    break;
    case 4: clip[1] = aSong14;
    break;
  }
  clip[2] = aSong2;
  clip[3] = aSong3;
  clip[4] = aSong4;
  if(channel[number].IsPlaying) //volume down
  {    
    while(channel[number].Volume > 0)
    {      
      channel[number].Volume -= 3;
      Wait(2);
    }
    channel[number].Pause();
    position[number] = channel[number].Position;
  }
  if(action == eGoDown && number > 0) number--;
  else if(action == eGoUp && number < 4) number++;
  if(channel[number] == null || !channel[number].IsPaused channel[number] = clip[number].Play(); //assign new audio clip to channel
  else clip[number].PlayFrom(position[number]); //else play it from where it was paused
  channel[number].Volume = 0;
  if(channel[number].IsPlaying) //volume up  
  { 
    while(channel[number].Volume < 99)    
    {
      channel[number].Volume += 3;
      Wait(2);  
    } 
  }
}

void stopMusic() //used for channel 1 only, for which, inside a dialog, player can choose which song to play 
{  
  if(channel[number] == null) Display("null");
  while(channel[1].Volume > 0)    
  {
    channel[1].Volume -= 3;
    Wait(2);
  }
  channel[1].Stop();
}
[close]

In room.asc
Spoiler
Code: ags
function room_AfterFadeIn()
{
  channel = aSong0.Play();
  channel.Volume = 99;
}
[close]

I didn't always check the null condition, I used Display function just to see when the audio channel stop being non null, in one case it was inside a dialog, but I don't really understand how to work on this. Please consider that this is just a raw try, as I'm moving my first steps into music functions. SetBackgroundMusic worked only when it was defined inside room. I still don't understand how to point to channels and clips globally, if and where to use imports, exports etc... Any help is appreciated.

Thank you,
Giacomo
#7
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
#8
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
#9
Hello people of community,
I need your help.

I would like to:

-draw a big background
-split it into two camera scenes, scrolling left to right and viceversa in certain points of the screen
-I would like the sky to be frozen during the animation

Foreground is full of big objects drawn between it and sky, and I abandoned the idea of making
sky and foreground big objets because that would make everything harder. I wonder if there is
a way to use foreground as background, and sky as object put behind it. I hope you have better ideas.


Purple is for walking line.

Thank you all in advice,
Giacomo
#10
Hi eveyone!

I'm sorry I can't solve the following problem on my own...

So, I have 320x240 screen resolution.

The room's background is a triptych which is 960x360 (There's an upper part also).

I'd like to set the camera to the left portion of the background so that
when the player reaches the right border, the camera scrolls rapidly to the second part
of the background, and same thing for the third part.

In the third part, the player takes a look up and there i'd like the camera to move
up to show the sky.

How is that possible?

Here's a graphic example.

https://imgur.com/uHASYHk

Thank you all in advance!
#11
Hi everyone!

I am trying to create a Dynamic Sprite from a character's current frame
to make a shadow effect.

I am a newbie and searched for answers both in manual and threads, but I am sorry to say that I'm stuck already.

So, created a dummy character that follow the player like a water reflection.
This character's animation frames are bitmap files taken by editing the player
sprites to appear black and vertically mirrored (I modified Roger's sprites in sprite editor),
then uploaded to AGS, assigned to dummy character view and loops and made semi-transparent via script.
Can this be a good start point?

Futhermore, I'd like to modify these dark bitmaps calling Dynamic Sprite in RepExecAlways function and applying maths operations on them; I wonder if it is possible to do it on the current game frame, I mean, loading a modified bitmap sprite as Dynamic sprite of the chatacter frame.

The following instructions work as they should: create a copy of Roger's current frame, loop and view and draw it on room background, copying is walk animation at  his every step. I left the dummy character out of instructions for the moment, because I'd like to work directly on Roger
frame to do my tests.

But I have problems in deleting Dynamic sprite drawn on background surface,
so I ask you guys if it is possible to clean the background every time i draw a new frame
from Roger's animation.

Thank you all in advance,
Giacomo
SMF spam blocked by CleanTalk