Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Hi everyone, me again. I'm trying to make a style for my game using dialogueizer, and I got it working as intended when the dictionary is defined in the widget I'm calling dd.open from, but if I try to store it elsewhere and reference it (closest I've gotten is a grid), it doesn't seem to be able to pass all the data. Is it possible for me to be able to store the style once and reuse it without copy-pasting code?

namely, I've having trouble with size (I can make it work if I manually set the numbers, but I'd like to use the other widget's size if possible) and position (no idea how to make that one work).

My calling code:

on click do
 dd.open[deck style.value]
 dd.say["test"]
 dd.close[deck]
end

My grid JSON  :

{
    "size":["dialoguewindow.size"],
    "bborder":["deck.contraptions.bracket"],
    "balign":["left"],
    "pos":["dialoguewindow"],
    "speed":[2]
}
(+2)

Normally the way I set up a style to reference in multiple places I'll just put it in the deck level script. Then it's in scope for wherever I'm referencing it in code. Depending on what you're doing, it could make more sense for the card level script, it's up to you

As an example, here's something I grabbed from an old project - this is just in the top level deck script, not inside any "on such and such do" events.

ddstyle:()
ddstyle.fcolor:colors.black
ddstyle.bcolor:colors.white
ddstyle.speed:3
ddstyle.border:deck.contraptions.border
ddstyle.next:image["%%IMG2AAgABwACAQYAAQEBJAUBAiQGAQIkBgECJAYBAiQFAQEAAQEGAAI="]
ddstyle.nextd:20

And then I can just call like dd.open[deck ddstyle] from anywhere.

I'm guessing the grid isn't working for you is because it's passing in like a string containing the text "deck.contraptions.bracket" instead of a reference to the actual bracket contraption.

(1 edit) (+1)

Thank you! I did try this earlier but I didn't know how to reference it ( was putting deck.ddstyle). It can handle the position! but it seems like it can't handle the size from calling dialoguewindow.size. (but I can just set the size manually since I have the measurements). Thank you so much!

(+1)

I think if you wanted to reference something off another object you'd need to do it in a card-agnostic manner, something like card1.widgets.dialoguewindow.size, if that helps