ncannasse / castle Goto Github PK
View Code? Open in Web Editor NEWA structured database with a local web service to edit it
License: ISC License
A structured database with a local web service to edit it
License: ISC License
First off, awesome work! I have everything up an running and can access my db within haxe... but now I'm wondering how else I can access my game data. So far I've seen that I can do the following:
[DB].[sheet].get([field]).[...]
[DB].[sheet].resolve(["field"]).[...]
[DB].[sheet].all[index].[...]
I've searched through this repo and googled extenisvely, but haven't turned up much. Is this basically the API or are there other ways to query my data? Thanks.
Is it possible to add a formula type so I can add a formula in a column instead of float or integer.
Usage example :
x*2+1
It will allow to quickly update a column based on a formula. For example, a game designer could just update a formula to define a correct value of a price for a given item, of a strength for a given character or whatever without updating all the rows himself.
When a custom type is defined, it can't contain List or Array structures
enum EventConsequence {
Goto( e : events );
IfThenElse( if : List, then :
List, else : List );
}
throws " Unknown type List "
Under what license is this software released?
Please put a license file in the root of the repo and headers on the source files to eliminate ambiguity.
with this message : Uncaught TypeError: Cannot read property 'args' of undefined castle.js:1663
I'll look into it someday.
edit: hmm problem is complexe since customTypes are stored by index...I'll leave it to you on how to delete them in this cases.
I'm currently working on a CastleDB file with 10 sheets (with more to come). When resizing the window's width down, the last sheets (most to the right) become inaccessible.
Maybe a "jump to a sheet" action, or key shortcuts for moving to previous/next sheet, would be neat?
D:\local\haxe\haxe\lib\castle/1,5,0/cdb/BinSerializer.hx:350: characters 108-109 : Unknown identifier : f
inline function fastField( v : Dynamic, n : String ) : Dynamic {
return #if (flash || js) untyped v[n] #elseif neko untyped $objget(v,$hash(n.__s)) #else Reflect.field(v, f.n) #end;
}
Should be Reflect.field(v, n)
, isn't it?
I've now tripped over this one too many times 😄
Scenario: I have a sheet with many columns, with at least a couple of enumeration columns, and while filling my sheet, I find myself adding new values to the enumeration as I discover more applicable values.
If I edit the column, enter a new enum value, and press enter, the Delete column action is then taken, instead of the Modify column one.
I feel like the default action when modifying a column should be "Modify". Better yet, some confirmation on column deletion would be really cool.
If we have created a new CDB and not saved it, request to do so on quit
I don't really care much because I can just use lowercase names, but this threw me off a bit when initially trying to use castledb. Having a sheet name like Enemies
messes up the automatic type creation a bit, probably because the name clashes with the type. If this isn't to be supported, it should at least give a sensible error message.
After modifying an image file in an external program, changes are not visible in CastleDB (in Tile
and File
columns), even if I select the file again or select another one and this one again to try to force the refresh.
Workaround: Restarting CastleDB
Hi!
I'm trying to get this to run with HaxeFlixel (is this compatible by the way?) by adding it into my project's project.xml file under the tag. I'm able to add in Data.hx with the macro, but when I try using Data in my playState by importing it and trying to use the object, I'm seeing a null object. Well, how do you retrieve the data from a cdb file then? I can't get the test hxproj to run either since I'm running into an error about g being a duplicate class. Haxe is at 3.2.0.
ArrayRead should be considered as Array (underlying type).
var a:ArrayRead;
// ...
Lambda.map(a, function(e) { ... });
Doesn't compile :)
The doc states:
You can select one row by clicking on its index, then select several of them by clicking while holding shift and clicking on other row indices.
You can select a range of cells by first selecting a cell then holding shift while clicking on another cell.
I can indeed select range of rows (or cells) with the shift key as the second phrase says, but I think there is an issue with the first phrase.
Either it's a repetition, or maybe an error and it should be ctrl
instead of shift
?
Even so, I haven't managed to select multiple non-adjacent rows (or cells) at a time using the ctrl
key. This behaviour also seems absent from the where it should be in the source (from what I can understand anyway)
I tried to compile castle db from git and creating new sheet is not working correctly. There are no errors or any other feedback on what went wrong.
I debugged it and it looks like the issue is that when new sheet is created it is not added to base.sheets array.
Castle current git version commit/e979833e3d8bc312c787a5217d8c4e3e149f64b9
Haxe 3.4.2
NWJS v0.22.0
There is a delay in the update of the layer stride: if I change the file for a given layer, the stride is not updated straight away, only after I select another file, and the stride is now the one from the previously selected file.
Example:
A
with a stride of 8
(as expected) when I created the layer.B
with a stride of 4
, the stride in the cdb file remains 8
.
B
again, the stride in the cdb file should now be 8
, as expected, because the previous file and this one are the same.C
with a stride of 16
, the stride in the cdb file is now 8
too, the previous selected file stride.Workaround: Selecting the file again (and sometimes, restarting CastleDB)
The following was reported (in french), I'm storing here so it doesn't get lost in my mails.
BUGS
WISHLIST
Would be lovely to be able to search in the sheets with a CTRL-F rather than explore the html content :)
Sometime the cpp compiler is whinning about a potential recursivity on all control path...then I had a look at what is generated :
::Cond CondBuilder_obj::build( Dynamic v){
HX_STACK_FRAME("CondBuilder","build",0x515f6639,"CondBuilder.build","cdb/Module.hx",598,0x02d48d44)
HX_STACK_ARG(v,"v")
HX_STACK_LINE(583)
int _g = v->__GetItem((int)0); HX_STACK_VAR(_g,"_g");
HX_STACK_LINE(568)
//We generate these way too early, it creates overheads..
::Cond _g1 = ::CondBuilder_obj::build(v->__GetItem((int)1)); HX_STACK_VAR(_g1,"_g1");
HX_STACK_LINE(568)
::Cond _g11 = ::CondBuilder_obj::build(v->__GetItem((int)2)); HX_STACK_VAR(_g11,"_g11");
HX_STACK_LINE(568)
::Cond _g2 = ::CondBuilder_obj::build(v->__GetItem((int)1)); HX_STACK_VAR(_g2,"_g2");
HX_STACK_LINE(568)
::Cond _g3 = ::CondBuilder_obj::build(v->__GetItem((int)2)); HX_STACK_VAR(_g3,"_g3");
HX_STACK_LINE(568)
::Cond _g4 = ::CondBuilder_obj::build(v->__GetItem((int)1)); HX_STACK_VAR(_g4,"_g4");
HX_STACK_LINE(568)
::Race _g5 = ::RaceBuilder_obj::build(v->__GetItem((int)1)); HX_STACK_VAR(_g5,"_g5");
HX_STACK_LINE(583)
::String _g6 = ::Std_obj::string(v); HX_STACK_VAR(_g6,"_g6");
HX_STACK_LINE(6)
switch( (int)(_g)){
case (int)0: {
HX_STACK_LINE(579)
return ::Cond_obj::Or(_g1,_g11);
}
;break;
case (int)1: {
HX_STACK_LINE(579)
return ::Cond_obj::And(_g2,_g3);
}
;break;
case (int)2: {
HX_STACK_LINE(579)
return ::Cond_obj::Not(_g4);
}
;break;
case (int)3: {
HX_STACK_LINE(579)
return ::Cond_obj::True;
}
;break;
case (int)4: {
HX_STACK_LINE(579)
return ::Cond_obj::False;
}
;break;
case (int)5: {
HX_STACK_LINE(579)
return ::Cond_obj::IsNear;
}
;break;
case (int)6: {
HX_STACK_LINE(579)
return ::Cond_obj::IsDominated;
}
;break;
case (int)7: {
HX_STACK_LINE(579)
return ::Cond_obj::AreWrestlers;
}
;break;
case (int)8: {
HX_STACK_LINE(579)
return ::Cond_obj::IsOppGrounded;
}
;break;
case (int)9: {
HX_STACK_LINE(579)
return ::Cond_obj::IsSelfGrounded;
}
;break;
case (int)10: {
HX_STACK_LINE(579)
return ::Cond_obj::IsRace(_g5);
}
;break;
case (int)11: {
HX_STACK_LINE(579)
return ::Cond_obj::CanTaboo;
}
;break;
case (int)12: {
HX_STACK_LINE(579)
return ::Cond_obj::Percent(v->__GetItem((int)1));
}
;break;
default: {
HX_STACK_LINE(583)
HX_STACK_DO_THROW((HX_CSTRING("Invalid value ") + _g6));
}
}
HX_STACK_LINE(6)
return null();
}
c:\workspace\catch\client\simulator\bin\windows\cpp\obj\src\condbuilder.cpp(130) : warning C4717: 'CondBuilder_obj::build' : recursive on all control paths, function will cause runtime stack overflow
What is interesting is that g1...g4 variables are generated too early and could be stubbed in the switch statement, which would introduce less overhead.
The cpp compiler is also wrong to generate the warning but hey, he cannot allways be right...
I put the issue here but it might be an issue for the cpp target...
Character error occurs when using non-Latin characters.
I have to many sheets in my project twelve (12 in total) and these sheets fill all the space available in the bottom of the screen. I can't find a way to scroll to the side and access the remaining sheets.
I'm using Mac OSX version here. (version 1.5)
When having [Item A | Separator | ItemB] moving the A below (or the B upper) should instead move the separator.
For application development the Map editor could be potentially useful but it does not seems to have any ability to position Quads with perhaps 1 or 4 colors, or TextFields with custom fonts. Also it would be nice to have Place holders where component would be inserted later.
Curious if this is a direction that would be suitable for castleDB.
In regard to Applications how would you approach dynamic castleDB where json differences could be transfered by say Haxe remoting and applied in real time or does this not seem sensible?
When scrolling a sheet with many rows, the headers scroll with the rows; ie. the headers are visible only when looking at the top screenful of rows.
The feature is known as "frozen rows" in Excel and Google Sheets, it's quite useful.
I'v created db file with simple sheet named pon with vars: "x , y , type , timestamp"
Can I create a new object of type pon inside code ?
var testPon = new DB.Pon();
after that line i'v get error : Pon does not have a constructor
Let me juste preface this issue with my love for everything you've created.
Now, my question.
Is there a way to remove a tile or an object from a layer in the Map Editor ? I looked a bit in the source but didn't find any, but it seems too important a feature to be missing.
When i copy paste the id column, the pasted code is json chunks rather thant text.
Maybe an option to copy text rather than json could be useful :)
Are all dependencies documented? Running into issues compiling on windows particularly with jquery and node-webkit imports.
Example offendesr:
import js.jquery.Helper.*;
import js.node.webkit.MenuItem;
From history tracking that appears to have been from hxnodejs from which it was removed?
JQuery was easy enough to handle just manually merging head against an older commit.
Hello.
Doc says,
"A custom type constructor parameter can use the following types:
SheetName any sheet name created in the database"
So I want to use a following custom type:
enum TemplateType { Reference( v: SheetName ); }
And getting error: 'Unknown type SheetName'
what am i doing wrong?
Deleting a sheet do not delete if from the database, so it is still exists after reloading.
A quick fix for me was adding
getSheetData()
method to Sheet class and
data.sheets.remove(sheet.getSheetData());
to the method deleteSheet in Database, but there might be a better way.
Doc states:
Data Layer
cbd.Types.Layer<SheetName>
: you can decode the layer by passing theData.sheetName.all
array to thedecode()
function.
Which decode()
function is it? The Layer<T>(String)
one or the TileLayerData(String)
one? And how should I access it?
Neither my Data
object, nor Data.sheetName.all
have a decode()
function and the types I tried in the cdb.Types
class only have encode()
functions, not decode()
PS: for the record, I know how to decode layers individually with the following code, but I understood there was another way.
for (layer in Data.levelDatas.get(LevelDatasKind.FirstVillage).layers) {
trace("name : " + layer.name);
trace("file : " + layer.data.file);
trace("size : " + layer.data.size);
trace("stride : " + layer.data.stride);
trace("data : " + layer.data.data.decode());
}
Whenever I try to open a .cdb file using CastleDB v1.5, the program stops responding, even before opening the file selection window.
Hi,
Adding value to the cdb using list is a little bit boring, since the new line button is far,
could we add Array to supported enum params so that writing batched of conditions get faster...
Also mapping new line to something like CTRL+N could help a lot.
Thanks !
None of the images would load under linux, to make it works I had to add "file://" at the beginning of the URL.
Simple fix I did was to add the "file://" under the getAbsPath function in Model.hx.
Not sure if this would affect things under win/mac. But just pointing that out for anyone else having the same issue.
It would be nice if there was an option to save enumerations as strings instead of their index value. I know it is a bit less efficient, but it is more convenient in my use case.
Hi !
It would be cool to have a custom.css that any user can edit along with the release of cdb.
It would make it easier than fork/commit/discuss to improve locally or share :)
Thanks
Allow to select a datatype that is one of the groups of a reference sheet
I just downloaded CastleDB from its website, unzipped and tried running it on my MacBook Pro 15" retina running Yosemite, and I got the following generic error message:
https://www.dropbox.com/s/adodeqsmdv56if4/Screenshot%202015-03-23%2012.19.30.png?dl=0
Any hints?
would be lovely and improve cooperation vastly.
enum Cond
{
IsNear; //sont a portee de prise
}
Thanks !
i have
import TechBaseKind;
var s = [Punch]; //which is a techbaseKind
//fails, cannot find symbol
to fix i have to do
import TechBaseKind;
import TechBaseKind.*;
From one of our previous discussions about import I believe the first import set should suffice.
Can you confirm ?
Thanks bro !
Level.hx - line:1890
(untyped content.find("[name=color]")).spectrum("set", ...........
bin/castle.js - line: 3212
var tmp1 = this.content.find("[name=color]").spectrum; // Line 3212
//........
tmp1("set",tmp2).closest(".item").css({ display : tmp3}); // Line 3235
variable "tmp1" seems to have lost the "context"
var _stackTrace = new StackTrace();
var frame = _stackTrace.GetFrame(0);
var _method = frame.GetMethod();
var _arguments = _method.GetParameters();
var strBuder = new StringBuilder();
for (int i = 0; i < _arguments.Length; i++)
{
var param = _arguments[i];
if (param.ParameterType.IsClass)
{
strBuder.Append(JsonConvert.SerializeObject(param.RawDefaultValue));
}
}
regardness
castle.js:11162 Uncaught TypeError: Cannot read property 'getDefault' of null at data_Sheet.newLine (castle.js:11162) at Main.newLine (castle.js:6541) at Main.insertLine (castle.js:6547) at <anonymous>:1:3
It looks like the sheet's that are created for the list columns has field "base" equals null for some reason
New Column -> Column type = Custom type. The [create]
button next to Type
gives a Uncaught TypeError: undefined is not a function
error.
CastleDB version 1.5
Python got the Enum class in Python 3.4. It would be nice if we could have a wrapper for Castle-format JSON files into enums.
It should be possible to lock an unique identifier (the whole list or a single) in order to prevent its modification and the removal of the line (will ask to unlock first).
This would ensure that no edition is possible once the data is stored in some live database
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.