Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Exception..

  1. #11
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    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.

  2. #12
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    I checked it.

    Targetnamed entities are stored in World class, in TargetList. When you try to targetname entity, it crashes because World object isn't yet created/initialized. And World is a subclass of Entity.

  3. #13
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    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.

  4. #14
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    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")
    Code:
    Adding script: 'dm/mohdm2.scr'
    ####### FRAMEWORK ######
    So I think it's the fastest we can get. Why would you want to set it up earlier?
    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

  5. #15
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •