kaplin86 Cocrea: https://cocrea.world/@Kaplin86
Hey guys! Welcome to kaplinâs cooking show! Today we are making AI Salesman Spice cookies!!
This delicious meal includes AI text generation and even a working selling system! Lets get started!
This dish requires basic knowledge on how to use the AI extension, here is a tutorial by Jamin on how to use ai hub extension.
This tutorial is also recommended to be made in an EMPTY project before getting added/recreated in any games.
Ingredients/Shopping list
- Default Scratch Block (Baking Kit)
- Arkos Extension (Cinnamon)
- Syntactic Sugar Extension (Icing)
- AI Hub Extension (Dough)
Once you have all your ingredients in your kitchen, it should look like this.
Once you have your ingredients, we can begin mixing!!!
Instructions
- Start by adding a âWhen green flag clickedâ brand bowl. Here we are going to set all of the default info for our AI hub dough! You can freely edit this however you want, but it should end up looking something like this:
- Now that our dough has now been fully set up for proper baking, Add a âwait until touching mouse and mouse downâ egg to your bowl.
- Now that we have that, lets finish our work on the dough! Cut the dough with âAssistant/AIâ cookie cutters, if you want too you can add variable salt to help remember information such as the name for our batch of cookies!
- Here is a small trick that can make sure your ai dough is perfectly cooked to your liking! Use the âupdate background infoâ cookie cutter for our ai dough so we can start this trick. Then take out a edible ink list from the scratch baking kit, call it instructions, may even want to set it to âfor this sprite onlyâ , and put the reporter into the block.
- Now to finally fill out our instructions. Lets start off with giving the npc what items it can sell. Do something along the lines of: âThings you can sell: Great sword (30 currency) Ice wand (57 currency) arrow bundle (10 currency)â.
- Lets get straight to talking now. You could use something like WitCatâs Input Chocolate, But the budget i have wouldnât allow that. So for now we are just going to be using the âAsk and waitâ packets from the baking kit.
- Add a âRepeat Untilâ Brand mixer and put it into your âGreen flagâ brand bowl. You can make the condition for it whatever you like, i will go with pressing Q OR type âleaveâ.
Create another line that gives examples of the proper selling system, like: âTo give players items, do <Item name> (currency), like âHere ya go! <great sword>(20)â and âDeal! <ice wand>(50)Â â
To further make sure the ai will give the items add: âAfter you make a deal, if you dont give the item using <item name> (currency) you would have scammed the player and failed.â
Your final list should look like this:
First start the conversation by making the AI dough say hi, use this:
Test it out by running your project!
- Conversations? Yes please! So far we are making a somewhat simple AI Cookies, but we will soon make it AI salesman Spice Cookies!!! Add this simple line of code to make conversations work.
- Time to get real (er- i guess⌠get fake?)! Add a currency variable and items list. Add a If statement block after the âask and waitâ block. Inside your Arkos Extension Cinnamon, grab the âposition of ___ in ___, start from ___â grinder to grind the cinnamon. You can also use the Arkos Blank Utility block to see if the message contains the â<â character, like this:
- You may have noticed thats something off, how are we going to get what the ai said? Move the âchat with ___:___ and waitâ to a variable. To get the item that we purchased, we can use a combination of the âPosition ofâ and syntactic sugarâs âLetters ___ to ___ in ___â. First we will get the item then currency. Dont forget to add 1 to the first âposition ofâ to get the right places. Add a âAdd ___ to [list]â block and put in the item finder:
- Now, lets do the same with currency, make sure to turn it into a negative using * -1! Copy the âItem Finderâ into a variable then swap all the â<â and â>â to â(â and â)â
- To finish up our AI Salesman Spice Cookies dish, lets add some silverware to go with it. At the very top of your bowl, add âset currency to 300â and âdelete all inventoryâ.
- Quick little bugfix before we go, to make sure the ai salesman knows how much currency you have, add this code inside the loop:
FINISHED!!
Now enjoy this freshly made Ai salesman spice cookies! Make sure to send this cooking guide to all your scratch friends (if you want)!!!!!
GOOD THINGS TO CHANGE
Some good things you can change to fit your project:
- The actual chat system. You can use witcatâs input extension to make working textboxes and then have a button to send messages.
- Response display. Using the Animated Text Extension, you can easily show what NPCs are saying
- Visuals. Make it so when the player clicks on the store, it opens up a GUI and the person starts talking.
- Instructions. If you want, you could tell the ai to âalways try to make really high pricesâ inside the instructions, or the opposite.
- Personality. Similar to the last one, you can change the aiâs personality trait inside the âcreate a npc named ___â block.
Lazy? Here is a link to the project so you can remix it:
His name is mr. Sellington /\
.jpg&w=640&q=75)