good catch. Just edited that.GodDragon wrote: ↑Sun Nov 25, 2018 7:26 pmActually \ is used to escape the next character not /ski23 wrote: ↑Sun Nov 25, 2018 6:53 pmSecond, don't use "/" in your paths. "/" will cancel out the meaning of the next character. So, for example, if you wanted to print out a quotation mark, you would do it like this "/"" because it will nullify the special meaning of the quotation mark. It is possible to use "//" instead. However, DON'T do this because it will be incompatible with MacOs and Linux. Instead, in paths, you should always use "\" or use the separator variable at the top. (I recommend using the separator var)genome231 wrote: ↑Sun Nov 25, 2018 3:36 pm Okay!
So I feel like I'm almost there, but something is still eluding me...
So this is run in the setup.So I'm confident this part works. Because the sendMessage at the end produces the right path.Code: Select all
let separator = java.io.File.separator; //Why is this necessary? let teasePath; function setUpMedia() { let TeaseAI = Java.type("me.goddragon.teaseai.TeaseAI"); let file = new java.io.File(TeaseAI.class.getProtectionDomain().getCodeSource().getLocation().toURI()); //The path to the main directory teasePath = file.getParent(); sendMessage(teasePath); //Produces the correct path, tested it. }
The full path for which I'm testing is:
A:\TeaseAI_Java\Images\General_Pics\Charlotte Springer\1
and sendMessage(teasePath); produces A:\TeaseAI_Java when I test it.
So there seems to be something wrong with this one..This is my test file:Code: Select all
function showTaggedPic(imagePath, imageTags, delay) { let path = teasePath + separator + imagePath; let pictureHandler = Java.type("me.goddragon.teaseai.api.picture.PictureHandler"); let matchingImages = pictureHandler.getHandler().getTaggedPicturesExact(new java.io.File(path), imageTags); if (matchingImages === null) { sendMessage("BUG: matchingImages was equal to null",4); } else { let randomImage = matchingImages.get(randomInteger(0, matchingImages.length - 1)); let toReturn = showImage(randomImage.getFile().getPath()); if (delay != null) { sleep(delay); } return toReturn; } }
When it runs the showTaggedPic it produces the error: sendMessage("BUG: matchingImages was equal to null",4);Code: Select all
sendMessage("Test_Start"); setTypeSpeed("INSTANT"); run("Functions/01_functions_Basic.js"); run("Functions/02_functions_Chat.js"); run("Functions/03_functions_Media.js"); run("Functions/04_functions_Stroking.js"); run("Functions/05_functions_Structure.js"); run("Functions/06_functions_Check.js"); sendMessage("Loading stroking routines"); setUpMedia(); setTypeSpeed("MEDIUM"); showTaggedPic("Images/General_Pics/Charlotte Springer/1",["TagFullyDressed"],5); sendMessage("Test_End", 60);
What is it that I'm missing or not quite getting and please get into details :P I'm very new at this.
Cheers
And thank you for all the patience so far xD
[Tease AI Java] Developer's Guide and Help Thread
Moderator: 1885
-
- Explorer At Heart
- Posts: 464
- Joined: Sun Jun 11, 2017 12:53 am
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
- Dom/me(s): Courtney
- Sub/Slave(s): Courtney
- Location: Virginia
- Contact:
Re: [Tease AI Java] Developer's Guide and Help Thread
Quote me, or PM me and I'll reply as soon as I can!
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Re: [Tease AI Java] Developer's Guide and Help Thread
I know thisski23 wrote: ↑Sun Nov 25, 2018 6:53 pm So there are a couple issues I see. The first one isn't really causing your issue but it's important to note. In your function, you print out that if matchingImages is null, it is a bug. That isn't true. If you call showTaggedPic("Images/General_Pics/Charlotte Springer/1",["Boobs"],5); and there aren't any images that have the tag boobs, then that isn't a bug. It just means none were found and you should do whatever you want in that case.
But in my case I would considder this a bug (or at least something that shouldn't occur ever). Basically my domme sets have 4 tags and 4 tags only.
FullyDressed, HalfDressed, GarmentCovering and boobs. Only 1 tag per image.
I understand that I am correct using "/"? from Goddragons post?ski23 wrote: ↑Sun Nov 25, 2018 6:53 pm Second, for why separator is at the top, don't use "\" in your paths. "\" will cancel out the meaning of the next character. So, for example, if you wanted to print out a quotation mark, you would do it like this "\"" because it will nullify the special meaning of the quotation mark. It is possible to use "\\" instead. However, DON'T do this because it will be incompatible with MacOs and Linux. Instead, in paths, you should always use "/" or use the separator variable at the top. (I recommend using the separator var)
This last statement confuses me a bit. Please elaborate.ski23 wrote: ↑Sun Nov 25, 2018 6:53 pm Third, don't include tag in the tag name, just the name. For example, use "boobs" not "TagBoobs".
Finally, I checked and the showTaggedImagesExact function only shows images with the provided tags and will not search for dress states such as "naked", "halfdressed", "fullydressed", etc. I'll change this when I get the chance though. For now, try using any tags listed in the tags list with the other changes above.
Where can I find a list of available tags? I assumed the different tags you can set through settings in the program were all working?
showTaggedImagesExact function, what function is that? Never heard of it. It's not in the github, but I cant seem to find it in your scripts as well?
Cheers
Genome
Tribute to 1885 & those involved with Tease-AI.
Thank you for spending time on this awesome project!
Thank you for spending time on this awesome project!
-
- Explorer At Heart
- Posts: 464
- Joined: Sun Jun 11, 2017 12:53 am
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
- Dom/me(s): Courtney
- Sub/Slave(s): Courtney
- Location: Virginia
- Contact:
Re: [Tease AI Java] Developer's Guide and Help Thread
1. Ok that sounds fine then.genome231 wrote: ↑Mon Nov 26, 2018 4:31 pmI know thisski23 wrote: ↑Sun Nov 25, 2018 6:53 pm So there are a couple issues I see. The first one isn't really causing your issue but it's important to note. In your function, you print out that if matchingImages is null, it is a bug. That isn't true. If you call showTaggedPic("Images/General_Pics/Charlotte Springer/1",["Boobs"],5); and there aren't any images that have the tag boobs, then that isn't a bug. It just means none were found and you should do whatever you want in that case.
But in my case I would considder this a bug (or at least something that shouldn't occur ever). Basically my domme sets have 4 tags and 4 tags only.
FullyDressed, HalfDressed, GarmentCovering and boobs. Only 1 tag per image.
I understand that I am correct using "/"? from Goddragons post?ski23 wrote: ↑Sun Nov 25, 2018 6:53 pm Second, for why separator is at the top, don't use "\" in your paths. "\" will cancel out the meaning of the next character. So, for example, if you wanted to print out a quotation mark, you would do it like this "\"" because it will nullify the special meaning of the quotation mark. It is possible to use "\\" instead. However, DON'T do this because it will be incompatible with MacOs and Linux. Instead, in paths, you should always use "/" or use the separator variable at the top. (I recommend using the separator var)
This last statement confuses me a bit. Please elaborate.ski23 wrote: ↑Sun Nov 25, 2018 6:53 pm Third, don't include tag in the tag name, just the name. For example, use "boobs" not "TagBoobs".
Finally, I checked and the showTaggedImagesExact function only shows images with the provided tags and will not search for dress states such as "naked", "halfdressed", "fullydressed", etc. I'll change this when I get the chance though. For now, try using any tags listed in the tags list with the other changes above.
Where can I find a list of available tags? I assumed the different tags you can set through settings in the program were all working?
showTaggedImagesExact function, what function is that? Never heard of it. It's not in the github, but I cant seem to find it in your scripts as well?
Cheers
Genome
2. Yea you are correct
3. The issue you are running into is this:
A tagged image in TAJ has a list of PictureTags. Here is the list of all picture Tags. However, a tagged Picture also has a variable for a "dress state" that denotes the dress state in the image. If you look at the method I gave you that you're using, the guts of it that is actually getting the list of pictures is this line:
Code: Select all
let matchingImages = pictureHandler.getHandler().getTaggedPicturesExact(new java.io.File(path), imageTags);
Quote me, or PM me and I'll reply as soon as I can!
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Re: [Tease AI Java] Developer's Guide and Help Thread
Okay so with that in mind I gave it another try using "boobs", which should work.
Still cant get it to work.
When the above command is tested this will print out:
A:\TeaseAI_Java\Images\General_Pics\Charlotte Springer\1 (so it gets the path right )
Then crash for unknown reason.
These are the functions I call:
I confirmed that there are multiple images in that folder with the tag: TagBoobs,
These have all been tagged using Tease-AI Java.
This is the test-script btw:
Still cant get it to work.
Code: Select all
showTaggedPic("Images" + separator + "General_Pics" + separator + "Charlotte Springer" + separator + "1",["boobs"],5);
A:\TeaseAI_Java\Images\General_Pics\Charlotte Springer\1 (so it gets the path right )
Then crash for unknown reason.
These are the functions I call:
Code: Select all
let teasePath;
function setUpMedia() {
let TeaseAI = Java.type("me.goddragon.teaseai.TeaseAI");
let file = new java.io.File(TeaseAI.class.getProtectionDomain().getCodeSource().getLocation().toURI());
//The path to the main directory
teasePath = file.getParent();
}
function showTaggedPic(imagePath, imageTags, delay) {
let path = teasePath + separator + imagePath;
sendMessage(path);
let pictureHandler = Java.type("me.goddragon.teaseai.api.picture.PictureHandler");
let matchingImages = pictureHandler.getHandler().getTaggedPicturesExact(new java.io.File(path), imageTags);
if (matchingImages = null) {
sendMessage("BUG: matchingImages was equal to null",4);
} else {
let randomImage = matchingImages.get(randomInteger(0, matchingImages.length - 1));
let toReturn = showImage(randomImage.getFile().getPath());
if (delay != null) {
sleep(delay);
}
return toReturn;
}
}
These have all been tagged using Tease-AI Java.
- Spoiler: show
This is the test-script btw:
Code: Select all
run("Functions/01_functions_Chat.js");
setUpChat();
setTypeSpeed("INSTANT");
SMessage("Test_Start",0);
SMessage("Loading 1 / 6",0);
run("Functions/02_functions_Basic.js");
run("Functions/03_functions_Media.js");
setUpMedia();
run("Functions/04_functions_Stroking.js");
run("Functions/05_functions_Structure.js");
run("Functions/06_functions_Check.js");
run("Functions/Routines/list.js");
run("Test/TestVar.js");
setTypeSpeed("MEDIUM");
showTaggedPic("Images" + separator + "General_Pics" + separator + "Charlotte Springer" + separator + "1",["boobs"],5);
sendMessage("Test_End", 60);
Last edited by genome231 on Mon Nov 26, 2018 5:03 pm, edited 1 time in total.
Tribute to 1885 & those involved with Tease-AI.
Thank you for spending time on this awesome project!
Thank you for spending time on this awesome project!
-
- Explorer At Heart
- Posts: 464
- Joined: Sun Jun 11, 2017 12:53 am
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
- Dom/me(s): Courtney
- Sub/Slave(s): Courtney
- Location: Virginia
- Contact:
Re: [Tease AI Java] Developer's Guide and Help Thread
Can you post the logs from the crash. Also, I fixed some issues with images and tagging a bit back that I believe GodDragon should be pushing to live today so you might be running into those bugs. I'll be able to tell from your logs.genome231 wrote: ↑Mon Nov 26, 2018 5:00 pm Okay so with that in mind I gave it another try using "boobs", which should work.
Still cant get it to work.
When the above command is tested this will print out:Code: Select all
showTaggedPic("Images" + separator + "General_Pics" + separator + "Charlotte Springer" + separator + "1",["boobs"],5);
A:\TeaseAI_Java\Images\General_Pics\Charlotte Springer\1 (so it gets the path right )
Then crash for unknown reason.
These are the functions I call:I confirmed that there are multiple images in that folder with the tag: TagBoobs,Code: Select all
let teasePath; function setUpMedia() { let TeaseAI = Java.type("me.goddragon.teaseai.TeaseAI"); let file = new java.io.File(TeaseAI.class.getProtectionDomain().getCodeSource().getLocation().toURI()); //The path to the main directory teasePath = file.getParent(); } function showTaggedPic(imagePath, imageTags, delay) { let path = teasePath + separator + imagePath; sendMessage(path); let pictureHandler = Java.type("me.goddragon.teaseai.api.picture.PictureHandler"); let matchingImages = pictureHandler.getHandler().getTaggedPicturesExact(new java.io.File(path), imageTags); if (matchingImages = null) { sendMessage("BUG: matchingImages was equal to null",4); } else { let randomImage = matchingImages.get(randomInteger(0, matchingImages.length - 1)); let toReturn = showImage(randomImage.getFile().getPath()); if (delay != null) { sleep(delay); } return toReturn; } }
These have all been tagged using Tease-AI Java.What is wrong?
- Spoiler: show
Quote me, or PM me and I'll reply as soon as I can!
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Re: [Tease AI Java] Developer's Guide and Help Thread
05:59:10 PM INFO: Loaded 19 vocabularies.
05:59:10 PM INFO: Loaded 0 responses.
05:59:10 PM INFO: Finished setting up chat.
05:59:10 PM CHAT: Test_Start
05:59:10 PM CHAT: Loading 1 / 6
05:59:11 PM CHAT: Loading 2 / 6
05:59:11 PM CHAT: Loading 3 / 6
05:59:11 PM CHAT: 05:59 PM Charlotte: A:\TeaseAI_Java
05:59:12 PM CHAT: Loading 4 / 6
05:59:13 PM CHAT: Loading 5 / 6
05:59:13 PM CHAT: Loading 6 / 6
05:59:13 PM CHAT: R1
05:59:13 PM CHAT: R2
05:59:14 PM CHAT: Loaded Test-Var's
05:59:20 PM CHAT: 05:59 PM Charlotte: A:\TeaseAI_Java\Images\General_Pics\Charlotte Springer\1
05:59:26 PM SEVERE: Latest loaded file was 'A:\TeaseAI_Java\Personalities\Test\Test\TestVar.js' and error was found in line 61
Error: TypeError: null has no such function "get" in <eval> at line number 61
javax.script.ScriptException: TypeError: null has no such function "get" in <eval> at line number 61
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(Unknown Source)
at java.scripting/javax.script.AbstractScriptEngine.eval(Unknown Source)
at me.goddragon.teaseai.api.scripts.ScriptHandler.runScript(ScriptHandler.java:159)
at me.goddragon.teaseai.api.scripts.ScriptHandler.startPersonality(ScriptHandler.java:120)
at me.goddragon.teaseai.api.session.Session$2.run(Session.java:46)
Caused by: <eval>:61 TypeError: null has no such function "get"
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.NashornBottomLinker.linkNull(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.NashornBottomLinker.getGuardedInvocation(Unknown Source)
at jdk.dynalink/jdk.dynalink.linker.support.CompositeGuardingDynamicLinker.getGuardedInvocation(Unknown Source)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.lambda$getGuardedInvocation$0(Unknown Source)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getWithLookupInternal(Unknown Source)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getGuardedInvocation(Unknown Source)
at jdk.dynalink/jdk.dynalink.DynamicLinker.relink(Unknown Source)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1067$1237AAI$\^eval\_$cu1$restOf.showTaggedPic(<eval>:61)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1007$\^eval\_.:program(<eval>:15)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(Unknown Source)
... 8 more
Tribute to 1885 & those involved with Tease-AI.
Thank you for spending time on this awesome project!
Thank you for spending time on this awesome project!
-
- Explorer At Heart
- Posts: 464
- Joined: Sun Jun 11, 2017 12:53 am
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
- Dom/me(s): Courtney
- Sub/Slave(s): Courtney
- Location: Virginia
- Contact:
Re: [Tease AI Java] Developer's Guide and Help Thread
You dogenome231 wrote: ↑Mon Nov 26, 2018 5:05 pm05:59:10 PM INFO: Loaded 19 vocabularies.
05:59:10 PM INFO: Loaded 0 responses.
05:59:10 PM INFO: Finished setting up chat.
05:59:10 PM CHAT: Test_Start
05:59:10 PM CHAT: Loading 1 / 6
05:59:11 PM CHAT: Loading 2 / 6
05:59:11 PM CHAT: Loading 3 / 6
05:59:11 PM CHAT: 05:59 PM Charlotte: A:\TeaseAI_Java
05:59:12 PM CHAT: Loading 4 / 6
05:59:13 PM CHAT: Loading 5 / 6
05:59:13 PM CHAT: Loading 6 / 6
05:59:13 PM CHAT: R1
05:59:13 PM CHAT: R2
05:59:14 PM CHAT: Loaded Test-Var's
05:59:20 PM CHAT: 05:59 PM Charlotte: A:\TeaseAI_Java\Images\General_Pics\Charlotte Springer\1
05:59:26 PM SEVERE: Latest loaded file was 'A:\TeaseAI_Java\Personalities\Test\Test\TestVar.js' and error was found in line 61
Error: TypeError: null has no such function "get" in <eval> at line number 61
javax.script.ScriptException: TypeError: null has no such function "get" in <eval> at line number 61
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(Unknown Source)
at java.scripting/javax.script.AbstractScriptEngine.eval(Unknown Source)
at me.goddragon.teaseai.api.scripts.ScriptHandler.runScript(ScriptHandler.java:159)
at me.goddragon.teaseai.api.scripts.ScriptHandler.startPersonality(ScriptHandler.java:120)
at me.goddragon.teaseai.api.session.Session$2.run(Session.java:46)
Caused by: <eval>:61 TypeError: null has no such function "get"
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.NashornBottomLinker.linkNull(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.NashornBottomLinker.getGuardedInvocation(Unknown Source)
at jdk.dynalink/jdk.dynalink.linker.support.CompositeGuardingDynamicLinker.getGuardedInvocation(Unknown Source)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.lambda$getGuardedInvocation$0(Unknown Source)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getWithLookupInternal(Unknown Source)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getGuardedInvocation(Unknown Source)
at jdk.dynalink/jdk.dynalink.DynamicLinker.relink(Unknown Source)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1067$1237AAI$\^eval\_$cu1$restOf.showTaggedPic(<eval>:61)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1007$\^eval\_.:program(<eval>:15)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(Unknown Source)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(Unknown Source)
... 8 more
if (matchingImages = null) {
sendMessage
This needs to be an ==. Use = to assign the value of a variable and == to test what the value of a variable is.
Quote me, or PM me and I'll reply as soon as I can!
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
-
- Explorer
- Posts: 24
- Joined: Tue Jul 12, 2016 9:08 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Switch
Re: [Tease AI Java] Developer's Guide and Help Thread
Hi
I am exploring TeaseAI java and trying to create a mini game module.
Before I go down the rabbit hole of java, let me explain what I am trying to do. You can then advise if it is possible with TeaseAI.
I would like to draw a rectangle in a location over the current image.
Sounds simple right?
I tried using the javafx library to do it, but can not figure out how to output to the current stage...
Don't know if I am barking up the wrong tree.
Is it possible to interact with the stage in this way? perhaps some other fashion besides the javafx library that I might not have thought of?
If not, could it be considered for a future release?
Bonus points if we can detect mouse movements and keyboard presses outside the chat box.
It opens up possibilities such as a user must click a specific location in a picture to succeed.
Or using the arrow keys to move stuff around on the screen.
For what it is worth, here is the code I played with in the module.
I tried manipulating the "primaryStage" in the TeaseAI.java class. But that was just me grasping at straws.
I am exploring TeaseAI java and trying to create a mini game module.
Before I go down the rabbit hole of java, let me explain what I am trying to do. You can then advise if it is possible with TeaseAI.
I would like to draw a rectangle in a location over the current image.
Sounds simple right?
I tried using the javafx library to do it, but can not figure out how to output to the current stage...
Don't know if I am barking up the wrong tree.
Is it possible to interact with the stage in this way? perhaps some other fashion besides the javafx library that I might not have thought of?
If not, could it be considered for a future release?
Bonus points if we can detect mouse movements and keyboard presses outside the chat box.
It opens up possibilities such as a user must click a specific location in a picture to succeed.
Or using the arrow keys to move stuff around on the screen.
For what it is worth, here is the code I played with in the module.
I tried manipulating the "primaryStage" in the TeaseAI.java class. But that was just me grasping at straws.
Code: Select all
DMessage("Module game1 start", 1);
rectangle = new javafx.scene.shape.Rectangle();
//Setting the properties of the rectangle
rectangle.setX(150);
rectangle.setY(75);
rectangle.setWidth(300);
rectangle.setHeight(150);
//Creating a Group object
root = new javafx.scene.Group(rectangle);
//Creating a scene object
scene = new javafx.scene.Scene(root, 600, 300);
//Setting the title to the Stage as a test
TeaseAI.primaryStage.setTitle("Please work");
//Adding the scene object to the stage
TeaseAI.primaryStage.setScene(scene);
//Displaying the contents of the stage again in an attempt to refresh...
TeaseAI.primaryStage.show();
Dmessage("Module game1 End");
-
- Explorer At Heart
- Posts: 464
- Joined: Sun Jun 11, 2017 12:53 am
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
- Dom/me(s): Courtney
- Sub/Slave(s): Courtney
- Location: Virginia
- Contact:
Re: [Tease AI Java] Developer's Guide and Help Thread
I personally havent yet attempted to try doing javafx stuff within the javascript. I’ve only done jfx stuff in the Java of TAI so far. Since I am on vacation right now and don’t have my computer, unfortunately I can’t write any example code to help with this. Two things I suggest looking at though are: try using the scene that is already being used instead of a new one maybe by accessing the one in TeaseAI. Secondly, since javafx was removed on java11, you might be running into an issue when you do:CatCrap wrote: ↑Sun Jan 06, 2019 9:56 pm Hi
I am exploring TeaseAI java and trying to create a mini game module.
Before I go down the rabbit hole of java, let me explain what I am trying to do. You can then advise if it is possible with TeaseAI.
I would like to draw a rectangle in a location over the current image.
Sounds simple right?
I tried using the javafx library to do it, but can not figure out how to output to the current stage...
Don't know if I am barking up the wrong tree.
Is it possible to interact with the stage in this way? perhaps some other fashion besides the javafx library that I might not have thought of?
If not, could it be considered for a future release?
Bonus points if we can detect mouse movements and keyboard presses outside the chat box.
It opens up possibilities such as a user must click a specific location in a picture to succeed.
Or using the arrow keys to move stuff around on the screen.
For what it is worth, here is the code I played with in the module.
I tried manipulating the "primaryStage" in the TeaseAI.java class. But that was just me grasping at straws.
Code: Select all
DMessage("Module game1 start", 1); rectangle = new javafx.scene.shape.Rectangle(); //Setting the properties of the rectangle rectangle.setX(150); rectangle.setY(75); rectangle.setWidth(300); rectangle.setHeight(150); //Creating a Group object root = new javafx.scene.Group(rectangle); //Creating a scene object scene = new javafx.scene.Scene(root, 600, 300); //Setting the title to the Stage as a test TeaseAI.primaryStage.setTitle("Please work"); //Adding the scene object to the stage TeaseAI.primaryStage.setScene(scene); //Displaying the contents of the stage again in an attempt to refresh... TeaseAI.primaryStage.show(); Dmessage("Module game1 End");
new javafx.scene ...
I would add some debug messages in to check the value of your variables you’re creating to make sure they are actually getting created. Also, if there are any error messages in the logs, look at those or post them and I can try to look.
Your code looks pretty good though. It seems like you are close. I’m working on a gui update for TAI btw and I’ll add in some stuff so that what you’re doing is much easier in the future.
Quote me, or PM me and I'll reply as soon as I can!
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
-
- Explorer At Heart
- Posts: 790
- Joined: Sun Jun 11, 2017 4:30 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Switch
Re: [Tease AI Java] Developer's Guide and Help Thread
The problem with your code is that you aren't providing a path to the TeaseAI.class file.CatCrap wrote: ↑Sun Jan 06, 2019 9:56 pm Hi
I am exploring TeaseAI java and trying to create a mini game module.
Before I go down the rabbit hole of java, let me explain what I am trying to do. You can then advise if it is possible with TeaseAI.
I would like to draw a rectangle in a location over the current image.
Sounds simple right?
I tried using the javafx library to do it, but can not figure out how to output to the current stage...
Don't know if I am barking up the wrong tree.
Is it possible to interact with the stage in this way? perhaps some other fashion besides the javafx library that I might not have thought of?
If not, could it be considered for a future release?
Bonus points if we can detect mouse movements and keyboard presses outside the chat box.
It opens up possibilities such as a user must click a specific location in a picture to succeed.
Or using the arrow keys to move stuff around on the screen.
For what it is worth, here is the code I played with in the module.
I tried manipulating the "primaryStage" in the TeaseAI.java class. But that was just me grasping at straws.
Code: Select all
DMessage("Module game1 start", 1); rectangle = new javafx.scene.shape.Rectangle(); //Setting the properties of the rectangle rectangle.setX(150); rectangle.setY(75); rectangle.setWidth(300); rectangle.setHeight(150); //Creating a Group object root = new javafx.scene.Group(rectangle); //Creating a scene object scene = new javafx.scene.Scene(root, 600, 300); //Setting the title to the Stage as a test TeaseAI.primaryStage.setTitle("Please work"); //Adding the scene object to the stage TeaseAI.primaryStage.setScene(scene); //Displaying the contents of the stage again in an attempt to refresh... TeaseAI.primaryStage.show(); Dmessage("Module game1 End");
So you should try to use: me.goddragon.teaseai.TeaseAI (if that works)
Furthermore primaryStage is a class based private field. First you need the current TAJ instance:
let instance = me.goddragon.teaseai.TeaseAI.application;
Now currently there is no getter for your primaryStage. However there is the main scene that you can access:
instance.getScene(); will return it
You can play around with that. Currently I have no PC that I can use to test it, but tomorrow I might be able to work on something to show you how exactly you could do that ;)
-
- Explorer At Heart
- Posts: 790
- Joined: Sun Jun 11, 2017 4:30 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Switch
Re: [Tease AI Java] Developer's Guide and Help Thread
Here is an example for your rectangle:GodDragon wrote: ↑Sun Jan 06, 2019 11:27 pm
The problem with your code is that you aren't providing a path to the TeaseAI.class file.
So you should try to use: me.goddragon.teaseai.TeaseAI (if that works)
Furthermore primaryStage is a class based private field. First you need the current TAJ instance:
let instance = me.goddragon.teaseai.TeaseAI.application;
Now currently there is no getter for your primaryStage. However there is the main scene that you can access:
instance.getScene(); will return it
You can play around with that. Currently I have no PC that I can use to test it, but tomorrow I might be able to work on something to show you how exactly you could do that ;)
https://hastebin.com/oqanujumuv.js
One big example with controlling the size and stuff of the rectangle using w, a, s, d: (wasn't able to move it for some reason, but I guess that is because it is centered in the image view, there probably are solutions to this). However I would suggest creating your own window any.
https://hastebin.com/piwosuveka.js
Example for own window:
https://hastebin.com/votileqono.js
Re: [Tease AI Java] Developer's Guide and Help Thread
Hey!
Having a minor issue
Creating a running vocabulary called Test.js which contains
Then I'm running it in a script
var pHandValue = 230;
sendMessage("%Test%",2);
Getting error:
Which has me confused because the function has been created??
The chat simply prints !test!
I have this running vocabulary and it works fine..
What am I missing?
Best regards
Having a minor issue
Creating a running vocabulary called Test.js which contains
Code: Select all
function TestVocabulary() {
if (pHandValue == 230) {
return "nice";
} else {
return "error";
}
}
var pHandValue = 230;
sendMessage("%Test%",2);
Getting error:
Code: Select all
SEVERE: Vocabulary 'Test is missing the function to trigger it. Create the function 'testVocabulary()' for this to work.
The chat simply prints !test!
I have this running vocabulary and it works fine..
Code: Select all
function slaveNameVocabulary() {
var answers = ["slave","slut","pig"];
return answers[randomInteger(0, answers.length - 1)];
}
Best regards
Tribute to 1885 & those involved with Tease-AI.
Thank you for spending time on this awesome project!
Thank you for spending time on this awesome project!
-
- Explorer At Heart
- Posts: 790
- Joined: Sun Jun 11, 2017 4:30 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Switch
Re: [Tease AI Java] Developer's Guide and Help Thread
First letter of the function needs to be lower case as in the warning: testVocabulary instead of TestVocabulary (case sensitive)genome231 wrote: ↑Wed Jan 09, 2019 12:55 pm Hey!
Having a minor issue
Creating a running vocabulary called Test.js which containsThen I'm running it in a scriptCode: Select all
function TestVocabulary() { if (pHandValue == 230) { return "nice"; } else { return "error"; } }
var pHandValue = 230;
sendMessage("%Test%",2);
Getting error:Which has me confused because the function has been created??Code: Select all
SEVERE: Vocabulary 'Test is missing the function to trigger it. Create the function 'testVocabulary()' for this to work.
The chat simply prints !test!
I have this running vocabulary and it works fine..
What am I missing?Code: Select all
function slaveNameVocabulary() { var answers = ["slave","slut","pig"]; return answers[randomInteger(0, answers.length - 1)]; }
Best regards
-
- Explorer
- Posts: 24
- Joined: Tue Jul 12, 2016 9:08 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Switch
Re: [Tease AI Java] Developer's Guide and Help Thread
GodDragon wrote: ↑Mon Jan 07, 2019 7:34 pmHere is an example for your rectangle:GodDragon wrote: ↑Sun Jan 06, 2019 11:27 pm
The problem with your code is that you aren't providing a path to the TeaseAI.class file.
So you should try to use: me.goddragon.teaseai.TeaseAI (if that works)
Furthermore primaryStage is a class based private field. First you need the current TAJ instance:
let instance = me.goddragon.teaseai.TeaseAI.application;
Now currently there is no getter for your primaryStage. However there is the main scene that you can access:
instance.getScene(); will return it
You can play around with that. Currently I have no PC that I can use to test it, but tomorrow I might be able to work on something to show you how exactly you could do that ;)
https://hastebin.com/oqanujumuv.js
One big example with controlling the size and stuff of the rectangle using w, a, s, d: (wasn't able to move it for some reason, but I guess that is because it is centered in the image view, there probably are solutions to this). However I would suggest creating your own window any.
https://hastebin.com/piwosuveka.js
Example for own window:
https://hastebin.com/votileqono.js
Awe yes! Exactly what I was looking for!
I can now play around and script my game.
I'll share the results once something comes from this.
-
- Explorer At Heart
- Posts: 464
- Joined: Sun Jun 11, 2017 12:53 am
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
- Dom/me(s): Courtney
- Sub/Slave(s): Courtney
- Location: Virginia
- Contact:
Re: [Tease AI Java] Developer's Guide and Help Thread
Sounds awesome! Can’t wait to see it!CatCrap wrote: ↑Wed Jan 09, 2019 9:36 pmGodDragon wrote: ↑Mon Jan 07, 2019 7:34 pmHere is an example for your rectangle:GodDragon wrote: ↑Sun Jan 06, 2019 11:27 pm
The problem with your code is that you aren't providing a path to the TeaseAI.class file.
So you should try to use: me.goddragon.teaseai.TeaseAI (if that works)
Furthermore primaryStage is a class based private field. First you need the current TAJ instance:
let instance = me.goddragon.teaseai.TeaseAI.application;
Now currently there is no getter for your primaryStage. However there is the main scene that you can access:
instance.getScene(); will return it
You can play around with that. Currently I have no PC that I can use to test it, but tomorrow I might be able to work on something to show you how exactly you could do that ;)
https://hastebin.com/oqanujumuv.js
One big example with controlling the size and stuff of the rectangle using w, a, s, d: (wasn't able to move it for some reason, but I guess that is because it is centered in the image view, there probably are solutions to this). However I would suggest creating your own window any.
https://hastebin.com/piwosuveka.js
Example for own window:
https://hastebin.com/votileqono.js
Awe yes! Exactly what I was looking for!
I can now play around and script my game.
I'll share the results once something comes from this.
Quote me, or PM me and I'll reply as soon as I can!
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Tease AI Java
Mischevious Tease AI Java Personality
Tease AI Java Developer's Guide
TAJUtils Guide
Who is online
Users browsing this forum: No registered users and 28 guests