How do i find out what a sprite is saying or thinking

title self-explanatory

Short answer is that you can't

there has to be some way, right?

There's usually always a way (using JavaScript) but no simple way of getting current speak/think status of a sprite

what javascript code does it

I've no idea - might not even be possible even with JavaScript

The right way, is to create a custom block that sets a sprite local variable to the value you want the sprite to say, then say that value. After that, you can just get the value of what the sprite is saying by getting the variable.

A radical way to know what another sprite is saying: tell the other sprite what to say.
But I guess @ego-lay_atman-bay ’s solution is friendlier.

i guess. but what if i dont want to use variables or database

If you don’t want to make any (even minor) changes to other sprites’ code, you could follow @cymplecy’s suggestion and research whether the underlying Javascript code’s keeps usable data. If not, and you would like to try using Snap! primitives only … in short: It’s going to be really, really - did I mention: really? - complicated; and slow. AI-type stuff like polling the stage’s “pixels” for color changes, and trying to determine which text they represent; asking other sprites for their scripts and analyzing those in order to guess whiich script may have said or thought the text.

For trivial case this may work

But why? Are you trying to make some kind of a online project sharing?

What I'm making

im making a better snap!
its called Snap!+

how do i know the difference between saying and thinking

untitled script pic - 2024-06-27T224445.689

thanks. this is perfect.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.