Jump to content


Joban

Member Since 04 Apr 2010
Offline Last Active Jun 20 2012 07:33 PM

Posts I've Made

In Topic: play music from list

19 June 2012 - 10:56 PM

Thanks for the help I got it work with this
currentSong = ds_list_find_value(global.musicPlaylist, 0)
sound_replace(snd_music, currentSong, 3, true)
sound_play(snd_music)

How would I cycle through the data list for the next song?

In Topic: play music from list

19 June 2012 - 09:32 PM

I'm sorry, this is the first time I've been introduced to "Data Structure Lists" how exactly do I use them.

I initialized the list with my GameStart object
global.musicPlaylist = ds_list_create()

Then I populated the list with my Playlist object
var fileName,i;

fileName = file_text_open_read("playlist.txt");
i = 0;

while (!file_text_eof(fileName)) {
    with (instance_create(x, y + (16 * i), obj_slot)) {
        soundFile = file_text_read_string(fileName);
        draw_text(x, y, filename_name(soundFile));
        ds_list_add(global.musicPlaylist, soundFile)
    }
    file_text_readln(fileName);
    i+=1;
}
file_text_close(fileName);

Finally in my MusicPlayer object I tried to play it
currentSong = ds_list_find_value(global.musicPlaylist, 0)
sound_play(currentSong)

That was my attempt at it obviously I don't know what I am doing.

In Topic: trigger path when two objects collide

25 May 2012 - 09:47 PM

ok so in the X i put if it collides with the circle do this

with obj_mouse {
    path_start(pth_maze, 1, 0, true)
}

only problem my mouse moves down a little and then stops.
same thing occurs when i use the collision event and put a drag and drag start path for the mouse

EDIT: I started experimenting and I got it to work, your thing helped too.

In Topic: IF statement executing oddly

26 April 2012 - 02:55 AM

Wow that simple.... you guys are godly.

In Topic: draw something and keep it there while drawing mor

26 April 2012 - 12:44 AM

Thanks for you help, I'm just creating a text-based rpg so I don't think graphics is a problem.