CAOS-Programmierung: Befehlsgruppen: Creatures

Aus Wikibooks

Creatures

AGES (command) times (integer)

Forces a creature to age the given number of times. See also CAGE.

APPR (command)

Creature approaches the IT agent. If there is no IT agent, the creature follows the CA smell to find an agent of that category. The script resumes 
when it gets there, or if it can't get any further.

ASLP (command) asleep (integer)

Make the creature asleep or awake. 1 for asleep, 0 for awake.

ASLP (integer)

Returns 1 if the creature is asleep, 0 otherwise.

ATTN (integer)

Returns the current focus of attention id.

BODY (command) set_number (integer) layer (integer)

Similar to WEAR, only puts the given set of clothes on every body part.

BODY (integer) bodyPart (integer)

Return the set number of the outfit the norn is wearing on the outer most layer or -1 if it is not wearing anything

BOOT (command) subboot_number (integer) folder_number_sum (integer) clear_world (integer)

Loads in a list of numbered bootstrap folders contained within a folder called subboot. Bootstraps folders numbers are powers of 2, sum the folder  
numbers to load those folders. There is provision for more than one subboot folder, these should be uniquely numbered.

BORN (command)

Signals the target creature as having been born - this sends a birth event, and sets the TAGE ticking.

BVAR (integer)

Returns the variant number for target creature.

BYIT (integer)

Returns 1 if the creature is within reach of the IT agent, or 0 if it isn't.

CAGE (integer)

Returns life stage of target creature. See also AGES.

CALG (command) category_id (integer) category_representative_algorithm_id (integer)

Choose how a creature (TARG) decides which particular object in a category to look at. PICK_NEAREST_IN_X_DIRECTION=0, PICK_A_RANDOM_ONE=1,  
PICK_NEAREST_IN_CURRENT_ROOM=2, PICK_NEAREST_TO_GROUND=3, PICK_RANDOM_NEAREST_IN_X_DIRECTION=4.

CALG (integer) category_id (integer)

Find out which algorithm is currently being used for the creature TARG to decide which particular object in a category to look at.

CHEM (command) chemical (integer) adjustment (float)

Adjusts chemical (0 to 255) by concentration -1.0 to +1.0 in the target creature's bloodstream.

CHEM (float) chemical (integer)

Returns concentration (0.0 to 1.0) of chemical (1 to 255) in the target creature's bloodstream.

CREA (integer) agent (agent)

Returns 1 if the agent is a creature, 0 if not.

DEAD (command)

Makes the target creature die, triggering Die script and history events, closing its eyes, and stopping brain and biochemistry updates. Not to be 
confused with KILL, which you will have to use later to remove the actual body.

DEAD (integer)

Returns 1 if target creature is dead, or 0 if alive.

DECN (integer)

Returns the current focus of decision id.

DFTX (float)

Returns X coordinate of creature's down foot.

DFTY (float)

Returns Y coordinate of creature's down foot.

DIRN (command) direction (integer)

Change creature to face a different direction. North 0, South 1, East 2, West 3.

DIRN (integer)

Returns the direction that target creature is facing. North 0, South 1, East 2, West 3.

DONE (command)

Stops the targetted creature doing any involuntary actions.

DREA (command) dream (integer)

Set to 1 to make the creature fall asleep and dream, 0 to stop the creature dreaming. When dreaming, a creature's instincts are processed. See also 
ASLP.

DREA (integer)

Returns 1 if the creature is asleep and dreaming, 0 otherwise.

DRIV (command) drive (integer) adjustment (float)

Adjusts the level of the given drive by the specified amount - can be positive or negative.

DRIV (float) drive (integer)

Returns the value (0.0 to 1.0) of the specified drive.

DRV! (integer)

Returns the id of the highest drive for the target creature.

EXPR (integer)

Returns the current facial expression index for the creature.

FACE (command) set_number (integer)

Sets a facial expression on target creature.

FACE (integer)

Returns the front facing pose for the current facial expression. See the FACE string rvalue.

FACE (string)

Returns the name of the sprite file for the target creature's face. Currently automatically gives you the youngest age version of the gallery but soon 
will work in the following way: If you set the parameter to -1 you will get the name of the file the creature is currently using. Note that when the 
creature ages, this file name will change (the GALL command could be useful here). If you set the parameter to a particular age then the filename 
returned will be the gallery that best matches that age. Use the FACE integer rvalue to get the pose number for facing forwards. See also LIMB.

FORF (command) creature_to_learn_about (agent)

Set the friends or foe lobe to learn from the creature.

HAIR (command) stage (integer)

Tidies or ruffles hair. Positive means tidy, negative untidy. There can be multiple stages of tidiness or untidiness; the more extreme the value the 
tidier or untidier.

HHLD (agent)

Returns the creature currently holding hands with the pointer agent. NULL if no agent is holding hands.

INJR (command) organ (integer) amount (integer)

Injures an organ, -1 to randomly choose the organ, 0 for the body organ.

