creatures caves
welcome, guest 

downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
 
Development Forum
old
Making norns say things?   
savannahs11

savannahs11
United States  

 visit savannahs11's website: Dragon Station
  7/28/2014

I've been thinking about agent ideas,and I came up with a glitchy glitch blob of random colors that makes norns say random text like "tf$#5gy6%Dst%$fgu" when they eat it.(It's a blob of glitch.What do you expect?)I'm wondering how you do that.I know it's the sezz command,but how do I use it to get the desired result?

Somewhere, inhuman screeching can be heard.
 
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  7/28/2014

There are a few different concepts coming into play here.

To make something happen when the object is eaten, you must put the code in the eat script (script #12).

scrp 2 10 1000 12


Don't forget to put in the stimulus, so that your norns get the proper nutrients from it!

stim writ from 79 1


To make sure that the correct norn says what you want it to say, you must make sure that the target is from.

targ from


To make them say something, use the SEZZ command:

sezz "The goggles, they do nuzzing!"


It's good practice to shift the target back to the ownr...

targ ownr


before doing things like killing the food object

kill ownr


and ending the eat script.

endm


To make whatever it is random, you'll need to add in the RAND command and a long DOIF statement, using a variable - essentially rolling the random dice and then the dice says 1, the norn says 'the goggles do nothing!' and if the dice says 2, the norn says 'Ay Carumba!', etc. etc. etc. until you end your doif statement with an endi.

You can see a worked example of that in the C3 meerk.cos file - first the variable (va00) is set to be a random number between 0 and 5, then the doif begins, continues with elif, the last one is an else, and the doif statement finishes with an endi.

setv va00 rand 0 5
doif va00 eq 0
doif carr eq null
gsub dig_
else
gsub sit_
endi
elif va00 eq 1
gsub sit_
elif va00 eq 2
negv ov10
elif va00 eq 3
gsub run_
elif va00 eq 4
reps 3
gsub push
repe
else
gsub walk
endi
endi


Hope this helps!


My TCR Norns
 
Ghosthande
Prodigal Sock

Ghosthande
United States  

 visit Ghosthande's website: Breeders Beware
  7/28/2014

^ Precisely.

"From" in CAOS is shorthand for "whatever just made this script run"... in this case, the Creature that ate the agent.

"Ownr" is shorthand for "the agent that this script belongs to". In this case that means the piece of food being eaten.

If you'd like more information on using variables, I have an old tutorial here that explains what they are and how they work. It doesn't go into randomisation... but I think Malkin's explained that well enough. :)



 
Papriko
Peppery One

Papriko
Germany  


  7/29/2014

You could make fully randomly generated texts too. On the other hand, this would require some complicated messing with loops and character manipulation and what not. This would lead too far.

When you wanna have a look anyways, I might set up an example script.


Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
savannahs11

savannahs11
United States  

 visit savannahs11's website: Dragon Station
  7/29/2014

Well,that would make sense for the agent.It's an edible glitch blob.

Somewhere, inhuman screeching can be heard.
 
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  7/30/2014

I'd be interested in seeing a worked example of your idea, Papriko - I've not really used loops before in coding. :)

My TCR Norns
 
Papriko
Peppery One

Papriko
Germany  


  7/30/2014  1

Okay, I kinda thought of it like this:
* our random garbage string
sets va00 ""

* how many characters long our garbage will be
* RAND is a randomizer command for whole numbers.
* syntax: rand minimum maximum
sets va10 rand 8 24

* our counter
setv va20 1

* beginning the loop. All code after it will be repeated over and over
loop

* CHAR command can not add new characters, so we have to add a dummy one
adds va00 "x"

* CHAR changes the character at the n-th position to a different one. New chars are taken as numbers, see Unicode
* Creatures3 probably just can display a tiny fraction of unicode, so let's go for the first 256 or so
* syntax: char string n newchar
char va00 va20 rand 0 255

* add 1 to our counter
addv va20 1

* check if our counter va20 finally reached our maximum va10. If so, we are done, if not we gotta repeat this whole debauchery starting at the LOOP line.
untl va10 = va20


Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
evolnemesis
Code Monkey

evolnemesis
United States  


  7/30/2014

Papriko's code looks good... but I would suggest using
RAND 32 127
or
RAND 32 255

instead of
RAND 0 255


If you just want characters that can definitely be displayed, like letters, numbers, spaces, and punctuation, go 32 to 127...

Going 32 to 255 will add all kinds of letters with accents, currency and trademark symbols, fractions, box parts, and some other less-used odd characters too, some of which may not display correctly since the creatures font might not have representations for them... In this case, you could get just squares or something else unpredictable for a lot of those characters... (that might be okay for a glitch blob though)

You probably do want to avoid anything below 32 though... those are all control characters and almost all will not display, and many could cause weird game behavior as well.


"For small creatures such as we, the vastness is bearable only through love."
"We are a way for the cosmos to know itself." - Carl Sagan

 
Papriko
Peppery One

Papriko
Germany  


  7/31/2014

Thanks for the tip, I was guessing on that part.

Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
savannahs11

savannahs11
United States  

 visit savannahs11's website: Dragon Station
  10/4/2017

So, I came back to this piece of garbage and shoved Papriko's code into a pointless glitch button.

Somewhere, inhuman screeching can be heard.
 
Uzag

Uzag
Sweden  

 visit Uzag's website: DeviantArt
  10/4/2017

(...I'm in love with this glitch blob. Hilarious, adorable and not very useful = amazing)
 


downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
1 online
GimmeCat
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki