Particles before the scene load

  • #1, z PaupasiaTuesday, 07. February 2017, 18:47 hodinky 8 years ago
    Some questions about Particle System grin

    - I have a few scenes where it snows. Is it possible to do so when the scene is loaded the snow is already fully visible?
    In this way I would avoid the loading time of the particles in the scene making everything more realistic.
    The new function ' warmup ' allows this?

    - Can I assign a particle at multiple scenes to be loaded once?

    - Is it possible to create a random system of particles?
       For example, every 10 minutes of the game make it rain and then after 10 minutes stop the rain?

    So many questions I know  grin


    Fanoušek fóra

    165 Posts


  • #2, z AkcayKaraazmakTuesday, 07. February 2017, 19:04 hodinky 8 years ago
    Great question smile

    Čestný člen

    440 Posts

  • #3, z afrlmeTuesday, 07. February 2017, 20:05 hodinky 8 years ago
    There's quite a few fields in the data structure related to the particle system, so I assume you should be able to tweak things with Lua script to do with x particle system & which particle systems are linked to which scene & which are active or inactive, etc. I'm not too savvy on the particle system (yet) as I've not had much cause to delve into it, but I will probably get around to it at some point - so this is about all the information I can offer. I guess only Simon or maybe Alex can offer the full details on what is actually possible.

    Imperátor

    7285 Posts

  • #4, z PaupasiaWednesday, 08. February 2017, 03:32 hodinky 8 years ago
    I guess only Simon or maybe Alex can offer the full details on what is actually possible
    I hope so   grin

    Fanoušek fóra

    165 Posts

  • #5, z PaupasiaThursday, 09. February 2017, 18:54 hodinky 8 years ago
    While waiting for help from the developers I have solved part of my post.
    As I hoped, the "warmup" Tab takes to preload of the particles and setting the "warmup" to about 170 the rain fills the entire screen when the scene is loaded.

    About the second question, I know that by connecting the Particles to an object in the scene automatically loads the desired effect.
    This is perfect for new scenes in which to place a empty object linked to a condition and then activated as desired.
    But do this for say 150 old scenes is panic.

    I thought to get around the problem by inserting an automatic command within an interface (like at beginning of scene) that I could recall very easily within the game, but I don't know how to do to not weighing it down.

    The best would be to invoke the object particle by a command in Lua like you use for any other object type, for example local getInterface = getObject (' Interfaces [inventory] ') where instead of interface there is Objectparticlesystem but I have no idea how to do it. 



    Fanoušek fóra

    165 Posts

  • #6, z afrlmeThursday, 09. February 2017, 19:37 hodinky 8 years ago
    Sorry. I'm not sure & according to the data structure neither scene particle system or object particle system is scriptable.

    There's also a mistake in the data strucute page in the wiki as objectparticlesystem says it's linked to particlesystem but we don't have a table for that - I assume it means particlecontainer which can contain multiple particle systems. If particles can be obtained with Lua script then I'm not sure if they would be done like so...
    Particles["example"]

    or...
    ParticleContainers["name"].ContainerParticles["name"]

    Imperátor

    7285 Posts

  • #7, z PaupasiaThursday, 09. February 2017, 19:49 hodinky 8 years ago
    Thanks a lot Lee,

    I've found here Vis 3.x  http://wiki.visionaire2d.net/index.php?title=Data_Structure_...

    that the table is "particlescontainer"
    the Field "ParticleContainerParticles"
    Field type  t_links to Particles (parent)
    Description "All particle emitters of this particle system."

    but not scriptable.
    Unfortunately the script don't work, but thanks again for your reply grin

    Fanoušek fóra

    165 Posts

  • #8, z afrlmeThursday, 09. February 2017, 20:21 hodinky 8 years ago
    That's the old wiki. In regards to not scriptable... just because it says it isn't scriptable, doesn't mean that it isn't. Sometimes it just means that the updated data doesn't get stored in the save game files. Sometimes though they aren't scriptable or require the scene to be reloaded before changes will take effect. Bit of a guessing game half the time. razz

    Imperátor

    7285 Posts

  • #9, z PaupasiaThursday, 09. February 2017, 22:53 hodinky 8 years ago
    Lol I'll wait for the new wiki and the new Lua functions to see if something is changed grin

    Fanoušek fóra

    165 Posts

  • #10, z afrlmeThursday, 09. February 2017, 23:04 hodinky 8 years ago
    Lol I'll wait for the new wiki and the new Lua functions to see if something is changed grin
    I doubt you will see much change in the data structure page. The new functions will likely be added to the player functions wiki page - well, when Simon gets round to sorting out some examples.

    Imperátor

    7285 Posts