|
Development Forum |
 |
| Detritus and Toxic Breeds | |
|  Tea Queen
Laura
    

|
8/26/2013 | |
So, in terms of this new patch plant I'm working on (an edible aubergine), I'm currently thinking of also making its detritus beneficial to any toxic breeds if they eat it. Perhaps even critters and insects could enjoy it too?
Is this possible to implement, while ensuring that non-toxic creatures don't eat the detritus, and what other specific things can toxic breeds benefit from? Thank you.  |
 Lollipop Lord
C-Rex
    

|
8/26/2013 | |
In regards to non-toxic creatures eating the detritus, I wouldn't worry as they usually avoid eating it anyway. I'm not sure what other specific things you could add though apart from chemicals such as gyloctoxin or cyanide. |
 Tea Queen
Laura
    

|
8/26/2013 | |
Thanks for that info, C-Rex; that's good to know. As far as the chemicals go, I'm guessing I'd only add either one or the another, not both? Also, does anyone know where I could find the code to make the detritus attractive to pests and bugs?  |
 Peppery One
Papriko
    
|
8/26/2013 | |
For chemicals you can do whatever you want. Inject none, inject 1, inject 5, inject 20... It's up to you and how many CHEM lines you are willing to add.
Poisons are for Toxic creatures pretty much like medicine to others. You have to decide if you want some detritus with mild curing effect or some omnipotent overkill, such as DS lemons for non-toxics.
For the pest-attracting part I can not think of a practical example right now, but in theory you can just get some object which already does and tear it apart. Looking at a pest or two might help as well to figure out the criterias they use to find their preferred meal.
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |
 Prodigal Sock
Ghosthande
    

|
8/26/2013 | |
Yes, you can inject an unlimited number of chemicals.
As far as pests and bugs are concerned... I'm not aware of any agent that "attracts" another agent into doing something. Generally the pest or bug has its own code which tells it to seek out flowers, detritus, etc. As long as your agent is classified as detritus, any pest or bug that is attracted to detritus will automatically consider your agent a food source.
The way people usually make fruit turn into detritus is by "swapping out" the fruit for a detritus agent with the rotten fruit sprite. This is basically the same as the kind of code you use when you make a dispenser; you just wait for the part where you'd normally change the sprite to a "rotting" sprite, but instead you make it create the detritus, move it to the fruit's location, then kill the fruit. If you use INST, it all happens instantaneously. 
 |
 Tea Queen
Laura
    

|
8/26/2013 | |
Ghosthande wrote: The way people usually make fruit turn into detritus is by "swapping out" the fruit for a detritus agent with the rotten fruit sprite. This is basically the same as the kind of code you use when you make a dispenser; you just wait for the part where you'd normally change the sprite to a "rotting" sprite, but instead you make it create the detritus, move it to the fruit's location, then kill the fruit. If you use INST, it all happens instantaneously.  Ah okay, so similar to what I did with the Bandicoot Box:
setv va00 posx
setv va01 posy
new: simp 2 8 14851 "bandicootbox" 18 1 501
bhvr 48
attr 195
elas 10
aero 5
accg 7
perm 100
fric 50
mvsf va00 va01
***animates nos. 0-14 fruit frames. 255 makes it spin constantly.
anim [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 255]
targ ownr |
|
 Peppery One
Papriko
    
|
8/26/2013 | |
I had suggested an OV variable to remember if it is rotten or not, a CATO and some DOIFs, but I guess that'd be too complicated at this point.
Juts go for the second agent. Then you can change the F1-right-click description as well.
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |
 Sanely Insane
RisenAngel
     Manager

|
8/26/2013 | |
Detritus has a separate eat stim (number 81 in CAOs terms) from other food items. Normal creatures getting stimmed with it get pain and glycotoxin.
If you use that stim, your detritus will be non palatable to normal creatures but delicious to toxic creatures, with the added bonus that it won't harm creatures who can eat detritus but are otherwise normal (like the Alien Norns).
~ The Realm ~
Risen Angel's Creatures Blog
|
 Tea Queen
Laura
    

|
8/26/2013 | |
Would someone mind writing me up an example script of everything that's been mentioned so far and posting it here, please? My CAOS skills still aren't up to much, and I'm finding all of this very difficult to visualise in my head. Thank you so all the information so far though; this is gold.  |

Malkin
     Manager

