I Wanna Be The Forums!

Please login or register.

Login with username, password and session length
Advanced search  

News:

Gaiden 1.2 patch released. Click here to download!

Author Topic: 2 Game Maker questions  (Read 4133 times)

Jksnxia

  • Full Member
  • ***
  • Posts: 245
  • I make short films too :3 Check out my youtube
    • View Profile
    • me youtube
2 Game Maker questions
« on: March 14, 2010, 04:44:49 pm »

I have a 2 problems right now in Game Maker....

First, how do you make the bullet disappear after hit the boss? If I set the boss as solid, the bullet will disappear but the boss won't be hurt.

Second, I got a few sound files that are "Background Music" type in GM, and when the player dies, the music continues to play.  If I change the type to "Multimedia", it works fine but it takes about 3 seconds to load the room, so every time you die, it takes 3 seconds to replay.

Help plz.

*Solved*
« Last Edit: March 17, 2010, 07:52:47 pm by Jksnxia »
Logged
Creativity and optimisim

giuocob

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: 2 Game Maker questions
« Reply #1 on: March 14, 2010, 05:21:41 pm »

Not sure about the first one, but I'd imagine there's a programmed method somewhere in GM to destroy an instance.

For the second one, consider compressing the music to decrease the loading time.
Logged

Jksnxia

  • Full Member
  • ***
  • Posts: 245
  • I make short films too :3 Check out my youtube
    • View Profile
    • me youtube
Re: 2 Game Maker questions
« Reply #2 on: March 14, 2010, 05:46:15 pm »

how do I do that? and I don't think that'll help much because the loading problem occurs when I apply the background music type to multimedia type
Logged
Creativity and optimisim

giuocob

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: 2 Game Maker questions
« Reply #3 on: March 14, 2010, 07:19:40 pm »

Assuming you're working with mp3 files, you'll have to find an MP3 compressor. I don't have one on hand, but www.sourceforge.net would be a great place to start looking.
Logged

Ellipsis

  • Ellipsis
  • The Guy
  • *****
  • Posts: 1907
    • View Profile
    • If Not Equal Limited
Re: 2 Game Maker questions
« Reply #4 on: March 15, 2010, 12:50:14 pm »

1. When the bullet collides with the boss, destroy it, also set object "other" hp to -1 and tick relative.

2. Tick pre-load on the music files.
Logged

Jksnxia

  • Full Member
  • ***
  • Posts: 245
  • I make short films too :3 Check out my youtube
    • View Profile
    • me youtube
Re: 2 Game Maker questions
« Reply #5 on: March 15, 2010, 06:46:54 pm »

1. When the bullet collides with the boss, destroy it, also set object "other" hp to -1 and tick relative.

2. Tick pre-load on the music files.

um, by "tick" you mean check it or uncheck it? because all the boxes that you said need checking are already checked.

and for 1. which event would that be? if it's in step event for the object boss, I tried destroying it then set hp-=1, but it still doesn't work.... :-\
Logged
Creativity and optimisim

Jeed-Unit

  • Newbie
  • *
  • Posts: 32
  • パーティーはいつですか
    • View Profile
    • http://www.youtube.com/user/liljeed
Re: 2 Game Maker questions
« Reply #6 on: March 15, 2010, 10:27:20 pm »

you need instance_destroy() and sound_stop_all()
Logged
Stop stalking me, I'm not hiding anything!

O o
/¯/___________________________ _ __/
| | http://www.youtube.com/user/liljeed
\_\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯ ¯¯\

Jksnxia

  • Full Member
  • ***
  • Posts: 245
  • I make short films too :3 Check out my youtube
    • View Profile
    • me youtube
Re: 2 Game Maker questions
« Reply #7 on: March 16, 2010, 12:12:41 am »

you need instance_destroy() and sound_stop_all()

