ZeroBrane Studio and DSB

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
iGame3D
Novice
Posts: 28
Joined: 18-Dec-08 18:02
Location: Hotel Colorado
Contact:

ZeroBrane Studio and DSB

Post by iGame3D » 13-Apr-15 05:27

Zerobrane studio is a Lua IDE that I've been meaning to make launch DSB
for a long time and I finally sat down to work it out today. So here we go.

Open your DSB application directory
Select all files and copy

Download Zerobrane Studio
Install it and navigate to the ZeroBrane Studio/bin directory
Paste the (the DSB files and executable) into the bin directory.

Copy/Paste this text and save it to ZeroBrane Studio/interpreters/dsb64.lua

Code: Select all

local exe

local function exePath()
  local mainpath = ide.editorFilename:gsub("[^/\\]+$","") --ide.editorFilename:gsub("[^/\\]+$","")
  local macExe = mainpath..'bin/'
  return (ide.osname == "Windows" and mainpath..[[bin\DSB.exe]]
    -- or  (ide.osname == "Unix" and [[""]]) --no igame3d on unix
    -- or  (wx.wxFileExists(macExe) and macExe or mainpath..[["DSB"]])) --test needed
end

return {
  name = "dsb64",
  description = "Dungeon Strikes Back",
  api = {"baselib"},
  frun = function(self,wfilename,rundebug)
    exe = exe or exePath()
     if rundebug then DebuggerAttachDefault() end

    local cmd = ('"%s" "%s"'):format(exe, wfilename:GetFullPath())
    -- CommandLineRun(cmd,wdir,tooutput,nohide,stringcallback,uid,endcallback)
    return CommandLineRun(cmd,self:fworkdir(wfilename),true,false,nil,nil,
      function() ide.debugger.pid = nil end)
  end,
  fprojdir = function(self,wfilename)
    return wfilename:GetPath(wx.wxPATH_GET_VOLUME)
  end,
  fworkdir = function (self,wfilename)
    return ide.config.path.projectdir or wfilename:GetPath(wx.wxPATH_GET_VOLUME)
  end,
  hasdebugger = true,
  fattachdebug = function(self) DebuggerAttachDefault() end,
  skipcompile = true,
  scratchextloop = true,
  unhideanywindow = true,

}
Note some the reference text 'dsb64' might need to be updated for a future DSB version.
I imagine ZeroBrane will work for the editor as well, just change the dsb refs to esb and save as /interpreters/esb.lua


Navigate to ZeroBrane Studio/bin/base/startup.lua
Right click and choose Open With ... ZeroBrane Studio.
You may need to browse to the application if Windows doesn't offer it to you.

You may also choose the .lua file, Right Click and choose Properties
and Change the "Opens With..." option to ZeroBrane Studio.exe

With startup.lua open in ZeroBrane Studio
Project Menu > Project Directory > Choose... and navigate to the ZeroBrane Studio/Bin folder
Then Project Menu > Lua Interpreter > dsb64

Then hit the little green play button in the ZeroBrane Studio toolbar and DSB should launch to ask you for a folder to play your game from, choose test_dungeon and the game should run as normal.

I'll leave it to you all to figure out how best to use this IDE for your DSB editing fun.
You may be able to leave your DSB in it's default install location and still use it with ZeroBrane but that would require some more fussing with that interpreter .lua file.

iGame3D
Novice
Posts: 28
Joined: 18-Dec-08 18:02
Location: Hotel Colorado
Contact:

Re: ZeroBrane Studio and DSB

Post by iGame3D » 13-Apr-15 07:07

Ooops.

'ZeroBrane Studio.exe' is actually labeled zbstudio.exe

Sorry for that misprint.

Post Reply