Test if Campaign Json exists
NeverwinterWights
Member Posts: 339
Just wondering what function to use to test the existence of a campaign json. If there isn't one you are looking for does it return an error? Can't seem to find it anywhere. I can check for a null value IN the json but not sure that would determine whether or not the campaign json has already been created.
P.S. Very new to json and trying to figure this out. I've figured out how to make arrays and object in java script but trying to use this in NWScript...It's giving me a headache. Are there any tutorials yet that I just can't find?
P.S. Very new to json and trying to figure this out. I've figured out how to make arrays and object in java script but trying to use this in NWScript...It's giving me a headache. Are there any tutorials yet that I just can't find?
0
Comments
I want my JSON to have a value assigned to frog. JSON.frog = "King Frog";
Oh wait, frog should be a number. JSON.frog = 2. Done.
It's common to read in values from the JSON and then check if those are even defined.
So, we can't really do things that relaxed in NWNScript.
JsonGetError looks like it will get you what you want.
If it comes back with a string, then your json is not defined. (I haven't tested it, but that's the only thing that makes sense to me.)
Something like:
Yeah I think that might have been it. Thank you @ForSerious . One hurdle jumped. I'll keep chugging along trying to get this and test that out. Eventually I would like to figure out the NUI stuff but I need to get this json part down first.
to check if something exists, it'll return JSON_TYPE_NULL if it does not.