Jump to content


MrWoz

Member Since 16 Sep 2010
Offline Last Active Nov 28 2012 09:32 AM

Posts I've Made

In Topic: How do I play songs with the Bassmod?

30 May 2012 - 01:07 PM

Hello,

I recently installed Smarty's Bassmod, but I have no idea how to play a simple mod with it.
I want to use it for background music, because mod files are usually a lot smaller than mp3 files.

Can anybody give me the script to play a mod file as a background song?

thanks,

~MindOfCreativity


Hi there, you first need to add the extension package to gamemaker. Then add the .mod file to the be included, resources/included files.
then create an object, add this object to the room.
var Music
bmod_init(44100,false,false);
Music=bmod_add('techno.mod')//name of mod file
bmod_play(Music)
Hope this helps.
Paul

In Topic: Changing an instance, keeping the sprite index

14 May 2012 - 10:04 AM

When you want it to change, do something like that:

// Create an instance of the other object
nextObj = instance_create(x,y,Obj_Alien2);
// Assign the sprite_index you surrently have to the other object
nextObj.sprite_index = sprite_index;
// And finaly destroy the current instance so it has "transformed"
instance_destroy();

Hope it helped, if not, I don't understand what you want, but if it helps, be gentle and rep up this post :)


Thanks for your time in replying to me, much appreciated.Maybe it would be easier if i send you the game?
Obj_Alien2 is the same as Obj_Alien1 but Alien2 moves towards and follows the players ship.All the Obj_Alien1 objects were created and placed in the room editor.
I assume my program changes one random instance of the Obj_Alien1 into Obj_Alien2 but i don't know which instances of Obj_Alien1 have what sprite index.
On the other levels it didn't matter because all the Obj_Alien1 objects had the same sprite index so Obj_Alien2 had the same.
Thanks again
Paul

In Topic: Changing an instance, keeping the sprite index

14 May 2012 - 10:03 AM

1) Avoid all the hassle and just use one object instead of multiple objects (yes, it can be done easily)
...
Dunno why I listed that.

Are you changing the instance or the object_index? In other words, are you performing the create events and destroy events? If you're not performing the create/destroy events upon changing, you can use a controller object to target the alien, save its sprite_index to a temporary local variable (var temp;), change the target alien's object_index and then set its sprite_index to the value in the temp variable.


Thanks for the reply, much appreciated. I am changing an instance of Obj_Alien1 into Obj_Alien2. All the Obj_Alien1 instances were placed and created in the room editor. On other levels it doesnt matter because all the Obj_Alien1 instances have the same sprite index Spr_Alien1 or Spr_Alien2 or Spr_Alien3, so Obj_Alien2 depending on which level you are on, has the same sprite index, but level 8 has randomly selected Obj_Alien1 instances with randomly assigned sprite index's. So I don't know which Obj_Alien1 instance is going to be changed to Obj_Alien2.
Thanks again.
Paul

In Topic: Changing an instance, keeping the sprite index

14 May 2012 - 09:48 AM

Thanks for your time in replying to me, much appreciated.Maybe it would be easier if i send you the game?
Obj_Alien2 is the same as Obj_Alien1 but Alien2 moves towards and follows the players ship.All the Obj_Alien1 objects were created and placed in the room editor.
I assume my program changes one random instance of the Obj_Alien1 into Obj_Alien2  but i don't know which instances of Obj_Alien1 have what sprite index.
On the other levels it didn't matter because all the Obj_Alien1 objects had the same sprite index so Obj_Alien2 had the same.
Thanks again
Paul