Just theory, but similar works:
entity linked lists
Code:
define nunsI, 0;
define ratsI, 1;
function eCreate(_str, _index, _count) {
if (_str == 0 || _count < 1 || _index < 0) { // ops not optimized in C-Script
return(0);
}
// assumes ent_create does not fail?
while (elCount(_index) < _count) {
if (elAdd(_index, ent_create(_str, pos, fn)) == 0) {
break;
}
}
return(elCount(_index));
}
// ...
// 5 nuns
eCreate("nun.mdl", nunsI, 5);
// 2 rats
eCreate("rat.mdl", ratsI, 2);
// ...
entity* e0; // can use directly without pointer also
e0 = NULL;
// give me nun 3
e0 = eGet(nunsI, 3-1);
// give me 1st rat
e0 = eGet(ratsI, 1-1);
Assign values to locals.
http://testdummy93.tripod.comErrors here?, Makes sense?, 'get it', use it or don't. I don't have the time.