My Noobish Little Questions List

Started by Rik_Vargard, Wed 09/02/2022 18:41:13

Previous topic - Next topic

Rik_Vargard

Hello!

Now and then I have those questions that, I think, don't really need a whole new post.
But I want to learn; these are just out of curiosity.
I hope this isn't the wrong place for this  :P

So here goes for now:

1/ Is it possible to keep the Background Music playing when you start a video?
2/ Why use a Boolean when you can use an INT ( 0 or 1)?
3/ Why don't people use something like a "Game Installer" instead of just sharing the files "as is"?
4/ Do you use Hotspots or Regions to have the player change rooms when walking into/ standing on it?
5/ Is it possible to click through the transparent part of a Character's PNG image?

Thanks in advance for any answer, insight, opinion etc., much appreciated! :)

Khris

1) This should happen by default if the video doesn't have a sound track
2) Why use an int when you can use a boolean? actual advantage: you can write  if (itsRaining)
3) Why do people use an annoying installer that might clutter up your registry when you can just unpack and run? portable > installation, always
4) Regions, since they have the "player walks onto" event, which only fires once. The "player stands on hotspot" event is from before regions existed
5) That's already what's happening

Crimson Wizard

#2
Quote from: Rik_Vargard on Wed 09/02/2022 18:41:13
1/ Is it possible to keep the Background Music playing when you start a video?
Quote from: Khris on Wed 09/02/2022 18:57:43
1) This should happen by default if the video doesn't have a sound track

I don't remember whether presence of audio track affects it, but normally this is controlled by the PlayVideo function parameters:
https://adventuregamestudio.github.io/ags-manual/Multimedia.html#playvideo
You may play either video sound, or game sounds, but not both at the same time. If you want both, then the only solution currently is to separate video sound into an audio clip, and play on its own.

Quote from: Rik_Vargard on Wed 09/02/2022 18:41:13
2/ Why use a Boolean when you can use an INT ( 0 or 1)?
Quote from: Khris on Wed 09/02/2022 18:57:43
2) Why use an int when you can use a boolean? actual advantage: you can write  if (itsRaining)

In AGS script there's no practical difference between int and bool, because bool is secretly an enum and declared as:
Code: ags

enum bool {
  false = 0,
  true = 1
};


The reason to use "bool" is primarily to empasize its purpose, i think. Because when you see "int" you cannot tell which range of values it may take. "bool" means it supposed to be "true" or "false".
This is also the reason to use enums: because they indicate the purpose and which values this variable is supposed to have.


Quote from: Rik_Vargard on Wed 09/02/2022 18:41:13
5/ Is it possible to click through the transparent part of a Character's PNG image?

This is controlled by the "Pixel-perfect click detection" option in the General Settings. Also may be turned on and off using SetGameOption.
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#setgameoption
IIRC this is enabled by default.

Rik_Vargard

Thank you so much for the answers, guys! :)

SMF spam blocked by CleanTalk