Adventure creator objective state

Announcements, support questions, and discussion for the Dialogue System.
jantskup
Posts: 5
Joined: Mon Mar 31, 2025 9:01 am

Adventure creator objective state

Post by jantskup »

Hello,

I am using Adventure creator and Pixel crusher's dialog system together.

I have a question regarding AC Lua Function "acGetObjectiveState".

It can only return state types "none", "active", "complete", or "fail". And in Adventure creator you can have several states on "active" state type, which are numbered 0...n.

Can I somehow check which one of those states are active from the dialog system conversation nodes and not only those state types with acGetObjectiveState?

Image
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adventure creator objective state

Post by Tony Li »

Hi,

I think the acGetObjectiveState() function already does that. If you call:

Code: Select all

acGetObjectiveState(6, "")
then it should return "active".

If "5:Map of Oakmoor" is also active, then acGetObjectiveState(5, "") will also return "active".
jantskup
Posts: 5
Joined: Mon Mar 31, 2025 9:01 am

Re: Adventure creator objective state

Post by jantskup »

Hi and thanks for quick reply,

Isn't the "6" in

Code: Select all

acGetObjectiveState(6, "") 
the number of the objective and not the state number of that individual objective?

Like my objective "Meeting an old friend" is number 7 in the list of all game objectives.

Image

So 'acGetObjectiveState(6, "")' would check objective "Ned" current state...

I tried to test this and came to this conclusion, but if I am wrong. I don't seem to understand how to define which objective we are checking state from.
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adventure creator objective state

Post by Tony Li »

Oh, I see what you mean! I'll update the integration to add:

1. acGetSubOjectiveState()

2. Add versions of the functions in which you can specify objectives and subobjectives by name rather than ID number.

I'll post a patch here today.
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adventure creator objective state

Post by Tony Li »

Please try this patch:

DS_AventureCreatorPatch_2025-03-31.unitypackage

It adds:
  • acGetObjectiveStateByName("objective", "player") -- (use "" if objectives aren't done per player character)
  • acGetObjectiveStateByName(objectiveID, subObjectiveID, "player")
  • acGetSubObjectiveStateByName("objective", subObjectiveID, "player")
jantskup
Posts: 5
Joined: Mon Mar 31, 2025 9:01 am

Re: Adventure creator objective state

Post by jantskup »

Oh man, thank you for the patch! That is exactly what I was hoping for.

Unfortunately I was not able to get the new lua functions to work.

I tested like this
* (acGetObjectiveState(7, "") == "active") -- still works
* (acGetObjectiveStateByName("Meeting an old friend", "") == "active") -- did not work
* (acGetSubObjectiveState(7, 5, "") == "active") -- did not work
* (acGetSubObjectiveStateByName("Meeting an old friend", 5, "") == "active") -- did not work

By "not working", I mean it is blocking the node even though that sub objective is active at the moment.

This is the node:
Image

This is the objectives at runtime. I don't know if the "Current state: 5: Map of Oakmoor" makes a difference as there is also the "State type: Active" in the bottom.

Image

Or could it be issue with my versions?

I am using
Unity 6000.0.25f1
DS 2.2.50.1
AC 1.82.3
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adventure creator objective state

Post by Tony Li »

Hi,

Sorry about that. There was a bug. I caused it by creating some confusion when I named the Lua function acGetObjectiveStateByName() even though objectives don't have names; they have titles. The two relevant Lua functions are now named acGetObjectiveStateByTitle() and acGetSubObjectiveStateByTitle(). All 4 pass tests, including the sub-objective functions. Here's the new patch:

DS_AventureCreatorPatch_2025-04-01.unitypackage
jantskup
Posts: 5
Joined: Mon Mar 31, 2025 9:01 am

Re: Adventure creator objective state

Post by jantskup »

Hi,

sorry to say, but I am still having trouble of getting this to work.

With this new the Lua functions acGetSubObjectiveStateByTitle() works so that
* Node is not blocked when ANY of the active states is active and in my objective "Meeting an old friend" 0, 2-6 sub states are active states.
* The node is blocked when the objective is either inactive or complete (I did not test fail).

Image

I cannot get (acGetSubObjectiveState(7, 5, "") == "active") to work at all. I mean, none of the sub states have an impact and the node is always blocked.

I noticed this error while importing this new patch. It was there earlier, but I dismissed it as everything was working. I wonder if it has any impact:

Image
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adventure creator objective state

Post by Tony Li »

I have to confess that my experience with sub-objectives is somewhat limited. My unit test cases may be more simplistic than what you're doing. Would it be possible for you to send your AC ManagerPackage and related assets (Scene Manager, Settings Manager, Actions Manager, etc.) to tony (at) pixelcrushers.com? If you can multi-select them all and export them as a unitypackage, that would be perfect.

The warnings are harmless, but there's a full Adventure Creator Support package on the Extras page (direct download) if you'd like to get rid of them. This package -- or more likely this package plus fixes to acGetSubObjectiveState() -- will be in DS 2.2.52. So, for future readers, if you're using 2.2.52+, don't download this package.
jantskup
Posts: 5
Joined: Mon Mar 31, 2025 9:01 am

Re: Adventure creator objective state

Post by jantskup »

Ok thanks, I sent email. It is 10Mb so hopefully it won't be blocked.
Post Reply