Megaquarium

Megaquarium

What will you create?
Access an ocean of content for Megaquarium created by players like you. New animals, decorations, tanks and more are available to expand your game and tailor it to your liking.
Learn More
Campaigns use of exists
Objectives in Custom Campaigns can show error (in log file) of:
Warning: Objective 'Exist' conditions need either an id, tag or spec to select objects.

Objectives such as
"exist":{"id":"aquarist","aboutToLevel":true,"quantity":1}
"exist":{"tag":"tank","quantity":1,"footprint":6}
"exist":{"spec":"chemistry","broken":"true","quantity":1}
Fit that, but those with, e.g.
"exist":{"assignedAccessory": "12_backpack"}
or
"exist":{"fullyGrown": true}
Do not (IMO) and yet are still valid.
< >
Showing 1-7 of 7 comments
Twice Circled  [developer] 3 13 Sep, 2020 @ 4:26am 
The way it's programmed is every "exist" condition needs either an id, tag or spec to first define a set of objects. Then additional criteria can be used to refine within that set.

So:

"exist":{"assignedAccessory": "12_backpack"}

Could be:

"exist":{"spec":"aquarist", "assignedAccessory": "12_backpack"}

And:

"exist":{"fullyGrown": true}

Could be:

"exist":{"tag":"animal", "fullyGrown": true}

Now you're right that it didn't have to be programmed like this. In the event that no tag or spec is defined then we could have just searched through every single object and applied the more advanced filters.

I probably won't change the way it's programmed, because I don't think it actually limits anything that you can do in custom scenarios. There's nearly always a spec or tag that you can use which applies to the group that you're searching within.

However if you can demonstrate a use case where it causes a real limitation in terms of what you are trying to achieve in a custom scenario then I could take a look at adjusting the underlying code.

Essentially, I don't want to spend time changing something that's working fine when there's lots of other high priority stuff players want me to work on! :)
Last edited by Twice Circled; 13 Sep, 2020 @ 4:27am
stlnegril9 32 13 Sep, 2020 @ 9:13am 
Interesting. Thanks for the detailed explanation. Wasn't obvious they all fit into an "id", "tag" or "spec", but probably can figure out what goes with which now.

FWIW, I think that error showed when using a condition that tested{"exist":{"hostsTrait": "xxx"}}, which may not be valid.

Certainly not asking for any re-writing of underlying code.
Twice Circled  [developer] 3 14 Sep, 2020 @ 1:34am 
OK cool. Glad I could help. :)

I don't think "hostsTrait" does anything anymore! It's a hangover from an old system I experimented on pre-release. :O
stlnegril9 32 17 Sep, 2020 @ 3:13pm 
Thought I could slog through this but hitting head against the wall.
e.g. just trying to check for "territorial" looks simple enough

"conditions":[
{
"exist":
{"tag":"animal", "territorial": true,"quantity":3
}
}
]

Would expect to meet the condition when there are 3 animals existing in the aquarium that have "territorial" trait. (It completes the condition regardless of what is in the aquarium - same as if I put nonsense in the condition.)

Trying things with further values, like
"explorer":{"value":6},
seem even more daunting.

Can't get "likesBogwood" to work at all.
Twice Circled  [developer] 3 19 Sep, 2020 @ 6:26am 
Not every animal care requirement has an equivalent objective condition. For "exists" here is the exhaustive list of what is currently possible:

public string insertOverride;
public string id;
public string spec;
public string tag;
public string eats;
public int quantity;
public string hostedOn;
public string hosts;
public string[] hostsMany;
public string hostsTag;
public string hostsTrait;
public bool fillTank;
public bool differentSpec;
public int size;
public int footprint;
public PointValue pointValue;
public bool earnsScience;
public GuestData.Moodlet lowMoodlet;
public bool broken;
public bool fullyGrown;
public bool grower;
public bool coldwater;
public bool fed;
public string hasSkill;
public string talkType;
public bool aboutToLevel;
public string salinity;
public string assignedAccessory;
public string equippedAccessory;
public bool breedingHasMate;
public bool exactQuantity; // Exact quantity required, not equal to or greater
public bool connectedToSomething;
public Hybrid hybrid;
public string seen;

"Exist" is OK for some simple things, but I use it mainly for early game tutorials. For optional objectives (quests), I use the more powerful "Tank" condition which allows for more intricate conditions.

It lets you set an objective of building a tank which meets a certain set of conditions.

