Console on start of simulation

  • kungfushark
    14th May 2015 Member 0 Permalink

    Is there a way that I can run a console command at the start of a simulation?

     

    Thanks, 

    kungfushark

  • jacob1
    14th May 2015 Developer 0 Permalink
    yes, create a file called autorun.lua (make sure it is autorun.lua and not autorun.lua.txt or something).

    In that put any lua commands or scripts that you want.

    I also recommend that you look at https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=19400 , it is a script manager which keeps track of and loads scripts for you on startup. And you can download new ones from there too.
    Edited once by jacob1. Last: 14th May 2015
  • kungfushark
    14th May 2015 Member 0 Permalink

    Thanks, but is there are way to use the powder toy console (like !set) at the start of a simulation?

     

    Thanks,

    kungfushark

  • io
    14th May 2015 Member 0 Permalink

    If you mean at start of every save, maybe with a mod. (only you will see that).

    <br>

  • jacob1
    14th May 2015 Developer 0 Permalink
    There is a function called sim.getSaveID() that returns the save ID. There isn't really a way to hook loading or completely tell when a save is loaded though. But you could probably register a step function to run some commands when sim.getSaveID() is what you want it to be.

    Also you can't use !set inside of scripts, that is the old legacy console and has almost no features.
  • kungfushark
    14th May 2015 Member 0 Permalink

    Maybe there is a different way to approach this. I have a bomb that requires deut life to be 999999. I want to publish this bomb. When I publish it, and then enter the simulation, the deut life is not 999999. Maybe there is a different way to acomplish this.

     

    Thanks,

    kungfushark

  • Jokersona
    14th May 2015 Member 0 Permalink

    kungfushark:

    Maybe there is a different way to approach this. I have a bomb that requires deut life to be 999999. I want to publish this bomb. When I publish it, and then enter the simulation, the deut life is not 999999. Maybe there is a different way to acomplish this.

     

    Thanks,

    kungfushark

     

    65536 is the max for life. Thats why. Also deut exploding at that high is already laggy, why would you want it higher?

    Edited once by ChargedCreeper. Last: 14th May 2015
  • io
    14th May 2015 Member 0 Permalink

    As my question: Is there any lua function to execute old console commands? Can lua massively change props. (not only to one 

    article or one by one?

    Isn't better layered deut with life 65535, or layered over a EHOLE wall, to make more than 2000 layers.

    Edited once by io. Last: 14th May 2015
  • kungfushark
    14th May 2015 Member 0 Permalink

    Ok, thanks, I've got a solution. Thanks very much for your help.

     

    Goodbye,

    kungfushark

  • boxmein
    15th May 2015 Former Staff 0 Permalink
    @io (View Post)
    Yes, Lua can massively change properties - there are selections for particles via either type, X/Y, X/Y and type, ID, etcetera.

    I feel like making a quick selector engine..
    Edited once by boxmein. Last: 15th May 2015