The Dink Network

Reply to Re: Is it possible...

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
December 21st 2003, 09:08 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
There are several types of numbers in Dink:

Sprite Editor Number: the number of a sprite in map.dat that you placed in DE or WDE.

Sprite Number: a number of a currently active sprite. Examples include 1 (Dink), ¤t_sprite, etc.

Script Number: each script that is being run is assigned its own unique number. This isn't used that much, except for run_script_by_number, and you can get the script number from the return value of spawn (I think, anyway) and ¤t_script.

Sound Index Number: usually defined in start.c, it assigns a sound file to a value to be used with playsound.

Sound Number: each sound that is played has its own unique number, by which you can tell it to loop, change its volume, and kill it. You get it from the return value of playsound.

So, as a long way to answer your question, sp_sound(¤t_sprite,50); wouldn't work for between screens, and script_attach(1000); wouldn't work at all because it only deals with the ¤t_script value.

In order to do it, you'd need to do something like this:

//Let's make a global variable called mysound
make_global_int("&mysound",0);

//The last number in the playsound command instructs Dink to loop the sound.
&mysound = playsound(50,16025,0,0,1);
sound_set_survive(&mysound);

//If you want to kill the sound, do this
sound_set_kill(&mysound);

But anyway... try the looping midi thing. Unless you absolutely need the music to loop for every single second. If the user goes into the Inventory screen for a couple hours, the midi will begin when the go back into the game and so on.