It's a complicated to get it to work nicely so definitely use an existing example from the game and tweak it.

Here's the sub conditions available for the Tank condition:

public string salinity;
public bool isAcidic;
public bool isHeated;
public bool isChilled;
public bool isFiltered;
public bool isRounded;
public bool isLit;
public int light;
public bool guestsCantAccess;
public bool adjacentPlatform;
public bool accessible;
public bool noEquipmentConnected;
public bool connectedToPump;
public int footprint;
public int sizeM;
public int sizeN;
public int volume;
public string isSpec;
public int rock;
public int plant;
public int cave;
public int floatingCover;
public int bogwood;
public int fluffyFoliage;
public int flatSurface;
public int verticalSurface;
public int isNotUID;
public int skimming;
public HostData[] hostsMany;
public PointValue[] pointValues;
public int openSpace;
public bool plantDestructionChanceZero;
public int land;

The real magic is within the HostData array. You can include many different sub conditions in here:

public string insertOverride;
public string id;
public string tag;
public int quantity;
public bool differentSpec;
public bool requirementsMet;
public int animalSizeAtLeast;
public bool fullyGrown;
public string eats;
public bool shoaler;
public bool wimp;
public bool activeSwimmer;
public bool greedy;
public bool armored;
public bool bully;
public bool scavenger;
public bool plantLover;
public bool rockLover;
public bool caveLover;
public bool nonImmobile;
public string autofeederType;
public bool includeConnectedPumps;

As you can see, some animal care requirements are here but not all of them. Hope that helps!

EDIT: Thought I'd include one of my favourite objectives - the sunken aeroplane - so you have an example right here to look at:
{ "sectionId":"opt_aeroplane", "reward":{"basePrestige":200}, "objectives":[ { "id":"tankWithParameters", }, { "id":"ff5_plane_condition", "conditions":[ {"tank":{"hostsMany":[{"id":"37_sunken_aeroplane","quantity":1}],"insert":true}} ] }, { "id":"isFreshwater", "conditions":[ {"tank":{"salinity":"freshwater","insert":true}} ] }, { "id":"tankWithXAnimal", "conditions":[ {"tank":{"salinity":"freshwater","hostsMany":[ {"id":"37_sunken_aeroplane","quantity":1}, {"tag":"animal","quantity":5,"differentSpec":true} ],"insert":true}} ] }, { "id":"allRequirementsMetXofY", "conditions":[ {"tank":{"salinity":"freshwater","hostsMany":[ {"id":"37_sunken_aeroplane","quantity":1}, {"tag":"animal","quantity":5,"differentSpec":true,"requirementsMet":true} ],"insert":true}} ] }, { "id":"tankWithValue", "conditions":[ {"tank":{"salinity":"freshwater","hostsMany":[ {"id":"37_sunken_aeroplane","quantity":1} ],"pointValues":[{"type":"Ecology","value":200}],"insert":true}} ] }, { "id":"tankWithValue", "conditions":[ {"tank":{"salinity":"freshwater","hostsMany":[ {"id":"37_sunken_aeroplane","quantity":1} ],"pointValues":[{"type":"Science","value":200}],"insert":true}} ] }, ], "doOnComplete":[{"popupMessage":"opt_aeroplane_complete"},{"basePrestige":200}], },
Last edited by Twice Circled; 21 Sep, 2020 @ 1:46am
stlnegril9 32 19 Sep, 2020 @ 9:12am 
Thanks for the lists. not clear why "exists" stops at
"public bool aboutToLevel;"

e.g. salinity, assignedAccessory, equippedAccessory, seen, etc.

salinity (used in "tank":{"hostsMany":{}} in the example, but here is used in "exist" )

{
"id": "existXSpeciesFreshwater",
"conditions": [
{
"exist": {
"tag": "animal",
"quantity": 7,
"differentSpec": true,
"salinity": "freshwater",
"insert": true
}
}
]
},

seen
{
"id": "guestsViewedFeeding",
"conditions": [
{
"exist": {
"id": "guest",
"quantity": 1,
"seen": "feeding_platform_tank",
"insert": true
}
}
]
}

Maybe it has to do with FF DLC. But so is the aeroplane example. (shrug).
Twice Circled  [developer] 3 21 Sep, 2020 @ 1:48am 
My bad, I posted the fields from an old copy of the file. I've updated my last post with the most recent version of the file. Thanks for notifying me!
< >
Showing 1-7 of 7 comments
Per page: 1530 50