Hi,
Well I think I know what's happening however I have NO IDEA why?? It seems the assignment of the handle and subsequent calling of it works fine within the same function...but if the handle is assigned in one function and attempted to be called in another it doesn't work...for example:
function first()
{
index = 0;
SAMPLE_ENT = ptr_for_handle(Monsters[index]); //get entity pointer
str_cpy(entname, " "); str_for_entfile(entname, SAMPLE_ENT); //get file name
MODELS[SAMPLE_ENT.offset] = handle(entname); //store entity file name
...do stuff
DESC = ptr_for_handle(MODELS[SAMPLE_ENT.offset];
ent_morph(SAMPLE_ENT, DESC); //change back to "original" model/sprite
}
that above works FINE...however...
function first()
{
index = 0;
SAMPLE_ENT = ptr_for_handle(Monsters[index]); //get entity pointer
str_cpy(entname, " "); str_for_entfile(entname, SAMPLE_ENT); //get file name
MODELS[SAMPLE_ENT.offset] = handle(entname); //store entity file name
}
function second()
{
DESC = ptr_for_handle(MODELS[SAMPLE_ENT.offset];
ent_morph(SAMPLE_ENT, DESC); //change back to "original" model/sprite
}
This doesn't work at all, it simply uses the "last" entity that was accessed using the "str_for_entfile" command...WHY???