Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

General Decker Question and Answer Thread Sticky

A topic by ahmwma created 33 days ago Views: 457 Replies: 8
Viewing posts 1 to 4
(+4)

Some users have mentioned having a question or two that were small enough that they didn't feel like they wanted to make a new thread.

So here's a place to ask and answer general questions about Decker.

No question too small or silly! It's always good to ask if you're feeling confused about something

-----

If your question is about Lil (the scripting language) specifically you could check out the Lil Programming Questions thread instead.

Hey! I'm  trying to build decker on linux and I'm getting an error. Mind you that I have close to 0 coding knowledge and its a miracle I'm able to even use linux so the problem  might be obvious.


$ make

In file included from ./c/decker.c:3:

./c/dom.h: In function ‘deck_write’:

./c/dom.h:2882:37: error: ‘js_decker_html’ undeclared (first use in this function)

 2882 |                 str_addz(&r,lmiutf8(js_decker_html,js_decker_html_len));

      |                                     ^~~~~~~~~~~~~~

./c/dom.h:2882:37: note: each undeclared identifier is reported only once for each function it appears in

./c/dom.h:2882:52: error: ‘js_decker_html_len’ undeclared (first use in this function)

 2882 |                 str_addz(&r,lmiutf8(js_decker_html,js_decker_html_len));

      |                                                    ^~~~~~~~~~~~~~~~~~

./c/dom.h:2891:37: error: ‘js_lil_js’ undeclared (first use in this function)

 2891 |                 str_addz(&r,lmiutf8(js_lil_js,js_lil_js_len));

      |                                     ^~~~~~~~~

./c/dom.h:2891:47: error: ‘js_lil_js_len’ undeclared (first use in this function)

 2891 |                 str_addz(&r,lmiutf8(js_lil_js,js_lil_js_len));

      |                                               ^~~~~~~~~~~~~

./c/dom.h:2892:37: error: ‘js_danger_js’ undeclared (first use in this function)

 2892 |                 str_addz(&r,lmiutf8(js_danger_js,js_danger_js_len));

      |                                     ^~~~~~~~~~~~

./c/dom.h:2892:50: error: ‘js_danger_js_len’ undeclared (first use in this function)

 2892 |                 str_addz(&r,lmiutf8(js_danger_js,js_danger_js_len));

      |                                                  ^~~~~~~~~~~~~~~~

./c/dom.h:2893:37: error: ‘js_decker_js’ undeclared (first use in this function)

 2893 |                 str_addz(&r,lmiutf8(js_decker_js,js_decker_js_len));

      |                                     ^~~~~~~~~~~~

./c/dom.h:2893:50: error: ‘js_decker_js_len’ undeclared (first use in this function)

 2893 |                 str_addz(&r,lmiutf8(js_decker_js,js_decker_js_len));

      |                                                  ^~~~~~~~~~~~~~~~

In file included from ./c/decker.c:9:

./c/io_sdl2.h: In function ‘base_path’:

./c/io_sdl2.h:75:87: warning: zero-length gnu_printf format string [-Wformat-zero-length]

   75 |         if(t){snprintf(path,PATH_MAX,"%s",t);SDL_free(t);}else{snprintf(path,PATH_MAX,"");}

      |                                                                                       ^~

./c/decker.c: In function ‘main’:

./c/decker.c:4314:57: error: ‘examples_decks_tour_deck’ undeclared (first use in this function)

 4314 |         if(!deck){str doc=str_new();str_add(&doc,(char*)examples_decks_tour_deck,examples_decks_tour_deck_len);load_deck(deck_get(lmstr(doc)));}

      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~

./c/decker.c:4314:82: error: ‘examples_decks_tour_deck_len’ undeclared (first use in this function)

 4314 |        if(!deck){str doc=str_new();str_add(&doc,(char*)examples_decks_tour_deck,examples_decks_tour_deck_len);load_deck(deck_get(lmstr(doc)));}

      |                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

make: *** [Makefile:66: c/build/decker] Error 1

(+1)

The js_decker_html variable should be defined in c/resources.h which should be automatically built when it needs to be.

If you rm c/resources.h and then make V=1 c/resources.h do you get any error message?

(1 edit) (+2)

Doing that solved the issue! Thanks!:-) You're getting a special thanks in my first decker project lol

I'm slightly surprised/confused by the behavior of the new pattern/color support in text fields.

It seems as if the pattern doesn't persist past whatever text you initially marked with that pattern. If I write out some text and make it green, if I continue to then write further text past that, it will revert back to the default black, and my new added text will be black. I also can't set the whole field to a specific pattern, so as to change that black default, at least not from what I can see from the GUI.

This is in contrast to the behavior when changing fonts, where the behavior is such that any text I write past the point where I changed the font will continue to be in that font. This does have some wrinkles that aren't always intuitive when mixing fonts, but it does mean I continue to write into a text field in that font as expected without any special interaction, and I can save myself even those headaches by just setting the font property of the field itself, thus insuring that it defaults back to that font.

I bring all this up because it sort of negatively effects my workflow to how I've been working with text fields for the current project. When I'm writing a long card of text, usually my method is just to make one large field on the card, set the default font of that, and then I take advantage of interact mode's ability to just write directly into the field. Makes it easier to write long texts rather than doing it in the field properties. 

But this kinda doesn't work with the color support, because I can't set the field to be all one color and just write away. Plus, on my current project, the text is over a mostly black background, so it's unreadable until I change the color. It's a minor detail, and I can work around it, it's just unexpected I guess.

(+3)

So this might help a bit, but basically there's two ways of setting the colour/pattern of text in a field. It sounds like what you're doing is using the "select a bunch of text and change it with the text menu" option, which yeah does seem to not affect newly added text. But you can also select the field in widget mode, go into the properties (double-click or widget -> properties) and then there's a "pattern" button. If you set the pattern or colour there, that becomes the default for that field, so when you're writing into it in interact mode it'll come up as the colour you want. Hopefully this helps / makes sense.

(+1)

oh! all those words and yet so there is a button for that. that should make this much easier but also begs the question how I missed it. 😜

I have some cards with a bunch of fields in them, and I want them to line up nicely, so I used the “snap to grid” function. Eventually I decided that the default 16x16px grid was a bit too chunky, and dropped down to an 8x8px grid so I could have spaces smaller than a field, as well as larger.

But now when I need to adjust a field, I have to go in and change the grid spacing back to 8x8px every time - it defaults to 16x16px every time I start Decker.

Is there a way to have the default grid size stored in the deck?

Developer(+2)

Currently grid settings aren't persisted anywhere, but I'll give it some thought; possibly it could be stored in deck files, or perhaps it might make sense to expose scripted control via the app interface.