I've tried all those, none worked, that's why I'm asking here.  I tried to make if the bullet hits the boss, it destroys then hp-=1, doesn't work; sound_stop_all() and sound_stop(music) both didn't work for me, I think it might be because they're background music types
Logged
Creativity and optimisim

Jeed-Unit

  • Newbie
  • *
  • Posts: 32
  • パーティーはいつですか
    • View Profile
    • http://www.youtube.com/user/liljeed
Re: 2 Game Maker questions
« Reply #8 on: March 16, 2010, 12:42:59 am »

hmm, sound_stop_all stops every sounds that are handled by gm(wav,mp3,ogg,midi,etc) so I don't know, especially since I never had any problems with it.

and for instance_destroy(), unless you are not doing it the right way, it's supposed to work. Especially that it's quite a common function. ???

But if that can help, put in the collision event of the bullet with that boss (bullet->collision with boss)

other.hp-=1
instance_destroy()

If that still doesn't help. I suggest you to read a tutorial because the problem is beyond the information you are giving me.

edit:
Quote
1. which event would that be? if it's in step event for the object boss, I tried destroying it then set hp-=1, but it still doesn't work.... Undecided
ooh I missed that. Do what I wrote above. It will work.
« Last Edit: March 16, 2010, 12:46:14 am by Jeed-Unit »
Logged
Stop stalking me, I'm not hiding anything!

O o
/¯/___________________________ _ __/
| | http://www.youtube.com/user/liljeed
\_\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯ ¯¯\

Jksnxia

  • Full Member
  • ***
  • Posts: 245
  • I make short films too :3 Check out my youtube
    • View Profile
    • me youtube
Re: 2 Game Maker questions
« Reply #9 on: March 16, 2010, 06:09:01 pm »

But if that can help, put in the collision event of the bullet with that boss (bullet->collision with boss)

other.hp-=1
instance_destroy()

thx a lot that helped :D

This is the code I have in object "playMusic" for the room:
if (room=rscrymzbs){if (instance_exists(player)){sound_loop(dkc3purs)} else{sound_stop_all()}}
Logged
Creativity and optimisim

Jeed-Unit

  • Newbie
  • *
  • Posts: 32
  • パーティーはいつですか
    • View Profile
    • http://www.youtube.com/user/liljeed
Re: 2 Game Maker questions
« Reply #10 on: March 16, 2010, 07:32:11 pm »

ooh, I didn't look in the engine but from what I've seen so far, I think the player never get destroyed(it get moved outside of the screen), so it always exist.

I don't know how the engine works that much but maybe you could put a global variable that tell if the player is dead or not.

Put like global.dead=false in the create event then put global.dead=true where you have to. Also don't loop your sound_stop_all or you'll never be able to put a gaveover song. By the way, calling a sound_loop actually stop every background music. So you could put something like

if global.dead=false
 {
   if room=room1 sound_loop(1)
   if room=room2 sound_loop(2)
   etc
  }
else sound_loop(gameover)
Logged
Stop stalking me, I'm not hiding anything!

O o
/¯/___________________________ _ __/
| | http://www.youtube.com/user/liljeed
\_\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯ ¯¯\

Jksnxia

  • Full Member
  • ***
  • Posts: 245
  • I make short films too :3 Check out my youtube
    • View Profile
    • me youtube
Re: 2 Game Maker questions
« Reply #11 on: March 16, 2010, 08:48:19 pm »

I set it to kill player, not move it away.

I didn't really get what you said about sound_loop and sound_stop_all()....

Also don't loop your sound_stop_all or you'll never be able to put a gaveover song.

I don't really get what that means.....

well I looped the other music, which are multimedia types, and sound_stop and gameover music all work fine....

By the way, calling a sound_loop actually stop every background music.

so what happens if I set sound_loop(background music)?



EDIT*:

nvm I'll just convert them into mp3 files, thx anyways, you've been a lot of help!
« Last Edit: March 17, 2010, 04:30:06 pm by Jksnxia »
Logged
Creativity and optimisim