The Dink Network

Reply to Re: procedure thing

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:
 
 
September 4th 2006, 09:52 AM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
so &arg1-9 are reference parameters? but this is the thing. i dont modify them when i get the error. or even use &arg at all sometimes. i was just making an example not paying attention.

Dink rocedure g_music does not take 1 parms in item-fst, offset 2135. ();
?)
Dink:ERROR: Procedure void d …|( void ); not found in script . (word 2 was item-fst)

the SECOND line, i think, is whats causing the parameter to NOT run. because like you said, the first line will show, no matter what. for any procedure. because i have other ones that work that only show the first line but this one does not work and it shows the second line. all it is is a global procedure. like this

in main.c

make_global_function("global","g_music");

in global.c

void g_music( void )
{
//used to play appropriate song after game is loaded
//called in our item equip procedure
playmidi("100.mid");
if (&song == 100)
{
playmidi("100.mid");
}
if (&song == 103)
{
playmidi("103.mid");
}
if (&song == 104)
{
playmidi("104.mid");
}
}

in item-fst.c

g_music();

DOESNT WORK. i have to use external and it works fine. the weird thing is... it USED to work, just fine. the only thing i can think of is im not initializing or calling the procedure right and it doesnt like it but only sometimes cause i have procedures that send values to &arg and use &return that work PERFECTLY.

is it possible this procedure stopped working as i added more procedures to global.c? when it was the only one it worked but now there are 2 more after it and it doesnt work.

what i want to know is how to initialize and call the procedure.

do you do

void whatever( void )

or do you just do

void whatever() //this is how i do it with local procedures that use args and they work

void whatever(&arg1,&arg2etc) //this also works for the local one

but i want to know the official way its done. the one not working and giving the error is the global music one... that doesnt even use &arg at all.