Page 1 of 1

The DungeonToolKit (Plug-in!)

PostPosted: Sat Apr 13, 2013 10:52 pm
by Fordcars
Yep, me again posting stuff

I made this plug-in to make nice levels faster! You can add delayed teleporters, spinning Speed Zones, energy items, ghost ships, scaled asteroids or turrets with different weapons all in-game without even touching the level file!

WARNING: This plug-in will not work in 019 or later

  Code:
---- DUNGEON TOOLKIT
---- by fordcars
---- I will try to keep this plug-in up-to-date


function getArgsMenu()

    return "Dungeon ToolKit",
        {
            ToggleMenuItem.new("Select Item", {"DelayedTeleport", "TurretWeapon", "RotatingSpeedZones", "EnergyItem", "GhostShip", "ScaledAsteroids"}, 1, true, "Pick one!"),
            CounterMenuItem.new("Delayed Teleport", 2, 1, 0, 100, "seconds", "", "The amount of time before the teleporter will be usable again", "Select a delay time"),
            ToggleMenuItem.new("Turret Weapon", {"Phaser", "Triple", "Burst", "Bouncer", "Seeker"}, 1, true, "Pick a weapon!"),
            CounterMenuItem.new("Rotating SpeedZone", 1, 1, 0, 100, "", "", "The speed of the rotating speed zone", "Select a speed"),
            CounterMenuItem.new("Asteroid Size", 1, 1, 0, 14, "", "", "The size of the asteroid", "Select a size"),
            CounterMenuItem.new("Ghost Ship X", 0, 1, 0, 999999999, "", "", "The X coord of ghost ship", "Select coord"),
            CounterMenuItem.new("Ghost Ship Y", 0, 1, 0, 999999999, "", "", "The Y coord of ghost ship", "Select coord")
        }
end

function main()

    local itemSel    = arg[1]
    local delay      = arg[2]
    local turWeapon  = arg[3]
    local rotZone    = arg[4]
    local astSize    = arg[5]
    local ghostX     = arg[6]
    local ghostY     = arg[7]
    local levelLine  = nil

    if (itemSel == "DelayedTeleport") then
        levelLine = "Teleporter 0 0 1 0 Delay=" .. delay
    end
    if (itemSel == "TurretWeapon") then
        levelLine = "Turret -1 0 0 0 W=" .. turWeapon
    end
    if (itemSel == "RotatingSpeedZones") then
        levelLine = "SpeedZone 0 0 0.5 0 2000 Rotate=" .. rotZone
    end
    if (itemSel == "EnergyItem") then
        levelLine = "EnergyItem 0 0 20"
    end
    if (itemSel == "GhostShip") then
        levelLine = "Ship 0 " .. ghostX .. " " .. ghostY
    end
    if (itemSel == "ScaledAsteroids") then
        levelLine = "Asteroid 0 0 Size=" .. astSize
    end

    plugin:addLevelLine(levelLine)

end


 


To install this plug-in, put this code in a document named "dungeonToolKit.lua" and put this document in the "editor_plugins" folder (located with the bitfighter.ini) and type "Plugin2=Ctrl+.|dungeonToolKit.lua|Make dungeons!" under the [EditorPlugins] section of your "bitfighter.ini".

Enjoy!

UPDATE: I added Ghost Ships, Energy Items and Scaled Asteroids!

Re: The DungeonToolKit (Plug-in!)

PostPosted: Wed Dec 04, 2013 10:43 am
by sky_lark
I think at least part of this plugin might be broken in 019. I can't add delayed teleports or turret weapons, for example.

Re: The DungeonToolKit (Plug-in!)

PostPosted: Wed Dec 04, 2013 10:58 am
by raptor
Evil. Just... Evil

Standard developer warning:

Any of these objects or options can disappear at any time or be broken from one release to another.

Thank you and have a nice day!

Re: The DungeonToolKit (Plug-in!)

