FTE_MULTIPROGS how to do that?
Posted: Tue Jan 10, 2017 9:36 pm
ok, I said to myself: nice and easy. Let's add to csprogs.dat, another hello.dat which has only one stupid function that prints "hello" in csprogs.dat. Why should it be so difficult, huh? Huh? Huh?
Well, it's kinda difficult!
hello.dat
csprogs.dat
Without calling the externcall, csprogs works but with a warning
calling externcall will make, obviously, FTE crash. Engine code says in pr_edict.c that
??What are friked progs?
And also
Tried to change init to 0 and even to -2 but same error
Please Spike, help!
Well, it's kinda difficult!
hello.dat
Code: Select all
void CSQC_Init(float apilevel, string enginename, float engineversion)
{
//FTE_MULTIPROGS init
init(-1);//-1 consider this as "main" .dat file
initents();
}
extern void Ext_Hello()
{
cprint("Hello\n");
}
Code: Select all
float MULTIDAT_HELLO;
void CSQC_Init(float apilevel, string enginename, float engineversion)
{
//FTE_MULTIPROGS load
MULTIDAT_HELLO= addprogs("hello.dat");
//..other useless junk
}
void CSQC_UpdateView(float vwidth, float vheight, float notmenu)
{
//..useless junk before
externcall(MULTIDAT_HELLO,"ExtUI_Hello");
//..useless junk after
}
Code: Select all
You are trying to load a string-stripped progs as an addon. This behaviour is not supported. Try removing some optimizations.
Code: Select all
//friked progs only allow one file.
And also
Code: Select all
//progs 0 always acts as string stripped.
//partly to avoid some bad/optimised progs.
Please Spike, help!