|
8/26/2013 | |
If you just want to make a general detritus item, then using the eat script to give stimulus 81 (eaten detritus) is the way to go. The genome of each norn will do the rest - it'll automatically be nutritious for Toxic Norns without you needing to inject any other chemicals. AquaShee explains why using stims is more appropriate than using chemical injections here. 
One of the key points in making it worthwhile for Toxic Norns and detritivore critters/bugs/pests is making it persist long enough in the world for it to be useful for them to hunt. If you're designing it as a food source for Toxics and detritivores, then make it last as long as a foodstuff before decaying.
To sum up - you've made food before, this is just another kind of food, which uses stim 81 (eat detritus) instead of the more familiar 77 (eat seed), 78 (eat fruit) and 79 (eat food). You can adapt any of your eat scripts that you've made before for foods as example code for your new detritus agent. 
My TCR Norns |
 Tea Queen
Laura
    

|
8/31/2013 | |
Hello again, guys. Here's the code I've written so far:
*install invisible flag agent
*using my range '14854' so the aubergines don't clash with other patch plants:
new: simp 1 205 14854 "blnk" 0 0 9000
*this is the script that the patch core will trigger when it's time to spawn an aubergine:
setv name "spawn_script" 1000
*sprite image file and frame when the aubergine is fully grown:
sets name "sprite_file" "aub1"
setv name "sprite_pose" 4
*classifiers (family, genus, species):
setv name "prod_fmly" 2
setv name "prod_gnus" 11
setv name "prod_spcs" 14854
*set va00 to targ, enumerate all the instances of the patch core agent
*send a message to that patch core agent that script 1000 is being targetted:
seta va00 targ
enum 1 1 22929
mesg wrt+ targ 1000 va00 0 0
next
*spawn:
scrp 1 205 14854 1000
inst
*create food and a random number:
setv va00 rand 1 2
*pick one of 2 random filenames:
doif va00 eq 1
sets va01 "aub1"
elif va00 eq 2
sets va01 "aub2"
endi
*changed to 10 in order to import all images
*changed "aubergines" to va01 which is the randomized filename:
new: simp 2 11 14854 va01 10 0 name "patch_plane"
*properties:
*attr 80 = growing stages invisible to creatures so they won't be picked up, and don't want them to suffer physics just yet:
attr 80
bhvr 32
accg 2
perm rand 40 60
elas 20
aero 1
fric 100
*move to co-ords sent by the core patch agent:
mvto _p1_ _p2_
setv name "patch_id" mame "patch_id"
*Ghosthande added... replaced the "tick rand mame" and tick condition
*sections with this:
tick 500
targ ownr
slow
endm
scrp 2 11 14854 9
*age it every tick:
addv ov00 1
*if it's not fully grown, grow it to the next stage (only on every other tick):
doif ov00 le 10
doif ov00 eq 1
elif ov00 eq 3
elif ov00 eq 5
elif ov00 eq 7
else
setv va00 pose
addv va00 1
*if it is fully grown, make sure creatures can see/grab it:
doif pose eq 4
attr 67
pose va00
stop
else
pose va00
endi
endi
*growing speed:
*EDIT THIS if you want it to rot sooner/later. Smaller number = sooner.
elif ov00 gt 25
*if it's fully grown and has been sitting on the plant for 10 turns
*it should fall off the patch.
*EDIT THIS if you want it to become grabbable sooner/later:
elif ov00 eq 17
doif attr eq 67
setv name "patch_id" 0
attr 195
stop
endi
endi
endm
*pickup:
scrp 2 7 14853 4
inst
*if it's attr is still 67, you (or a creature) are picking it directly off the plant and need to set it so it doesn't act attached to the patch anymore.
doif attr = 67
attr 195
stim writ from 84 1
*clear the patch_id variable so a new one can spawn:
setv name "patch_id" 0
endi
endm
*eat:
scrp 2 11 14854 12
*pose 4 is the frame of the full aubergine sprite file in "aub1.c16" and I want the creature to take a bite.
doif pose eq 4
sndc "chwp"
stim writ from 78 1
*pose 5 is the frame of the half-eaten aubergine sprite file in "aub1.c16" and I'm telling the engine that creature has taken a bite.
pose 5
elif pose eq 7
sndc "chwp"
stim writ from 78 1
wait 10
*the aubergine has now been completely eaten = kill ownr.
kill ownr
endi
endm
*vend script to turn rotting aubergines from food into detritus.
*This is so we can attract bugs and pests:
setv va00 posx
setv va01 posy
new: simp 2 11 14854 "aub1" 4 6 501
bhvr 32
attr 32
elas 20
aero 1
accg 2
perm rand 40 60
fric 100
mvsf va00 va01
*remove:
rscr
enum 1 205 14854
kill targ
next
enum 2 11 14854
kill targ
next
scrx 2 11 14854 4
scrx 2 11 14854 9
scrx 2 11 14854 12 |
1. The aubergines won't fall off the patch once they're fully grown; what am I missing? 
2. I'm not sure how to expand on my detritus script:
*vend script to turn rotting aubergines from food into detritus.
*This is so we can attract bugs and pests:
setv va00 posx
setv va01 posy
new: simp 2 11 14854 "aub1" 4 6 501
bhvr 32
attr 32
elas 20
aero 1
accg 2
perm rand 40 60
fric 100
mvsf va00 va01 |
My plan is to take on Ghosthande's suggestion by 'swapping out' the aubergine (food) for a detritus agent with the two rotting food sprites - full (frame 8 ) and half-eaten (frame 9) - you can see I've started it, but now I don't know how to continue writing it.
EDIT: If it helps any, here's the C16 file: aub1.c16
Any help would be appreciated, though I'd be grateful for simplified explanations where possible; I'm still very much a beginner and can find some of the complexities difficult to grasp! Thank you.  |
 Peppery One
