Add Rockets To STKM Using Lua API

  • BrianTheEngineer
    7th Dec 2019 Member 0 Permalink

    How can I add rocket boots to STKM, STK2, and FIGH with Lua API?

  • LBPHacker
    7th Dec 2019 Developer 0 Permalink

    You can't. Unless of course you're willing to spawn gravity wall under the stickmen, wait one frame, and then unspawn the wall.

  • BrianTheEngineer
    7th Dec 2019 Member 0 Permalink

    I could have sworn there was a command that did that. What about regular in the console commands?

  • LBPHacker
    7th Dec 2019 Developer 0 Permalink

    I'm not aware of one.

  • BrianTheEngineer
    7th Dec 2019 Member 0 Permalink

    I found the command!!! Apparently it only works in Jacob1's Mod so maybe that is why you couldn't find it?

    Edited once by BrianTheEngineer. Last: 7th Dec 2019
  • jacob1
    7th Dec 2019 Developer 0 Permalink
    The API in my mod is documented here: https://powdertoy.co.uk/Wiki/W/Lua_Functions_in_Jacob1%27s_Mod.html#sim.stickman

    But if I add it to official, I'm almost certainly going to change it. I don't really like the API now.
  • BrianTheEngineer
    7th Dec 2019 Member 0 Permalink

    @jacob1 (View Post)

     

    How does the spawnID function work though?

     

    if sim.partProperty(sim.stickman(1"spawnID"), "ctype"== elem.DEFAULT_PT_WATR then

        sim.partProperty(sim.stickman(1, "spawnID"), "life", sim.partProperty(sim.stickman(1"spawnID"), "life"+ 1)

    end
     
    The following code is not working for some reason. I checked everything so I think the only way it is flawed is something about the sim.stickman function.
    Edited once by BrianTheEngineer. Last: 7th Dec 2019
  • jacob1
    7th Dec 2019 Developer 0 Permalink
    @BrianTheEngineer (View Post)
    spawnID is the ID of the SPWN particle, not of the stickman. That isn't what you want.

    You should set an update function on STKM and use the ID passed into that function. This update function will only run when STKM is active, which is also a benefit.
  • BrianTheEngineer
    8th Dec 2019 Member 0 Permalink

    What ID in the update function? The iterator?