PostPosted: Wed Dec 04, 2013 12:15 pm
by Quartz
raptor wrote:Evil. Just... Evil

Standard developer warning:

Any of these objects or options can disappear at any time or be broken from one release to another.

Thank you and have a nice day!
We've known that for some time lol. Fordcars just made it more convenient.

I guess this is to compensate for the fact that I can't even figure out how to use the new editor. So many keystrokes are different, I'm fucking confused.

Re: The DungeonToolKit (Plug-in!)

PostPosted: Wed Dec 04, 2013 4:28 pm
by Fordcars
raptor wrote:Evil. Just... Evil

Standard developer warning:

Any of these objects or options can disappear at any time or be broken from one release to another.

Thank you and have a nice day!


Mhahahah :twisted:

And that is why I wrote "I will try to keep this plug-in up-to-date" in the beginning of the file :P

This doesn't work now anyway since addLevelLine doesn't work anymore :)

Re: The DungeonToolKit (Plug-in!)

PostPosted: Wed Dec 04, 2013 6:05 pm
by sky_lark
Fordcars wrote:This doesn't work now anyway since addLevelLine doesn't work anymore :)

Totally broken? eep

Re: The DungeonToolKit (Plug-in!)

PostPosted: Wed Dec 04, 2013 8:55 pm
by Fordcars
Shouldn't be difficulty to fix though. I think it's now plugin:addItem or something :ugeek:

Re: The DungeonToolKit (Plug-in!)

PostPosted: Thu Dec 05, 2013 1:05 am
by sky_lark
Oh, ok. I've had to stop being lazy and manually type the objects into the level file, so I'm relieved to hear not all hope is lost. ;)

Re: The DungeonToolKit (Plug-in!)

PostPosted: Thu Dec 05, 2013 7:04 pm
by Fordcars
:P

Re: The DungeonToolKit (Plug-in!)

PostPosted: Thu Dec 05, 2013 7:13 pm
by Fordcars
Poop, I am trying to update this, but I think I'll have to manually open the file and add the level line :/

Sorry devs!

Re: The DungeonToolKit (Plug-in!)

PostPosted: Sat Dec 13, 2014 3:45 pm
by amgine
what about slip zones and circle items!

Re: The DungeonToolKit (Plug-in!)

