procedure thing
Dink rocedure print_thing does not take 2 parms in FRANK, offset 735. ();
?)
what the heck does that mean?
im playing around with procedures and they work. sometimes i think. this one isnt even global its local so what is this error mean?
i write it like this
void main( void )
{
whatever(1,2);
int &elf = &return;
}
void whatever()
{
&arg1 += &arg2;
return(&arg1);
}
it works i just get this error. it works with doing
void whatever( void )
and
void whatever(&arg1,&arg2)
also i just still get the error so how is it done anyone can do me example?
?)
what the heck does that mean?
im playing around with procedures and they work. sometimes i think. this one isnt even global its local so what is this error mean?
i write it like this
void main( void )
{
whatever(1,2);
int &elf = &return;
}
void whatever()
{
&arg1 += &arg2;
return(&arg1);
}
it works i just get this error. it works with doing
void whatever( void )
and
void whatever(&arg1,&arg2)
also i just still get the error so how is it done anyone can do me example?
That debug statement doesn't really mean anything... Dink'll spit that out for every custom procedure.
This procedure doesn't work because you are not allowed to modify the &arg# pseudo variables. Try this procedure:
void whatever()
{
int &temp = &arg1;
&temp += &arg2;
return(&temp);
}
This procedure doesn't work because you are not allowed to modify the &arg# pseudo variables. Try this procedure:
void whatever()
{
int &temp = &arg1;
&temp += &arg2;
return(&temp);
}
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.
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.
yeah i called the procedure like this
g_music();
in key-75.c and i get the same error
Dink:ERROR: Procedure void d …|( void ); not found in script . (word 2 was key-72)
basically im looking for examples on how to initialize and call them both with and without use of arguments
g_music();
in key-75.c and i get the same error
Dink:ERROR: Procedure void d …|( void ); not found in script . (word 2 was key-72)
basically im looking for examples on how to initialize and call them both with and without use of arguments
Global functions don't work correctly. Use external. Sorry about that.
uh. well fix it. external doesnt give you parameters. how can i make my own add_item procedure for a new inventory screen if i cant tell it what item to add? i guess i could make it a local procedure and copy and paste it into every single script where i add an item but then that defeats the useful/awesomeness of being able to make your own globals. and why does it work fine sometimes but not at all sometimes i dont get it. why did it work before then suddenly stop working. anyway. this sucks.
oh wow the amazing thought just occured to me that i could make a variable called &assratchet and then do
&assratchet = 4;
external("global","g_whatever");
void g_whatever()
{ say("&assratchet",1);
}
but still thats ghetto and it should be fixed. i would fix it myself and leave you with the greatest dinkc abillities of all time if i knew the first thing about how to even open/edit/save the source code into a game
wait how do you use parameters with external??
&assratchet = 4;
external("global","g_whatever");
void g_whatever()
{ say("&assratchet",1);
}
but still thats ghetto and it should be fixed. i would fix it myself and leave you with the greatest dinkc abillities of all time if i knew the first thing about how to even open/edit/save the source code into a game
wait how do you use parameters with external??
like how do i send the value?
externmal("global","g_whatever",5,2,3);
i dont get it
externmal("global","g_whatever",5,2,3);
i dont get it
Pretty much.
From the DinkC Reference (Advanced Procedures):
// passing.c
void main(void)
{
int &two = 2;
// You can specify up to 9 parameters by calling a procedure directly.
// Will cause Dink to say "1, 2, 3, 4, 5, 6, 7, 8, 9"
say_stuff(1, &two, 3, 4, 5, 6, 7, 8, 9);
// You can only pass up to 8 parameters when using external.
// Will cause Dink to say "1, 2, 3, 4, 5, 6, 7, 8, 0"
external("passing", "say_stuff", 1, &two, 3, 4, 5, 6, 7, 8);
}
void say_stuff()
{
say("&arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9", 1);
}
From the DinkC Reference (Advanced Procedures):
// passing.c
void main(void)
{
int &two = 2;
// You can specify up to 9 parameters by calling a procedure directly.
// Will cause Dink to say "1, 2, 3, 4, 5, 6, 7, 8, 9"
say_stuff(1, &two, 3, 4, 5, 6, 7, 8, 9);
// You can only pass up to 8 parameters when using external.
// Will cause Dink to say "1, 2, 3, 4, 5, 6, 7, 8, 0"
external("passing", "say_stuff", 1, &two, 3, 4, 5, 6, 7, 8);
}
void say_stuff()
{
say("&arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9", 1);
}
ah ha i guessed right i win. yeah this works.
**ps from what i was doing i had 3 different globals and i think maybe only the last one you initialize works fine because my last one worked fine and the ones i had before it broke so i dont know if you know what the problem is but this is my guess from what i was doing. they worked fine. then i add a different one and i think thats when i had to change the first one to external. then i added a third global and the second one stopped working as well. but the third one i added worked fine. so im guessing if i added a fourth the third one would break and the fourth one would.... work......... fine.
**ps from what i was doing i had 3 different globals and i think maybe only the last one you initialize works fine because my last one worked fine and the ones i had before it broke so i dont know if you know what the problem is but this is my guess from what i was doing. they worked fine. then i add a different one and i think thats when i had to change the first one to external. then i added a third global and the second one stopped working as well. but the third one i added worked fine. so im guessing if i added a fourth the third one would break and the fourth one would.... work......... fine.