Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Question on Puppeteer & Dialogizer

A topic by LavaRamen created 16 days ago Views: 117 Replies: 13
Viewing posts 1 to 2

Back with more questions ><! Hope I'm not being dumb

I'm working on a visual novel using the Puppeteer and Dialoguer modules, so far I was able to follow the digital guides pretty well! Problem occurred concerning this page from the guide:

In my deck I have added the two modules, and added the dispatching code into the deck script, like so:

on command x do pt.command[deck x] end
on animate   do pt.animate[deck]   end

I have the puppets in place, and can call on them fine

It's just that, like this testing ground here:


with the test button as so:

on click do
 dd.open[deck]
 dd.say[script.value]
 dd.close[]
 pt.clear[]
end

and the field value as shown, it should animate the puppet as well as saying the text,,,,, or so I think? Almost an exact copy from the digital tour of Puppeteer: !show NAME EMOTE POS

But it ignores the three commands above and only says "test"

Further checking proves the "!anim" command also doesn't work for my puppets:

!show NAME EMOTE customPOS         #this works just fine
!anim NAME EMOTE bob               #this does not work
#I suspect it might be because of the custom position, as I've returned to the digital guide
#and added the !anim command to the custompos boxy page
#it didn't work
"!show NAME EMOTE center"
"!anim NAME EMOTE bob"
#the puppets positioned itself on topleft and did not move

So far my solution is calling on a card-level change of dialog box appearance and puppeetering, adding !commands in the rich text field being read out, and putting custom command edits in the card script, eg.

on command x do
if x~"tup"
o.speed:2
o.fcolor:colors.black
o.bcolor:colors.white
o.align:"right"
dd.style[o]
pt.command[deck
"!show katurian close left1"
]
elseif etc.etc.

it works but I fear it might be bulky in the future, and animating in the rich text field would be convenient. Also the fact that it doesn't work is bugging me

I have uploaded a temp backup html copy of my project onto itch, it can be seen here https://lavaramen.itch.io/the-pillowman-vsn?secret=BfecXsA0zXrSBOposna87Cemsk in case anyone wants to check out the code,,,, The last reply for the enum ask was super useful so I'm mustering up the courage to ask again. Hope the question makes sense, really bummed, thanks in advance!

also is it possible to copy and past rich text? I'm mass-editing a lot of repeating header-font text in a field and it'd be lovely if I can copy rich-text and paste back rich-text

really worried that these questions are dumb() sorry!)

also the project deck probably looks best if one switches to the first card and starts there() looks a bit messy otherwise 

Developer

I think I see the problem. You've defined an "on command ..." function for the card, and defined some custom commands. This function will capture any "command" events sent to the card, which means the deck-level function that normally passes unhandled commands along to puppeteer:

on command x do pt.command[deck x] end

Doesn't get a chance to do its work!

You'll need to add a final "else" to the command handler on your card and pass unhandled events on to Puppeteer. You can do this directly:

on command x do
 if x~"mycommand1"
  #...
 elseif x~"mycommand2"
  #...
 else
  pt.command[deck x]
 end
end

Or you can use "send" to bubble the event up to the deck-level definition:

on command x do
 if x~"mycommand1"
  #...
 elseif x~"mycommand2"
  #...
 else
  send command[x]
 end
end

If you've added more "global" custom commands to the deck-level handler- in addition to those defined on the card- you'll want to use "send". Make sense?

Currently, copying text from a field always copies the plain-text equivalent of the selection. I'll give some thought to an alternative for rich text; perhaps an alternate "Copy Rich Text" menu item/shortcut.

(+1)

Ah thank you so very much!!! I kinda guessed that might be the problem. I'm definitely warming up to Decker now, thank you for all the timely answers and being so encouraging!

Sorry, follow up question, does this contradict when I have two or more puppets on one card?

because when I do a:

pt.command[deck
"!show NAME1 EMOTE customPOS1"
"!show NAME2 EMOTE customPOS2"
]

only the first line (whichever comes first) gets executed.

On this occasion though:

pt.command[deck
"!show NAME1 EMOTE customPOS1"
]
pt.command[deck
"!show NAME2 EMOTE customPOS2"
]

both can appear just fine.

Might be some other problem in my design, still checking it out, but shooting the question first)

ah and also trying to show any puppet with stage directions results in them snapping to "topleft" instead of the assigned place. Custom positions work fine.

Moving any puppet from offstage to custom position is also odd? I tried with boxy in the guided tour, but rather than "move from offstage to custom position" it did a diagonal line downwards. Not sure what I'm doing wrong here, but I have so much questions.

Developer

If you want to issue multiple commands with one call to pt.command[], the second argument will need to be a list of strings. Placing a comma between strings joins them together into a list, even if they're spread across multiple lines:

pt.command[deck
 "!show NAME1 EMOTE customPOS1",
 "!show NAME2 EMOTE customPOS2"
]

The above is equivalent to:

pt.command[deck ("!show NAME1 EMOTE customPOS1","!show NAME2 EMOTE customPOS2")]

ah sorry sorry, that was me being unobservant, thank you for the reply!

Sorry the stage position question persists. No matter the POS I give to any puppet they snap to the "topleft" of the screen. CustomPOS works fine.

Developer

Carefully check the spelling and capitalization of the positions you're specifying against the diagram of stage directions, and that the arguments to Puppeteer's commands are in the correct order. For example, !move takes a POS as its second argument and does not alter EMOTE, while !anim does not take a POS argument or an EMOTE argument.

There are a number of working examples in the documentation; you could try changing them bit by bit to approach your use-case. If you're getting yourself confused by a complicated project, try making a new deck from scratch and assembling the smallest possible example that demonstrates the problem you observe.

Thank you for your infinite patience!

I actually found out that the "snapping to topleft" problem seems to be a browser/desktop issue for a prior version of decker. I've updated to 1.41 and it is fixed for me!

Again much thanks to all the helpful answers and being so encouraging! Hope you have a great day馃弮

(for reference, how the desktop version behaves before I updated:)

Developer

Glad you were able to resolve your problem!

Be aware that importing modules into your decks adds a copy of the module to your deck; occasionally Decker release notes may point out updates to Dialogizer, Puppeteer, or other modules that are included with Decker. If you want to be certain you're using the latest version of a module, you can use the Resources dialog to remove dd/pt/etc and then re-import them.

(+1)

yeah I did that thank you!