blog, CCSF 2018, development

Metaroom survey

Hello folks!

Things have come to life in the CCSF Discord. It looks like something is definitely gonna happen during the CCSF 2018. Yay!

I would love to actively contribute some content. I think I’m gonna try to make a blog post about something every day. Maybe I’ll do some wolfling runs and stuff, I don’t know yet. I’m sure looking forward to the CCSF either way!

Anyways, for one of my blog posts I thought it would be really neat to know what the current Creatures 3 / Docking Station players value in a metaroom. I like making metarooms, so I like knowing what you people like. 😀

I made a survey, please fill it in! It only takes 5 minutes and it’s for SCIENCE. I’ll blog about the results. Everyone wins. Really! 😀

Metaroom Appreciation Survey

^ Go go, fill it in! Thank you ❀

Advertisements
development, tutorial

[code] Picking a random letter in CAOS

Malkin approached me on Discord, asking me how to pick a random letter. I’ve been using random numbers in CAOS with the RAND command for like forever, but I hadn’t found a reason yet to pick random letters. The question made me think, though.

Of course, there’s the old-fashioned, boring and bulky-code-way of just picking a random number between 1 and number-of-letters-in-the-alphabet. Then you can set a variable to a letter depending on the value of that number, in an if-elif-elif-elif-elif-… scenario.

Surely there should be a cleaner/easier way!

Recently I learned more about the CHAR variable thanks to Amaikokonut’s blog post over at Naturing :: Nurturing. I noticed char has two commands, one that returns a variable and one that sets a variable.

The command returning the character returns the ASCII number for that character.
I wondered if the one setting a variable also uses the ASCII code for a character: Yup!

So, all that’s left is to figure out the ASCII numbers of the characters you want to use.

For the characters A to Z, that’s 65 to 90. For the characters a to z, that’s 97 to 122.

So if you want a character between a to z, the resulting code would be this:

sets va00 “a”
setv va01 rand 97 122
char va00 1 va01

Nice and clean, right? 😀

 

development, Downloads

[Tool] Game Controller v2.0

Installing this agent allows you to quickly toggle between several game modes, some of which are particularly useful for developers and people who want to do wolfling runs without that pesky wolfling window.

The modes are as follows:

  • Render / do not render display
  • Fast / normal game speed
  • Autokill on/off
  • Play / pause game
  • Enable / disable creature hand holding
  • Enable / disable picking up creatures
  • Enable / disable hand visibility.

Continue reading “[Tool] Game Controller v2.0”

development, tutorial

[Code] How I (should) organize my files

..Yes, the ‘should’ is absolutely neccessary in that title.

When I’m working on a project, I tend to use a very specific naming scheme for my cosfiles and image files, but other than that everything of the project gets thrown into the same map, so if I want to compile the whole thing it’s a painless experience.

I always prefix my .cosfiles with the ID number they have. That way when I need to write their ID number down in the script somewhere, I can just glance at the filename. Also each .cosfile has a caos2pray chunk so if I would want to inject it as an agent I can just compile it.

Any .c16 files get prefixed with the name of the project, and suffixed with the name of the artist (except if draw them myself or if they are are grabbed/recolored from C1/C2/C3/DS).

To compile the whole project I create a new installer.cos file, create a caos2pray chunk that includes pretty much every file in that map and LINK the cosfiles into the caos2pray. Then if you want the complete agent to compile you can just drag the installer on Monk.

This is how I do it. Hope it’s somewhat helpful. 😀

 

development

[Code] Make an .agents file

You’ve probably read some tutorials here and there and tried to make a .cosfile on your own. Now the thing is, how do you actually get a neat .agents file that will show up in the agent injector?

I’ll teach you.

What do you need?

  • Monk (from the Jagent suite)
  • A folder containing your .cos script and any attachments you need (.c16, .catalogue, sound files, …)

What about EasyPray? And a prayfile?

Not needed. We’ll use Caos2Pray. There is an excellent explanation in this article on Naturing :: Nurturing.

The only thing it misses is an example of the *# LINK command, a very useful command I will explain further below.

For this case, we’ll go with making an easy script. You know, the tiny empathic vendor thing in the workshop? That little floating thing? It always annoyed me that I couldn’t separately inject it. But no more, I’ll teach you how to make it show up in the agent injector.

What are we going to do?

  • Create an instance of the empathic vendor ingame
  • Move it to the agent injector
  • Create the CAOS2Pray and compile the script into an agent.

For now, just open CAOS tool and create a new file.

Create an instance of the empathic vendor ingame

Since this is an existing object which gets loaded when the world gets loaded, the script is placed in the bootstrap/010 Docking Station/ folder. We need to know the classifier of the existing empathic vendor to be able to create a new one that uses the same script.

Feel free taking your time to browse in the bootstrap folder and learn what stuff you can find here. For now, we need the mini empathic vendor script. This script is called mini empathic vendor.cos. Open it and search for the bit where the vendor gets injected into the world.