INS# (integer)

Number of instincts still queued to be processed.

LIKE (command) creature_state_opinion_about (agent)

State a personal opinion about a creature.

LIMB (string) body_part (integer) genus (integer) gender (integer) age (integer) variant (integer)

Returns the filename for the specified part of a creature. If the exact part isn't present, a 'nearby' file which is on the disk is returned.

LOCI (command) type (integer) organ (integer) tissue (integer) id (integer) new_value (float)

Sets a biochemical locus value. See Receptor Locus Numbers and Emitter Locus Numbers

LOCI (float) type (integer) organ (integer) tissue (integer) id (integer)

Reads a biochemical locus value.

LTCY (command) action (integer) min (integer) max (integer)

Sets latency time on involuntary actions to a random value between min and max. After an involuntary action occurs, the same action will not be able 
to kick in again until after that many ticks. Min and max must range between 0 and 255.

MATE (command)

Male creature mates with the IT agent - if IT is a female of the same genus! The female doesn't need to be in reach. If successful, the sperm is  
transmitted to the female and there is a chance of conception. If pregnancy occurs, gene slot 1 of the mother contains the genome of the child.

MIND (command) state (integer)

Enable (1) or disable (0) the creature's brain (unlike ZOMB# in that the brain actually stops processing and it's output is frozen onto the one noun 
and verb).

MIND (integer)

Returns whether the creature TARG's brain is being processed or not.

MOTR (command) state (integer)

Enable (1) or disable (0) the creature's motor faculty, i.e. whether it sets the IT object and fires off scripts.

MOTR (integer)

Returns whether the creature TARG's motor faculty is being processed or not.

MVFT (command) x (float) y (float)

Move creature's down foot to position x,y. Use this instead of MVTO for creatures.

NEW: CRAG (command) family (integer) gene_agent (agent) gene_slot (integer) sex (integer) variant (integer) sprite_file (string) image_count (integer) first_image (integer) plane (integer)

Makes a non-skeletal creature. The first five arguments are the same as NEW: CREA. The last four, starting from the sprite file, are exactly as in 
NEW: COMP.

NEW: CREA (command) family (integer) gene_agent (agent) gene_slot (integer) sex (integer) variant (integer)

Makes a creature using the genome from the given gene slot in another agent. You'll want to use GENE CROS or GENE LOAD to fill that slot in first. 
The gene slot is cleared, as control of that genome is moved to the special slot 0 of the new creature, where it is expressed. Sex is 1 for male, 2  
for female or 0 for random. The variant can also be 0 for a random value between 1 and 8. See also NEWC.

NEWC (command) family (integer) gene_agent (agent) gene_slot (integer) sex (integer) variant (integer)

This version of NEW: CREA executes over a series of ticks, helping to prevent the pause caused by the creation of a creature with the NEW: CREA 
command. However, it cannot be used in install scripts (e.g. the bootstrap) and so NEW: CREA should be used for that.

NORN (command) creature (agent)

Chooses the active creature. Script 120 (Selected Creature Changed) is then executed on all agents which have it.

NORN (agent)

Returns the creature currently selected by the user.

NUDE (command)

Removes all clothes from a creature. Any changed layer 0 will revert to drawing the body part again. See WEAR.

ORDR SHOU (command) speech (string)

Sends a spoken command from target to all creatures that can hear it. As well as the usual speech that Creatures can understand, there is a special 
syntax that can be used for learning machines. This is as follows:
learn|perfect verb|noun|drive|qualifier|special|personal|nice_drive [number] [word]
Here the | means "or", the [number] is the id slot to learn, and [word] is the new text to fill that word in with. "perfect" makes the Creature learn 
it perfectly straight away, whereas "learn" does a gradually learning. See the Creatures 3 learning machine cos file for an example use.

ORDR SIGN (command) speech (string)

Sends a spoken command from target to all creatures that can see it.

ORDR TACT (command) speech (string)

Sends a spoken command from target to all creatures that are touching it.

ORDR WRIT (command) creature (agent) speech (string)

Sends a spoken command from target to the specified creature.

ORGF (float) organ_number (integer) data (integer)

Returns floating point data about the specified organ. The organ number is from 0 to ORGN - 1. The data parameter specifies what information is  
returned:
0 - Clock rate in updates per tick (as locus)
1 - Short term life force as a proportion of intial (as locus)
2 - Factor to modulate rate of repair (as locus)
3 - Injury to apply (as locus)
4 - Initial life force, a million is the largest initial value
5 - Short term life force, temporary damage
6 - Long term life force, permanent damage
7 - Long term rate damage during repair
8 - Energy cost to run this organ, calculated from the number of receptors, emitters and reactions
9 - Damage done to the organ if no energy is available

ORGI (integer) organ_number (integer) data (integer)

Returns integer data about the specified organ. The organ number is from 0 to ORGN - 1. The data parameter specifies what information is returned:
0 - receptor count
1 - emitter count
2 - reaction count.

