Welcome to the Creatures Wiki! Log in and join the community.

Food that turns into edible detritus when eaten

From Creatures Wiki
Revision as of 05:42, 30 March 2021 by ScoobyGambit (talk | contribs)
Jump to navigation Jump to search

This food uses the power of CATO to change creatures' perception of an object (and interactions with an object) without using another class number to create a detritus object.

CAOS2PRAY

Monk, ready to use CAOS2PRAY.

CAOS2PRAY is a feature included with RProgrammer's Jagent which allows the coder to not have to code a separate PRAY file in their agents. This chunk of code goes at the top of the COS file, and when it is dragged and dropped onto Monk (also part of the Jagent suite), compiles the cos file, with its dependent sprite file, into an agent that will be easy for everyone to install and play with. For more details on CAOS2PRAY, see CAOS2PRAY: An Easier Way by Amaikokonut.

    • CAOS2PRAY
    1. Pray-File "tutorial_food_detritus.agents"
    2. DS-Name "Tutorial Food Detritus"
    3. attach tutorial_food_detritus.c16
    4. desc = "A food that turns into edible detritus when eaten."
    5. Agent Animation File = "tutorial_food_detritus.c16"
    6. Agent Animation String = "0"
    7. Agent Sprite First Image = 0
    8. Agent Animation gallery = "tutorial_food_detritus"
    9. Web URL = "creatures.wiki"
    10. Web Label = "Creatures Wiki"

Installation script

Create a new simple agent, using the classifier numbers 2 11 5000 and using the sprite (image) file "tutorial_food_detritus.c16". Use two images from the tutorial_food_detritus file, located at position 0 in the file (because computers start counting at 0) and have it at image plane 560 in the world. A common error that can be introduced here is "Pose change failed", caused by miscounting the amount of images that are being used, by not including image #0. new: simp 2 11 5000 "tutorial_food_detritus" 2 0 560 attr 195 fric 100 accg 1.8 elas 0 perm 100 pose 0 doif gnam eq "Docking Station" setv va00 game "CreatorX" setv va01 game "CreatorY" doif va00 eq 0 and va01 eq 0 setv va00 6110 setv va01 9200 endi doif tmvt va00 va01 eq 1 mvto va00 va01 emit 8 .1 else mvsf va00 va01 emit 8 .1 endi elif gnam eq "Creatures 3" doif tmvt 5671 3599 eq 1 mvto 5671 3599 emit 8 .1 else mvsf 5671 3599 emit 8 .1 endi endi bhvr 48 over

Eat script

scrp 2 11 5000 12 inst doif pose eq 0 stim writ from 79 1 pose 1 cato 10 emit 8 0 targ from drop else stim writ from 81 1 kill ownr endi endm

Remove script

rscr enum 2 11 5000 kill targ next scrx 2 11 5000 12

Whole script

**CAOS2PRAY
*# Pray-File "tutorial_food_detritus.agents"
*# DS-Name "Tutorial Food Detritus"
*# attach tutorial_food_detritus.c16
*# desc = "A food that turns into edible detritus when eaten."
*# Agent Animation File = "tutorial_food_detritus.c16"
*# Agent Animation String = "0"
*# Agent Sprite First Image = 0
*# Agent Animation gallery = "tutorial_food_detritus"
*# Web URL = "creatures.wiki"
*# Web Label = "Creatures Wiki"

new: simp 2 11 5000 "tutorial_food_detritus" 2 0 560
attr 195
fric 100
accg 1.8
elas 0
perm 100
pose 0
doif gnam eq "Docking Station"
	setv va00 game "CreatorX"
	setv va01 game "CreatorY"
	doif va00 eq 0 and va01 eq 0
		setv va00 6110
		setv va01 9200
	endi
	doif tmvt va00 va01 eq 1
		mvto va00 va01
		emit 8 .1
	else
		mvsf va00 va01
		emit 8 .1
	endi
elif gnam eq "Creatures 3"
	doif tmvt 5671 3599 eq 1
		mvto 5671 3599
		emit 8 .1
	else
		mvsf 5671 3599
		emit 8 .1
	endi
endi
bhvr 48
over

scrp 2 11 5000 12
	inst
	doif pose eq 0
		stim writ from 79 1
		pose 1
		cato 10
		emit 8 0
		targ from
		drop
	else
		stim writ from 81 1
		kill ownr
	endi
endm

rscr
enum 2 11 5000
	kill targ
next
scrx 2 11 5000 12