playMaker

Author Topic: Change BGM Between Level  (Read 2304 times)

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Change BGM Between Level
« on: September 03, 2020, 09:10:03 AM »
Hello there,

i would like to change sound between different level.

for example, i played "A" Music in the Main Menu Level,
when i tried to load another level, its change to "B" Music, and its dont destroy on load on another level.

so my logic said that use Comparation, like in Main menu i set it Level index 0, and when the level index change to 1 or greater (load another level) its change the audio clip....

i tried to find get level index on which is check every frame, but i cant find it.

or any suggestion?

thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Change BGM Between Level
« Reply #1 on: September 03, 2020, 09:22:52 AM »
Hi.
The way i do it in our games is to have a music handler in a don't destroy

then i have a array with all my music on that object.

Then on the scenes i have a 'scene manager' which will set the index number of the music it should play and then send a event to reload music to that music handler.

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Change BGM Between Level
« Reply #2 on: September 05, 2020, 01:51:29 AM »
hi,
Thanks for your reply, its working, but decrease the immersion of my game, lol.

So i place the Music Object in every scene.

anyway, another question, but its OOT.

I tried to use screen resolution action, but its weird.

my game use 1920 x 1080 resolution, when i use Set Screen Resolution actions, to 1600 x 900, its dont get smaller, but its zooming.

Any suggestion?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Change BGM Between Level
« Reply #3 on: September 06, 2020, 04:49:12 AM »
Hi.
not sure what you mean by zooming, can you show some images on the difference?

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Change BGM Between Level
« Reply #4 on: September 07, 2020, 09:02:54 PM »
sure, the first picture, im using 1920 x 1080 resolution which is going well,
but the second picture is using 1600 x 900 and its zooming the game

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Change BGM Between Level
« Reply #5 on: September 08, 2020, 05:07:28 AM »
Hi.
You need to look to your canvas settings (Canvas and Canvas Scaler)

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Change BGM Between Level
« Reply #6 on: September 08, 2020, 07:24:21 AM »
Okay, its work right now.

too bad for me that i made so many canvas, and i need to change it one by one.
but thanks!

anyway, if i may ask another things, is it allowed? i mean its OOT.

so the things is, can we create Game object (like deploy army on Age of empires) by Arraylist?

when i mouse pick 2d event on my army cards, its towards to add arraylist to my barracks, and the barracks store the list of my army, and when the time up. its create object from the spawner.

i cant do it, and its make me confuse.

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Change BGM Between Level, Set Screen Resolution
« Reply #7 on: September 08, 2020, 08:22:46 AM »
i also have a problem, so many problem lol.

is the TriggerExit is not working onDestroy?

while my army [OnTriggerEnter / Stay] its not moving and attacked enemy army, then the enemy army got destroyed, the FSM contains OnTriggerExit is staying and not moving.

its also not work onColliderExit
« Last Edit: September 08, 2020, 08:25:46 AM by sapigwetao »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Change BGM Between Level
« Reply #8 on: September 08, 2020, 08:24:41 AM »
Hi.
So you have a timer and when it runs out it should spawn an enemy

if it can spawn only 1 time of enemy then you do not need a array.

if so, then use an int array (to know what enemy type to set timer and also to know what to spawn after wards)


when clicking it should add to the array.

For timer, first use Array (List) Get (index 0)
then with the Int for the enemy type you can determine how long the timer should run.

then when time runs out, use the int again to determine which to spawn.
then remove array on index 0

it is best to use Array Maker instead of the build in array actions