[Patch Plant] [Patch Plant] Strawberries

An organized, ideally complete bank of released Garden Box agents. Find some new life to add to your world, or submit your own! Be sure to read the guidelines before submitting.

[Patch Plant] [Patch Plant] [Patch Plant] Strawberries

Postby The Second » Wed Apr 17, 2013 10:55 pm

Somewhere deep in space, out beyond even the Delta Quadrant, just past a small moon, a little to the right of an abandoned artificial intelligence core, there's a tiny spacecraft. Within that spacecraft is the laboratory of the (self admitted) mad genius Doctor Ni! Out here in the darkness of space, Doctor Ni works tirelessly to bring an end to galactic hunger.

Here to announce the Doctor's latest invention are his assistants, Danger Dave, Toxic Tina, and Gertie!

Image

These strawberries have been extensively tested by the team, certified 100% non-toxic by Toxic Tina (she got better), nutritious by Danger Dave (he got attacked by Gertie), and Grendel friendly by Gertie (she slept though most of the testing).

Final report: The strawberries are fruits that are a good source of Vitamin C and Anti-Oxidants, and also seem to have a mysterious calming effect on angry creatures.

That's it for today's new product. Stay tuned for more fantastic foodstuffs from Doctor Ni and his trusty assistants.

(Sprites have been altered slightly to remove artifacts. Please let me know of any bugs, and enjoy.)

And here's the code, to hopefully inspire others to create patch pants of their own.

Code: Select all
*This agent communicates with the Garden Box and sends over
*information about out fruit.  The ifo we'll be sending is: Name of our spawn script,
*the sprite file our fruit uses, along with the image number to use for a cursor when defining a patch
*for our fruit to grow on (remember that image arrays are zero based), and the classifier that our
*fruit uses.
new: simp 1 205 14901 "blnk" 0 0 9000
setv name "spawn_script" 1000
sets name "sprite_file" "strawberry"
setv name "sprite_pose" 11
setv name "prod_fmly" 2
setv name "prod_gnus" 8
setv name "prod_spcs" 14901
*And here's where we notify Garden Bos that were here and ready for action.  Garden Box also sends our
*agent some information: patch_plane tells out fruit which layer it will be drawn on in game, _p1_ and
*_p2_ tell our agent where in the world it's going to be spawned, patch_id tells it which patch it
*belongs to.
seta va00 targ
enum 1 1 22929
   mesg wrt+ targ 1000 va00 0 0
next
*Here's the spawn script; it's the one that's going to create our fruit for us.
scrp 1 205 14901 1000
   inst
   new: simp 2 8 14901 "strawberry" 14 0 name "patch_plane"
   attr 80
   bhvr 48
   accg 2
   perm 64
   fric 100
   elas 30
   aero 2
   mvto _p1_ _p2_
   setv name "patch_id" mame "patch_id"
   tick rand mame "tickfrom" mame "tickto"
*This is done just in case a tick equals zero.
   doif tick eq 0
      tick 200
   endi
endm
*The pickup script
scrp 2 8 14901 4
   lock
*if this is the first time it's been picked up, we're going to change it's attribute so that we and
*our creatures can interect with it.
   doif ov00 eq 0
*status keeps track of whether or not the strawberry is being held.
      setv ov00 1
   endi
   doif attr eq 67
      attr 195
   endi
*change the strawberry to it's 'being held' pose
   pose 12
   perm 60
endm

*pickup
scrp 2 8 14901 6
   doif carr eq null
      plne 4000
      *switch to the 'I've been dropped' pose
      pose 13
      *keeps track of whether it needs to draw
      *the fruit being held or the fruit laying
      *on the ground.
      setv ov02 0
   endi
endm

*Here's our fruit timer.  Thanks to Amaikokonut and Malkin for the code
scrp 2 8 14901 9
*If it's not being held...
   doif ov00 eq 0
      doif carr eq null
                       *& if it's pose is less than 12...
         doif pose lt 12
            setv va00 pose
                                *advance the pose by one.
            addv va00 1
            pose va00
         else
                               *or if it's pose is greater than 12, chnage it's attribute so that it can be picked up.
            doif attr eq 80
                               *and if it cane be picked up, then start generating fruit smell so that our
                               *creatures can find it.
               attr 67
               emit 7 0.01
            endi
                               *ov99 tracks how long our fruit has been in the world.
            addv ov99 1
         endi

         doif ov99 ge 20
            setv ov99 0
            doif attr eq 67
               attr 195
            endi
            setv ov00 1
         endi
      endi
   endi
*Now, if it's no longer on the patch...
   doif ov00 eq 1
        *Set patch_id to 0 so that it doesn't continue to take up space on the patch.
      setv name "patch_id" 0
      addv ov99 1
                *Am I 50 ticks old and not being held?  Time to die!
      doif ov99 ge 50
         doif carr eq null and room targ <> -1
            altr room targ 4 0.01
            altr room targ 3 0.01
            kill ownr
         endi
      endi
   endi
endm

*Collision
scrp 2 8 14901 6
   lock
   snde "smit"
   doif ov02 = 0
      pose 13
      setv ov02 1
   endi
endm

*eat script!
scrp 2 8 14901 12

   setv va00 posl
   setv va01 post
*let the creature know it's eaten fruit.
   stim writ from 78 1

   wait 10
   snde "ceat"

   seta ov90 null
   seta ov90 from

   gsub chems
   kill ownr

** Copypasta from DS lemons, then edited to give different chems

   subr chems
      inst
      doif ov90 <> null
         targ ov90
*Randomly generate numbers...
         setv va02 itof rand 1 4
         setv va03 itof rand 1 4
         setv va04 itof rand -1 -4
         divv va03 10.0
         divv va02 10.0
         divv va04 10.0
*and inject!
         chem 93 va02
         chem 99 va03
         chem 160 va04
      endi
      slow
   retn
endm

rscr
enum 1 205 14901
   kill targ
next
enum 2 8 14901
   kill targ
next
Attachments
gb_pp_strawberry.1.0.agents
(14.87 KiB) Downloaded 1179 times
Last edited by The Second on Sun Apr 21, 2013 1:15 pm, edited 1 time in total.
The Second
 
Posts: 6
Joined: Tue Apr 16, 2013 10:40 am

Re: Strawberries

Postby malkin » Thu Apr 18, 2013 12:42 am

Omnomnom - these look great! :D
malkin
 
Posts: 131
Joined: Sat Feb 11, 2012 3:55 am


Return to Agents Collective

Who is online

Users browsing this forum: No registered users and 1 guest