Defarc not working

When I use defarc in my project it doesn’t work. It doesn’t give any errors just nothing happens but if I download the example project it does work. I ran defarc test in my project and 143 failed. but when I run it on the example 0 failed. @Pawel do you know what is happening

1 Like

Basically Arcweave is evolving and their adding and modifying stuff all the time, therefore DefArc becomes outdated with time. Though I am mainly working with my old boards, I recently also had a problem in my own project and started updating it slowly, so I will upload it, but no promises when :grin:

It’s also good to know that other people also uses the library, so that I know I should keep it alive :grin:

2 Likes

Alright, thanks for letting me know. If there is anything I can do let me know and I’ll try my best. I’m sure I could figure it out

1 Like

Could you share with me a project you have issues with.

Beside - one note - since my first release of DefArc, Arcweave changed their pricing plans and free plan now allows to have only 3 projects :frowning:

Hi this is showing the 143 errors
My Project.zip (2.3 MB)

@OPSPESH

Ok, so sorry, but defarc_test is pretty much really bound to DefArc project itself and it has internal link to the json file:

local test_board = "/examples/dialogs/test_board/test_board.json"

In your project, you don’t have that json (nor any other) at all, so that is why all tests fail.

defarc_test is only there to ensure DefArc is backward compatible and I didn’t break anything while adding things to DefArc.

I tested DefArc with new projects created using Arcweave and it still works :wink:

Maybe I just don’t understand how options work then because just having text works but options don’t. Thanks for the clarification though

Maybe this video could help you? :blush:

If you will still have any issue, let me know, I’ll try to explain better :wink:

Will do thanks

Right. It is working now, I think I was just being a bit stupid. Thanks for the help

Don’t you dare saying things like that :smiley: defarc_test is indeed misleading in this project, but I really wanted to add tests to that project, at least such simple!

Glad you figured it out in the end :slight_smile: let me know, if you will have any issues along with DefArc :wink:

No I haven’t tested Defarc test. but before even getting options wasn’t working. But they are now.

1 Like

How can I quit the conversation. I think I’m starting to wrap my had around it

Ok, sooo - it depends on your implementation :smiley:

Separate those two things:

DefArc is only a parser for your dialog data. That data is written in JSON, so DefArc loads it into Lua table and offers you some functions to extract some information from this data, maybe in a little bit easier way than direct access :wink:

What you do with this data is not in DefArc.

So it really depends on your implementation. For example, I always add node called "Exit" in Arcweave and when I get node title “Exit”, I know I should call a code to close dialog window/gui or so. So to check if I am at exit node I check if

defarc.get_element_title() == "Exit"

You can see, I even use it in example gui_script (here I just start over the same dialog instead of quitting):

if defarc.get_element_title() == "Exit" then			-- if one of elements have title "Exit"
    local start_id = defarc.get_starting_element_id()	-- we will just start over (or we can quit the conversation here)
    defarc.select_element_by_id(start_id)
end