Home   Help Search Login Register  

Author Topic: Experience with spawned modules ???  (Read 1661 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Experience with spawned modules ???
« on: 28 Jan 2010, 20:29:57 »
Hi,

In a mission I found that the modules alice, silvie and animals where causing lag and jerkyness in a camera intro.
I decided to have them spawned as soon as the intro was over instead of placing them in the editor.

Code: [Select]
if (isServer) then {module1 = "BIS_animals_Logic" createVehicle [0,0,0]; module2 = "SilvieManager" createVehicle [0,0,0]; module3 = "AliceManager" createVehicle [0,0,0]};

However, this solution doesn't work because the spawned modules don't work at all, nothing is spawned by them.
Does anyone have any similar experiences or better, know why this is.
Those modules aren't even supposed to be synchronized with a unit, so that can't be the case.

Thanks in advance,

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Experience with spawned modules ???
« Reply #1 on: 28 Jan 2010, 22:40:45 »
I couldn't tell you the source, but I seem to remember reading somewhere that modules had to initialise within the first few seconds of a mission.  Don't know if that's relevant, or even 100% correct - but, hey.  :)

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Experience with spawned modules ???
« Reply #2 on: 28 Jan 2010, 23:23:23 »
 Maybe its because  they are Logics  and these have to be created using createunit or something? or was it createvehiclelocal i forget so much these days ;).

 class BIS_animals_Logic : Logic
edit
infact i remember Giai said Create unit should be used  as :

"Actualy, you should. Using createVehicleLocal for spawning logic units is not 'legal' way how to do it and could cause some unexpected errors. "
« Last Edit: 28 Jan 2010, 23:26:31 by DeanosBeano »
I love ofp

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Experience with spawned modules ???
« Reply #3 on: 29 Jan 2010, 00:52:54 »
Thank you both,

I'll try it  :good:

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Fincuan

  • Members
  • *
Re: Experience with spawned modules ???
« Reply #4 on: 29 Jan 2010, 10:59:25 »
Also beware that if your module is one that needs things synced to it, like the artillery module, you'll have to do these synchronizations within 0.5 seconds of creating the module.