Writing/Converting Garden Box Agents

Development guides, discussion, and testing for Garden Box compatible agents.

Writing/Converting Garden Box Agents

Postby Amaikokonut » Wed Aug 01, 2012 8:59 pm

This is a simple guide to making your agents Garden Box compatible. Guides to writing Decorations and Patch Plants, specialized kinds of Garden Box agents, can be found in other guide threads in this forum.

First, you just write the agent like any other agent. Eat scripts, growth scripts, flying scripts, whatever.

Then, in the injection script, mvsf your agent to game "ch_x" game "ch_y" to get it to inject where the crosshair is pointing. The agent should not inject unless the crosshair is in a valid position, so you shouldn’t need to worry about backup coords. Really, only extensive testing will tell, but my hope is that no one will have to write tmvt backups.

Really, that is all you need to do in the cosfile itself. The rest of the GB-compatible information is stored in the PRAY file.

You will need to prepare a display sprite no larger than 40x40 (unless you want to be known as “the lazy guy who’s huge sprites mess up my garden box.”). It is recommended that you have a specific sprite prepared for display. You will specify this in your prayfile.

Write your PRAY file as you would any other PRAY file, but keep these differences in mind:
- Use group DSGB “[Agent Name]” not AGNT, not DSAG. The chunk type must be DSGB for the Garden Box to detect it.
- Keep in mind that no two agents can have the same name or they will clash; that collectively includes all standard C3, DS, and GB agents, so it might be a good idea to denote your GB-specific agents with a prefix or suffix to avoid clashes.
- Dependencies, scripts, inline files, etc; are all written in as normal.
- Agent Description is written as normal, but keep in mind there is less space to display it on the Garden Box. Include details in a help file and just keep the description brief.
- "Agent Animation File", "Agent Animation Gallery", and "Agent Sprite First Image" are all still required, though animation itself is not supported (thus, "Agent Animation String" does not need to be included) These will point to your 40x40 display sprite.
- “Web URL”, “Web Icon” and so on are not supported. They won’t blow up anything, no, but they won’t do you any good.

The following new items can be included in your prayfile

“GB_Category” [integer 1-8]
Categories are as follows:
1: Patch Plant
2: Traditional Plant
3: Animal
4: Aquatic Plant
5: Aquatic Animal
6: Decoration
7: Tools
8: Misc/Other

- Take special caution to not accidentally label something as a patch plant or decoration that isn’t one (or vice versa), because agents in these categories are injected differently and are likely to crash the injector if they’re mislabled.

- If you don’t include a category, your agent won’t be able to be filtered. (it will still show up if no filter is applied).


"GB_Category Name" “[name]”
This is not required or even recommended. If your category is defined as a number higher than 8, this will attach a name to that number. Useful for creating your own categories, and annoying people by clashing your categories with theirs and slowing down the filtering process as the game tries to filter all those categories. Use sparingly, if ever.


Agent Author” “[Your Name]”
- Will display next to the agent name. I always wished the regular agent injector had something like this-- it would make tracking authors down a lot easier.
- If you don’t include an Author name, the author will show up as “Unknown.”

Otherwise, write as you would a normal prayfile.

Now personally, I'm as lazy as they come, so I actually use CAOS2PRAY with Jagent/Monk (Requires the latest version 2.0.4, updated 8-14-12) and have a block like this at the top of my cosfile:
Code: Select all
*# Pray-File "gb_pp_apples.agent"
*# DSGB-Name "Apples (C3)"
*# Depend apple.c16
*# Attach gb_applepatch.c16

*# desc = "Juicy, crunchy C3 apples, now available anywhere."
*# Agent Animation File = "gb_applepatch.c16"
*# Agent Animation Gallery = "gb_applepatch"
*# Agent Sprite First Image = 0
*# GB_Category = 1
*# Agent Author = "Amaikokonut"


Then select "PRAY Chunk" on Monk and drag the cosfile onto it. It should then compile the agent properly, assuming all the components are in the same folder. In my view, this is the easiest way to do things.

Feel free to ask any questions, let me know if there's any confusion, or just let me know if following these instructions works! :P
Amaikokonut
Site Admin
 
Posts: 171
Joined: Wed Feb 08, 2012 3:34 pm

Re: Writing/Converting Garden Box Agents

Postby Amaikokonut » Tue Aug 14, 2012 7:16 pm

Updated this guide to reflect the newest version of Jagent/Monk, in all its awesomeness.
Amaikokonut
Site Admin
 
Posts: 171
Joined: Wed Feb 08, 2012 3:34 pm

Re: Writing/Converting Garden Box Agents

Postby malkin » Sun Feb 03, 2013 6:54 pm

Could it be possible to add an 'Animal Patch' category, at all? 8-)
malkin
 
Posts: 131
Joined: Sat Feb 11, 2012 3:55 am

Re: Writing/Converting Garden Box Agents

Postby Amaikokonut » Sun Feb 03, 2013 11:13 pm

It's certainly possible.

I'm not really sure how I'm going to rework things for the next version. I might just make a very general "patch" flag for the patch agents. Right now the list of changes I want to make are so long I may as well be rewriting it from scratch, hah.
Amaikokonut
Site Admin
 
Posts: 171
Joined: Wed Feb 08, 2012 3:34 pm


Return to The Greenhouse Laboratory

Who is online

Users browsing this forum: No registered users and 1 guest