So, I have a main module that loads submodules just fine from what I can tell. Basically using the template that Jean created in another post here:
However, I may not understand how to properly trigger functions in the main module, I initially tried just calling the function in the main module from the submodule which didnt work and I somewhat expected that, so I simply sent out an OSC message and that triggered just fine for one of my messages, but the other one, that exists in the exact same custom module, appears to just not trigger anything in the main module.
var someArray = []
var someArray2 = []
var llArray = [];
//My functions are here but i'm not including them because they arent important
module.exports = {
oscOutFilter: function(data) {
var {host, port, address, args} = data
console.log("PINNED RESULT: " + address)
if(address === '/test') {
//existing code that I have
send(host, port, "/select-location", 0, 0, latLngArray)
return
}
else if(address === '/removePin') {
//existing code that I have
if (//expression) {
send(host, port, "/select-location", 0, 0, latLngArray)
return data
}
else {
//existing code that I have
send(host, port, "/select-location", parseFloat(newllArray[0]), parseFloat(newllArray[1]), [])
return data
}
send(host, port, "/testAddress")
return
}
return data
}
}
Everything in the /test address block works every single time without fail, the removePin block works up until it hits send(). Which doesn't mean it isnt sending out an address, I can see in the debug console that every send() function works as expected both in the if statement and the /testAddress, but for whatever reason they will not trigger anything in the main custom module.
I'm not sure what I'm doing wrong
EDIT: One of the other modules that's loaded works just fine from what I can tell, but its the first module of the array, which shouldn't matter because of the init function?