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

Difference between revisions of "Cacbana (teardown)"

From Creatures Wiki
Jump to navigation Jump to search
Line 60: Line 60:
  
 
==Notes==
 
==Notes==
A semi-common fix to this script is to add a flower [[smell]] to the flowers.
+
*A semi-common fix to this script is to add a flower [[smell]] to the flowers.
The [[C3 Bootstrap V2]] shows some code in the plant timer script that was intended to make the cacbana wilt if the room was too hot.  It used OV64 and OV90, and was commented out in October 1999.
+
*The [[C3 Bootstrap V2]] shows some code in the plant timer script that was intended to make the cacbana wilt if the room was too hot.  It used OV64 and OV90, and was commented out in October 1999.
  
  
 
[[Category:Teardown]]
 
[[Category:Teardown]]

Revision as of 03:05, 20 March 2016

Cacbana
This article is a teardown of an existing CAOS script.
Game Version Creatures 3
Filename(s) cacbana.cos
Classifier 2 5 2 - cactus plant, 2 3 9 - cactus seed, 2 7 3 - cactus flower
Dependencies
Images cacbana.c16
Sounds none
Catalogue Tags none
Agents Balloon Bug
Other Heat CA

This is a teardown page explaining the details and inner workings of this agent. For general information, see Cacbana

The Cacbana is a simple plant agent found in C3. There are three distinct agents that make up the cacbana plant: the seeds, the plant itself and the flowers.

The seeds use the Object Variables OV00 to mean state - if it is dormant or not, OV80 to mean bounce count for the seeds, OV82 for the dormancy counter.

The plants use the Object Variables OV00 to indicate what state the plant is in, (growing, adult, fruit exposed, withdrawing fruit,dying); OV30 is the adult pose number, OV31 is a wilt modifier, OV32 is the fully open pose, OV33 is the first exposed frame, OV34 is the last dying pose, OV66 to mean time before the plant's maturity, OV16 and OV17 to identify their flowers, OV55 for the initial food store of the plants, OV56 for the food uptake of the plants, OV57 for the max food.

Scripts

Inject seeds

  • 10 seeds initially injected.
  • Sets the BHVR to 16 (Creatures can eat this agent)
  • Moves the agent to a random spot in the desert 5200 5500 400
  • tick is 15 - roughly every second and a half.

Eat seeds (12)

  • Script is locked
  • Stims the creature with eaten seed (77) at three times the intensity
  • waits 1
  • kills ownr

Collision - seed (6)

  • Note: this script is glitched - see Minor Fixes.
  • If the seed is not dormant, it checks to see if the wall is not up, with a nested DOIF. Then it adds 1 to the 'bounces made' OV and then checks to see if 'bounces made' is greater than max bounces allowed. If the seed is all bounced out, it checks to see if the room is hot enough and, if so, if there are fewer than 5 plants nearby and prepares to grow, using the subroutine grow. If there are more than 5 plants nearby, the seed becomes dormant, using the subroutine dorm. If the room is not hot enough, the seed also becomes dormant. If the 'bounces made' is less than the max bounces allowed, the seed bounces on.
  • If the seed is already dormant, it takes pose 0.
  • The subroutine grow instantly creates a plant agent near to the point where the seed was. If a test move fails, the plant is killed, and the seed does another bounce, after which the script is stopped. After this, the plant is moved to the location that was tested, and various attributes are set, including a tick of 100. The seed is killed.
  • The subroutine dorm sets ov82 to a random number between 10 and 100, sets the tick to 200, and sets ov00 to 1 (making the seed dormant)


Timer - seeds (9)

  • If the seed isn't dormant, and it still has bounces left, and it isn't falling or being carried, become dormant and stop the script.
  • If the seed is dormant, count down its dormancy timer.
    • If its time runs out, ALTR some smells in the room, and then kill the seed.
    • If the room is hot enough, count the number of plants nearby. If there are less than 5, go to the subroutine grow. If there are more than 5, perform a bounce.
  • The subroutine grow instantly creates a plant agent near to the point where the seed was. If a test move fails, the plant is killed, and the seed does another bounce, after which the script is stopped. After this, the plant is moved to the location that was tested, and various attributes are set, including a tick of 100. The seed is killed.

Timer - plant (9)

Timer - flower (9)

  • if the pose is less than 4, advance the pose.
  • if ov70 is 1 (the flower is fertilised), it uses a nested doif to check if the pose is less than 8. if so, it advances the pose. If not, it checks where it is, and then creates a seed. It then checks to see if the flower exists - if so, the OV (16 or 17) is set to null. If both flowers are set to null, ov80 and ov69 are set to 0, and ov66 is set to 100. The flower is then killed.

Pollination - flower (303)

  • sets OV70 to 1.

Death - flower (301)

  • targets ov16, if ov16 is the ownr, it uses SETA to make ov16 null and then kills the ownr. If ov17 is the ownr, it uses SETA to make ov17 null and then kills the ownr.

Remove

  • Removes all instances of the cacbana plant, seeds, and flowers. Also removes the plant's timer script.

Notes

  • A semi-common fix to this script is to add a flower smell to the flowers.
  • The C3 Bootstrap V2 shows some code in the plant timer script that was intended to make the cacbana wilt if the room was too hot. It used OV64 and OV90, and was commented out in October 1999.