PostPosted: Mon May 18, 2020 4:05 pm
by bobdaduck
Quick and dirty dirty dirty update for this plugin. Most features devs have hard-locked out of lua, and the turret:setWeapon() function seems to be totally broken, so this iteration includes ONLY:
- Scaled asteroids (you can scale them in the editor, but not THIS much!
- Slipzone (idk what people use these for, racetracks?)
- EnergyItem (bitfighter goes green!)

Just take the code and put it in the editor_plugins folder as "dungeon_toolkit.lua" (text file and then changing the file extension is fine) then F4 in level editor to use. I just made it so it adds everything at 0,0 so look for your objects there.

  Code:
--Dungeon Toolkit by fordcars

function getArgsMenu()

    return "Dungeon ToolKit",
        {
            ToggleMenuItem.new("Select Item", { "EnergyItem", "ScaledAsteroids", "SlipZone"}, 1, true, "Pick one!"),
            ToggleMenuItem.new("Turret Weapon", {"Weapon.Phaser", "Weapon.Triple", "Weapon.Burst", "Weapon.Bouncer", "Weapon.Seeker", "Weapon.Mine", "Weapon.SpyBug"}, 1, true, "Pick a weapon!"),
            CounterMenuItem.new("Rotating SpeedZone", 1, 1, 0, 100, "", "", "The speed of the rotating speed zone", "Select a speed"),
            CounterMenuItem.new("Asteroid Size", 1, 1, 0, 14, "", "", "The size of the asteroid", "Select a size"),
        }
end

function main()

    local itemSel    = arg[1]
    local turWeapon  = arg[2]
    local rotZone    = arg[3]
    local astSize    = arg[4]

    local object

    --if (itemSel == "TurretWeapon") then
        --object = Turret.new()
        --object:setPos(point.new(0,0))
        --logprint(turWeapon)
        --object:setWeapon(turWeapon)
    --end
    --if (itemSel == "RotatingSpeedZones") then
       -- levelLine = "SpeedZone 0 0 0.5 0 2000 Rotate=" .. rotZone
    --end
    if (itemSel == "EnergyItem") then
        object = EnergyItem.new()
        object:setPos(point.new(0,0))
    end
    --if (itemSel == "GhostShip") then
       -- object = Robot.new()
       -- object:setPos(point.new(0,0))
    --end
    if (itemSel == "ScaledAsteroids") then
        object = Asteroid.new()
        object:setPos(point.new(0,0))
        object:setSize(astSize)
    end
    if (itemSel == "SlipZone") then
        object = SlipZone.new()
        object:setGeom(point.new(0,0), point.new(1,1), point.new(2,2))
    end
    bf:addItem(object)

end

Re: The DungeonToolKit (Plug-in!)

PostPosted: Tue May 19, 2020 7:33 pm
by Fordcars
bobdaduck wrote:Quick and dirty dirty dirty update for this plugin. Most features devs have hard-locked out of lua, and the turret:setWeapon() function seems to be totally broken, so this iteration includes ONLY:
- Scaled asteroids (you can scale them in the editor, but not THIS much!
- Slipzone (idk what people use these for, racetracks?)
- EnergyItem (bitfighter goes green!)

Just take the code and put it in the editor_plugins folder as "dungeon_toolkit.lua" (text file and then changing the file extension is fine) then F4 in level editor to use. I just made it so it adds everything at 0,0 so look for your objects there.

  Code:
--Dungeon Toolkit by fordcars

function getArgsMenu()

    return "Dungeon ToolKit",
        {
            ToggleMenuItem.new("Select Item", { "EnergyItem", "ScaledAsteroids", "SlipZone"}, 1, true, "Pick one!"),
            ToggleMenuItem.new("Turret Weapon", {"Weapon.Phaser", "Weapon.Triple", "Weapon.Burst", "Weapon.Bouncer", "Weapon.Seeker", "Weapon.Mine", "Weapon.SpyBug"}, 1, true, "Pick a weapon!"),
            CounterMenuItem.new("Rotating SpeedZone", 1, 1, 0, 100, "", "", "The speed of the rotating speed zone", "Select a speed"),
            CounterMenuItem.new("Asteroid Size", 1, 1, 0, 14, "", "", "The size of the asteroid", "Select a size"),
        }
end

function main()

    local itemSel    = arg[1]
    local turWeapon  = arg[2]
    local rotZone    = arg[3]
    local astSize    = arg[4]

    local object

    --if (itemSel == "TurretWeapon") then
        --object = Turret.new()
        --object:setPos(point.new(0,0))
        --logprint(turWeapon)
        --object:setWeapon(turWeapon)
    --end
    --if (itemSel == "RotatingSpeedZones") then
       -- levelLine = "SpeedZone 0 0 0.5 0 2000 Rotate=" .. rotZone
    --end
    if (itemSel == "EnergyItem") then
        object = EnergyItem.new()
        object:setPos(point.new(0,0))
    end
    --if (itemSel == "GhostShip") then
       -- object = Robot.new()
       -- object:setPos(point.new(0,0))
    --end
    if (itemSel == "ScaledAsteroids") then
        object = Asteroid.new()
        object:setPos(point.new(0,0))
        object:setSize(astSize)
    end
    if (itemSel == "SlipZone") then
        object = SlipZone.new()
        object:setGeom(point.new(0,0), point.new(1,1), point.new(2,2))
    end
    bf:addItem(object)

end


Thanks for keeping the dungeon spirit alive!