Hi, Spawning Entities and Actual Spawning Entities happen in the same function which is Level::SpawnEntities.
Targetname system is a simple string search in the engine.
I think it's not the case, I'll have a closer look at this. I sent you a PM.
Ha, I knew it was going to be something like that :P I was trying all sorts of ways around this delay before I posted up my problem.
I thought about waiting till the world was initialized, then it quickly occurred to me that $world, the only usable reference, is a targetname :P
Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.
This line of text: Adding script: 'dm/mohdm2.scr' is added from World class constructor.
This sample executes right after:
Code:/*TEMP*/ level waittill prespawn /*TEMP*/ conprintf ("####### FRAMEWORK ######\n")So I think it's the fastest we can get. Why would you want to set it up earlier?Code:Adding script: 'dm/mohdm2.scr' ####### FRAMEWORK ######
You could always initialize all ScriptLibs and everything earlier. Store targetnames in framework array, and leave just targetnaming after prespawn
$world is a targetname of world entity It's set inside World constructor
The weird thing is that it is possible execute code before prespawn in the mapscript without the level waittill prespawn producing
an error in the console that the event has already passed. I know from experience that it is possible to spawn 2000 pathnode entities
and still have the mapscript wait for prespawn... That sure is strange considering the mapscript is executed at prespawn. :S
I'm guessing there's a few precious miliseconds between the execution of the mapscript and the event 'prespawn'.
EDIT: But, this is no problem, just thought of a cool way to adapt the framework to partly compensate for this issue..
Last edited by Sor; February 14th, 2013 at 02:35 PM.
Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.