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
Weird campaign coding interaction
So I use this code
"doOnTrigger":[{"sideObjectiveAvailable":"opt_smallspine"},
{
"message": {
"id": "merchant_pudgy_cuskeel",
"inserts": [
"pudgy_cuskeel",
"*pudgy_cuskeel"
],
"buttons": [
{
"req": {
"conditions": [
{
"haveMoney": {
"quantity": 7500
}
}
]
},
"doOnClick": [
{
"money": -7500
}
]
}
],
"enclosedCreateOne": [
"pudgy_cuskeel",
"pudgy_cuskeel"
],
}
},
{
"message": {
"id": "merchant_batangas_groppo",
"inserts": [
"batangas_groppo",
"*batangas_groppo"
],
"buttons": [
{
"req": {
"conditions": [
{
"haveMoney": {
"quantity": 4800
}
}
]
},
"doOnClick": [
{
"money": -4800
}
]
}
],
"enclosedCreateOne": [
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo"
],
}
},
{"unlock":"glauerts_frogfish"},
{"unlock":"western_pacific_toungefish"}
]
},
For some reason it make the three top messages repeat forever I am wondering whether this interaction is intended?
< >
Showing 1-8 of 8 comments
Twice Circled  [developer] 3 22 Aug, 2022 @ 5:32am 
Hi, so it depends on what is causing this "doOnTrigger".

It will continue to create these messages as long as the "doOnTrigger" is triggered.

Can you post me the json which contains the doOnTrigger?
Triggered Cat 52 22 Aug, 2022 @ 5:45am 
{
"conditions":[
{"exist":{"tag":"chimaera","quantity":1,"differentSpec":true,"insert":true}}
],
"doOnTrigger":[{"sideObjectiveAvailable":"opt_smallspine"},
{
"message": {
"id": "merchant_pudgy_cuskeel",
"inserts": [
"pudgy_cuskeel",
"*pudgy_cuskeel"
],
"buttons": [
{
"req": {
"conditions": [
{
"haveMoney": {
"quantity": 7500
}
}
]
},
"doOnClick": [
{
"money": -7500
}
]
}
],
"enclosedCreateOne": [
"pudgy_cuskeel",
"pudgy_cuskeel"
],
}
},
{
"message": {
"id": "merchant_batangas_groppo",
"inserts": [
"batangas_groppo",
"*batangas_groppo"
],
"buttons": [
{
"req": {
"conditions": [
{
"haveMoney": {
"quantity": 4800
}
}
]
},
"doOnClick": [
{
"money": -4800
}
]
}
],
"enclosedCreateOne": [
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo",
"batangas_groppo"
],
}
},
{"unlock":"glauerts_frogfish"},
{"unlock":"western_pacific_toungefish"}
]
},

This is basically what the original code look like
Twice Circled  [developer] 3 22 Aug, 2022 @ 5:59am 
So I'm assuming that is under either "globalTriggers" or an individual section's "triggers". Either way the trigger should only go off once unless reset by an "activateTrigger" command from somewhere else.

I'm sure there is a reason why the trigger is going off multiple times, I think you'd better send over your whole file if you don't mind? I'll find the important bit and create a test harness at my end and see if I can figure it out.

You can send it to support@twicecircled.com. :)
Triggered Cat 52 22 Aug, 2022 @ 6:11am 
Originally posted by Twice Circled:
So I'm assuming that is under either "globalTriggers" or an individual section's "triggers". Either way the trigger should only go off once unless reset by an "activateTrigger" command from somewhere else.

I'm sure there is a reason why the trigger is going off multiple times, I think you'd better send over your whole file if you don't mind? I'll find the important bit and create a test harness at my end and see if I can figure it out.

You can send it to support@twicecircled.com. :)
No problem
stlnegril9 32 22 Aug, 2022 @ 10:31am 
It is an individual "trigger" (under the initial main section).

Also, pretty sure there is a nested trigger in the "globalTriggers" that may or may not meet the criteria of the above. At least the nested is there around line 788 in the latest from the Workshop (which doesn't have this issue). Unsure how/if that affects the issue (but is not good, IMO).
Twice Circled  [developer] 3 23 Aug, 2022 @ 2:55am 
Right I think I understand now. When a doOnTrigger hits an error while carrying out the actions, it never marks itself as being triggered, so it will continue to be triggered over and over.

Check the error log:

Windows: C:\Users\<insert username>\AppData\LocalLow\Twice Circled\Megaquarium\player.log
Mac: ~/Library/Logs/Twice Circled/Megaquarium/Player.log
Linux: ~/.config/unity3d/Twice Circled/Megaquarium/Player.log

And you will get a good clue as to the problem.

It's probably one of the unlock actions at the end, one of the specs probably doesn't exist due to a typo?

{"unlock":"glauerts_frogfish"},
{"unlock":"western_pacific_toungefish"}
Triggered Cat 52 23 Aug, 2022 @ 5:12am 
Thx you!
stlnegril9 32 23 Aug, 2022 @ 7:03am 
Thanks for explanation and good prediction. Was typo in the bugged version:
galuerts vs glauerts.
< >
Showing 1-8 of 8 comments
Per page: 1530 50