home *** CD-ROM | disk | FTP | other *** search
- #
- # Droids Cog Script
- #
- # CC_Crystal.cog
- #
- # This here thing creates crystals on the FLY.
- #
- # Desc:
- # 03/22/98 [DGS] Created
- #
- # --------------------------------------------------------------------------------
-
-
- symbols
- message startup
- message user0
- message arrived
- thing crystal_g
- template crystal_t
- int create_on_startup=0
- thing crystal_o local
- end
-
- ## Code Section
- code
- startup:
- // If the var create_on_startup is set to true, this routine will create the crystal at startup
- // and start it spinning. If that's the case, it should never recieve a user0 message (create) from
- // another cog. In other words, crystals that are created on startup should not be atached to the Jawa cog.
- if (create_on_startup != 0) call user0;
- return;
-
- user0:
- // When this is called, it creates a crystal and starts it a spinnin'
- crystal_o = creatething(crystal_t,crystal_g);
- capturething(crystal_o);
- rotatepivot(crystal_o,1,1);
-
- arrived:
- // This here keeps it spinnin'
- rotatepivot(crystal_o,1,1);
- return;
-
- end
-
-