** Create the Vendor
new: comp 2 23 9 “mini_vendor” 23 0 3000
attr 198
perm 60
accg 5
elas 0
bhvr 3
anim [0 1 2 3 4 5 6 7 8 9 10 11 255]
seta va00 targ

*** Move it to the workshop
*mvto 4800 9400

*move it into the chamber
rtar 1 1 154
doif targ ne null
seta va01 targ
spas va01 va00
else
targ va00
mvto 4800 9400
endi

Copy this into your cosfile.

We won’t need the part where the vendor gets moved into the workshop and the chamber, so you can entirely remove that part. Also, since va00 is being used to make the containment chember pick up the correct agent, that’s not needed either.

You can remove the bottom half of the script until you’re left with this:

** Create the Vendor
new: comp 2 23 9 “mini_vendor” 23 0 3000
attr 198
perm 60
accg 5
elas 0
bhvr 3
anim [0 1 2 3 4 5 6 7 8 9 10 11 255]

This creates an instance of the empathic vendor. Now we only have to move it to the agent injector.

Move to the agent injector

The ‘move something somewhere safely’ command is mvsf X Y.

The X and Y values of the agent injector are stored as game variables CreatorX and CreatorY, so the final piece of code would be this:

mvsf game “CreatorX” game “CreatorY”

Great!

You now made a cosfile that injects a mini empathic vendor in the agent injector space.

For completeness, you should now add a removal script on the end that removes every mini empathic vendor in the world.

** rscr indicates a removal script
rscr
** enumerate over all mini empathic vendors and target them
enum 2 23 9
** kill them
kill targ
** End the enumeration loop
next

If you manage to have CAOS tool working with your game, you could now inject the cos script by going through Inject – Inject install script (f9) or Inject install and event scripts (f11). If CAOS tool can’t communicate with your game, no worries, we’ll create a CAOS2PRAY chunk on top of this cosfile now, so we can compile it with Monk.

Create a CAOS2PRAY chunk

If you haven’t read the post on Naturing :: Nurturing yet, I urge you to do so now. It will help you understand the next part.

At the top of your .cosfile, add this chunk of text:

* CAOS2PRAY CHUNK
*# Pray-File “miniempathicvendor_YOURNAME.agents”
*# DS-Name “Mini Empathic Vendor (DS)”
*# depend mini_vendor.c16
*# desc = “This is a mini empathic vendor.”
*# Agent Animation File = “mini_vendor.c16”
*# Agent animation String = “0 1 2 3 4 5 6 7 8 9 10 11 255”
*# Agent Sprite First Image = 0
*# Agent Animation Gallery = “mini_vendor.c16”
*

This is pretty much all you need.

The total .cosfile should now look like this:

* CAOS2PRAY CHUNK
*# Pray-File “miniempathicvendor.agents”
*# DS-Name “Mini Empathic Vendor (DS)”
*# depend mini_vendor.c16
*# desc = “This is a mini empathic vendor.”
*# Agent Animation File = “mini_vendor.c16”
*# Agent animation String = “0 1 2 3 4 5 6 7 8 9 10 11 255”
*# Agent Sprite First Image = 0
*# Agent Animation Gallery = “mini_vendor.c16”
*
** Create the Vendor
new: comp 2 23 9 “mini_vendor” 23 0 3000
attr 198
perm 60
accg 5
elas 0
bhvr 3
anim [0 1 2 3 4 5 6 7 8 9 10 11 255]
mvsf game “CreatorX” game “CreatorY”
** rscr indicates a removal script
rscr
** enumerate over all mini empathic vendors and target them
enum 2 23 9
** kill them
kill targ
** End the enumeration loop
next

You can now save your cosfile, open Monk, drag & drop your cosfile on Monk, and… The magic happens! An agent called “miniempathicvendor.agents” is now in the folder where your .cos file originally happened to be.

miniemven.gif

Put the agent in your agents/ folder, make sure that you click on the ‘chat’ tab before reopening the agent injector window, and your agent should now show up under “Mini Empathic Vendor (DS)”.

That’s it!

 

Extra for advanced users: the “link” command

The *# link command syntax is like this:

*# link cosfile1.cos cosfile2.cos cosfile3.cos

This would be handy incase you’re making a metaroom project, for example, and have each toy, plant and animal coded in its separate .cos file, which you can then compile into one huge .agents file.

You don’t have to link the cosfile you run this command from.

 

I hope you found this post useful. 🙂

development, tutorial

[Code] Setting up a development environment for Docking Station

Hello all!

I will occasionally post some coding tutorials and other commented code for Docking Station here.

In this post I’ll show the development environment I’m using, and I’ll explain you how to set up your own under Windows 10.

Continue reading “[Code] Setting up a development environment for Docking Station”