ORGN (integer)

Returns the number of organs in target creature.

PLMD (command) tract_index, (integer) filename (string)

Dumps out all the dendrite learned information of the specified tract to a file (will be changed to sync with Palm).

PLMU (command) tract_index, (integer) filename (string)

Configures the dendrites in the specified tract with the data in the file (will be changed to sync with Palm).

SAYN (command)

Creature expresses need, by speaking.

SEEN (agent) category (integer)

Returns the agent which the creature TARG has currently in mind for the category specified.

SOUL (command) facultyId (integer) on (integer)

Enable (1) or disable (0) the update on the creature's faculty as given by type id as follows: Sensory Faculty (0), Brain (1), Motor Faculty (2), 
Linguistic Faculty (3), Biochemistry (4), Reproductive Faculty (5), Expressive Faculty (6), Music Faculty (7), Life Faculty (8)

SOUL (integer) facultyId (integer)

Returns whether the creature faculty of the type specified is being processed or not.

SPNL (command) lobe_moniker (string) neuron_id (integer) value (float)

This sets the input of the neuron in the lobe specified to be the value given.

STEP (command) facultyId (integer)

Does one update of the specified faculty (for faculty id see SOUL#).

STIM SHOU (command) stimulus (integer) strength (float)

Shout a stimulus to all creatures who can hear OWNR. The strength is a multiplier for the stimulus. Set to 1 for a default stimulation, 2 for a  
stronger stimulation and so on. It is important you use this, rather than send several stims, as it affects learning. Set strength to 0 to prevent
learning altogether, and send a strength 1 chemical change. See the table of Stimulus Numbers.

STIM SIGN (command) stimulus (integer) strength (float)

Send a stimulus to all creatures who can see OWNR.

STIM TACT (command) stimulus (integer) strength (float)

Send a stimulus to all creatures who are touching OWNR.

STIM WRIT (command) creature (agent) stimulus (integer) strength (float)

Send stimulus to a specific creature. Can be used from an install script, but the stimulus will be from NULL, so the creature will react but not learn.

SWAY SHOU (command) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float)

Stimulate all creatures that can hear OWNR to adjust four drives by the given amounts.

SWAY SIGN (command) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float)

Stimulate all creatures that can see OWNR to adjust four drives by the given amounts.

SWAY TACT (command) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float)

Stimulate all creatures that are touching OWNR to adjust four drives by the given amounts.

SWAY WRIT (command) creature (agent) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float)

Stimulate a specific creature to adjust four drives by the given amounts.

TAGE (integer)

Returns the age in ticks since the target creature was BORN. Ticking stops when the creature dies - see DEAD.

TOUC (command)

Make creature reach out to touch the IT agent. Blocks the script until the creature either reaches the agent, or it's fully stretched and still can't.

UFTX (float)

Returns X coordinate of creature's up foot.

UFTY (float)

Returns Y coordinate of creature's up foot.

UNCS (command) unconscious (integer)

Make the creature conscious or unconscious. 0 for conscious, 1 for unconscious.

UNCS (integer)

Returns 1 if the creature is unconscious, 0 otherwise.

URGE SHOU (command) noun_stim (float) verb_id (integer) verb_stim (float)

Urge all creatures who can hear OWNR to perform the verb_id action on OWNR. Stimuli can range from -1 to 1, ranging from discourage to encourage.

URGE SIGN (command) noun_stim (float) verb_id (integer) verb_stim (float)

Urge all creatures who can see OWNR to perform an action on OWNR.

URGE TACT (command) noun_stim (float) verb_id (integer) verb_stim (float)

Urge all creatures who are touching OWNR to perform an action on OWNR.

URGE WRIT (command) creature (agent) noun_id (integer) noun_stim (float) verb_id (integer) verb_stim (float)

Urge a specific creature to perform a specific action on a specific noun. A stimulus greater than 1 will force the Creature to perform an action, or 
to set its attention (mind control!). Use an id -1 and stim greater than 1 to unforce it.

VOCB (command)

Learn all vocabulary instantly.

WALK (command)

Sets creature walking indefinitely. Chooses a walking gait according to chemo-receptors. Always means ignore IT and walk in the current direction set 
by DIRN.

WEAR (command) body_id (integer) set_number (integer) layer (integer)

Sets a layer of clothing on part of the creature. The set_number is the type of clothing to put on from the overlay file - think of it as an outfit 
number. layer 0 is the actual body of the creature, so unless you want to replace the body part itself use a higher layer. Higher layers are on top of 
lower ones. e.g. 0 for a face, 1 for measels spots, 2 for a fencing mask. See also BODY and NUDE.

ZOMB (command) zombie (integer)

Make or undo the creature's zombification factor. 1 makes creatures zombies: in a zombie state creatures won't process any decision scripts but they 
will respond to ANIMs and POSEs. 0 umzombifies.

ZOMB (integer)

Returns 1 if the creature is zombified (has its brain to motor link severed), 0 otherwise.