creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Plant Vanishes, Doesn't Rot   
Laura
Tea Queen

Laura
United Kingdom  

 visit Laura's website: CC Chat
  12/13/2015

Basically, this plant I'm coding injects fine, (after much blood, sweat and tears) creatures eat and interact with it fine, but it'll vanish suddenly, instead of gradually going through the rotting stages like it's supposed to. Autokill is turned off. What am I doing wrong, please?

Here is the code

Here is the c16 file *Spoilers!*

I'm really struggling to get to the bottom of this. :\ It's likely I've missed a detail or something... Now I remember why I haven't made many plant agents! All I want to do is create something nice for the community this Christmas, haha... I'm extremely grateful for any help. :)

 
Moe

Moe


 visit Moe's website: Creatures 2 to Docking Station
  12/13/2015  1

The Kill Ownr is out of the doif clause waiting for the carrot to reach the right pose. From the "*it smells like food" part of your script, it should look like:

* it smells like food
emit 8 0.5
endi

* KILLLLLLL ITTTTTTTT
kill ownr
endi
endi
endm

 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  12/13/2015

That worked a treat. :D Thanks!

They don't seem to be dying out anytime soon either, so I'm very happy about that. :)

 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  12/13/2015

Another question: Whereabouts in the code would I put a 'PUHL -1 29 55' line, please? I know it's supposed to go in the creation script, but there's quite a few of those.

Also: If this plant is rotten and is eaten, whoever eats it is supposed to get a small dose of alcohol. However, while testing, it only seems to produce glycotoxin instead? Why would this be? I checked the Creatures Wiki and it states that chemical 75 is alcohol. Here's a relevant snippet of code:

* detritus eaten script
scrp 2 10 14879 12
lock
targ from
* I have eaten detritus (ew!)
stim writ from 81 1
* small trace of alcohol for toxic breeds
chem 75 0.1
* 10-tick delay
wait 10
* Kill (okay, it was eaten)
kill ownr
endm

EDIT: Maybe I'm not waiting long enough to see the alcohol appear and take effect? See:

*10-tick delay
wait 10

That still doesn't explain to me about the glycotoxin though...

 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/13/2015  1

The stimulus itself produces glycotoxin, so maybe that's what you're seeing. 0.1 moles of alcohol is only a very small amount - the Shee Wine and Albian Ale have 0.15 and 0.45 moles of alcohol respectively. What's the half-life of alcohol?

My TCR Norns
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  12/13/2015

Ah, okay! Thanks, that makes a lot more sense. :) What would you recommend as a suitable amount of alcohol, Malkin? I'd like it to be noticable in HoverDoc, but still small enough not to get creatures that drunk.
 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/13/2015

The HoverDoc won't register any chemicals that are below 0.2 moles, so that it doesn't confuse players. Try it by injecting a full mole of alcohol and then watching the numbers go down.

My TCR Norns
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  12/13/2015

So, maybe 0.2?
 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/13/2015

Well, you could try 0.25, and then see how the number goes from 0.2 to 0 in HoverDoc. :)

My TCR Norns
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  12/13/2015

Okay, I'll try that. Thanks!

Also, do you happen to know about the PUHL thing, by any chance?

Whereabouts in the code would I put a 'PUHL -1 29 55' line, please? I know it's supposed to go in the creation script, but there's quite a few of those.

The only reason I'd like to use it is so that frames 02-17 in the C16 file don't look like they're floating in mid-air when they're picked up. :)

 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/13/2015

Some of those frames look like they belong to the carrot, and some look like they belong to the detritus - is that right?

If so, then puhl might be used both in the carrot install script and in the detritus install script.

Ghosthande seems to recommend using the CORE command, if you want to experiment.


My TCR Norns
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  12/13/2015

That's right: the non-faded frames are the regular plant, and the faded frames are the detritus.

I've had a look at Ghosthande's tut, and I would prefer to use CORE. :) The trouble is, I struggle with anything mathematical, like calculating pixel numbers. Please would someone be so kind as to help me figure out what the CORE line would be for frames 02-17, using the C16 file? Each frame is 58x58 pixels.

 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/13/2015

The default "ordinary" setting would be CORE 0 58 0 58.

From the tutorial, you open the carrot image in paint, zoom in and set the gridlines on, counting the black pixels until you get down to the actual carrot and then putting that number in instead of the second 58. Working from sprite 2, I got 38, so that number should be:

CORE 0 38 0 58


My TCR Norns
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  12/13/2015

Thank you very much. I understand it better now! :) So I just need to pop that line in both the normal plant and the detritus plant install scripts and I'm away?
 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/13/2015

Yeah, looks like it. If it doesn't quite work out in-game, try 46 for the second number - the first time, I counted the leaves in the image, and the 46 number is dropping it down to the sprite right in the middle.

My TCR Norns
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  12/13/2015

Sorry for all these questions, but I want to make sure I get things just right:

1. Is CORE 0 38 0 58 for all those frames (02-17)?

2. From the code: Where I have the install script subroutine (line 63) do I need to have two CORE lines? One for subr car1 and one for subr car2?

 
Moe

Moe


 visit Moe's website: Creatures 2 to Docking Station
  12/15/2015

CORE should set the core for all of the sprites. CORE is for the agent as a whole not the frames like PUHL. CORE should be set whenever a new agent is created, including in your subroutines. Try using DCOR while you test to see how your CORE values change the way the agent's bounding box moves.

Also, just for future reference, PUHL can be changed at almost any time, but CORE should only be changed at an object's moment of creation. If an agent's core/bounding box change causes it to intersect a world or room boundary it will crash, so changing it during a script is cautioned against.

In any case, if I may offer another suggestion, don't forget you can use a "Creation Script" to simplify your code. Subroutine car1 and car2 are almost identical in the following way:

"attr 199
accg 5
aero 20
bhvr 48
elas 0
setv ov61 60
emit 8 0.5"

Make a new script:

scrp 2 11 14879 10
attr 199
accg 5
aero 20
bhvr 48
elas 0
setv ov61 60
emit 8 0.5
endm

This script is run the MOMENT a new object with 2 11 14879 is created, and it applies anything you put in it to the new agent. It's great for applying common variables to your agents. With a script like this in your code, you can eliminate that whole bit from each subroutine. Your "new: simp etc" will automatically call the Creation Script and apply those common variables and anything else you want a new agent with that classifier to have. :)

 
GimmeCat

GimmeCat



  12/16/2015  1

Responding because I wrote the code being discussed by Moe;

Thanks for that! I didn't actually know about the creation script. Is that just a C3+ thing, or does it work for C2/C1 as well? I'm mainly a C2 coder so I probably didn't take much advantage of any newer features.

 
RisenAngel
Sanely Insane

RisenAngel

Manager


 visit RisenAngel's website: The Realm
  12/16/2015

The creation script is a DS-only script. You can use script 10 in C3 standalone, but it isn't automatic there; you'd have to call it manually via mesg writ.

As someone who tries coding for both C3 and DS, I personally don't like using it. To each their own, though.


~ The Realm ~
Risen Angel's Creatures Blog


 


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
0 online
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