Papriko
    
|
8/31/2013 | 1 |
1. Better use POSL (leftmost corner) and POST (topmost corner) instead of POSX and POSY (center positions). Agents always appear with their top-leftmost corner at the new position, so you also should use the top-leftmost position of the aubergine, otherwise your detritus may be a little offset.
2. After your detritus successfully has been moved, you should KILL OWNR to get rid of the original fruit.
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |

Malkin
     Manager

|
8/31/2013 | |
Hi Laura,
You're going really well, I'm looking forward to seeing this agent! 
I think that your vend script for the uneaten aubegerine turning into an uneaten detritus aubegerine needs to be in the timer script for the aubergine because it's 'stepping' from being a full, ripe, fruit, to being a detritus without interaction. At the moment, the detritus vend code isn't in any script, so it will cause errors.
So I guess... when it's getting ready to change to looking like detritus, you set the location (using posx & posy or posl & post), then you kill the original fruit, and replace it with a detritus agent, in the same location, using your vend code.
When you do that, you'll also need to create a timer script for your new detritus agent which steps it through to rotting completely away, and an eat script for your detritus.
I know it all sounds clear as mud at the moment, but don't despair! 
somewhere in the timer script for the aubergerine there should be a check, something like:
doif pose eq 7
setv va00 posx
setv va01 posy
inst
new: simp 2 11 14854 "aub1" 4 6 501
bhvr 32
attr 32
elas 20
aero 1
accg 2
perm rand 40 60
fric 100
mvsf va00 va01
kill ownr |
you'll notice that I put an INST in front of the creation code for the detritus - because you want the creation of your new item to happen instantaneously. There are a few complicated things that need to happen when you make a new item, and it's best to do them in one tick, so that nothing goes wrong.
Best of luck with working all this out! 
My TCR Norns |
 Tea Queen
Laura
    

|
9/6/2013 | |
So... I've used 'stim writ from 81', that's present in my code, but I want to inject some chemicals too, so that when toxic breeds devour my aubergine detritus it has a mild curing effect. Which chemicals are the best to use for this purpose, and how would the code look, please?  |
 Peppery One
Papriko
    
|
9/6/2013 | |
Well, I would get a distance to ATP-Decoupler, Cyanide and those. Even in small amounts they usually are rather lethal to non-toxics.
Glycotoxine might be worth a thought. It is neat for toxics and not that fatal for others.
The code itself is simple. Just use the goold old chem line you already know. All you have to do is finding out the IDs of the chemicals you want. Those can be given to you by someone who is a bit more into biochemistry.
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |

Malkin
     Manager

|
9/6/2013 | |
What kind of curing effect are you after? Vitamin C and Prostaglandin will cure any creature that they are given to (even creatures who eat the detritus by mistake). I've made some rough notes on the Toxic Norn genome here, I hope they help. 
My TCR Norns |
|