Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Can one cog capture more than one thing and receive all of those things messages?
Can one cog capture more than one thing and receive all of those things messages?
2004-10-02, 5:56 PM #1
DataMaster says:

"And because the capture cog captures individual things, it is usually used to handle specific things that have a special role in the game. A capture cog can capture as many things as needed. "

I would like to be able to handle all walkable architecture things messages in one cog. Can this be done with a single cog, using an array of things for instance?

Also, is there a maximum array size in cog? I've only gone up to 70-80...and I probably never even used half of that.
-El Scorcho

"Its dodgeball time!" -Stormy Waters
2004-10-02, 6:47 PM #2
Quote:
Can this be done with a single cog, using an array of things for instance?


Yeah, you could loop through all of the things using CaptureThing(). But is there some reason you have to capture them? Why not just use a class cog - i.e., just add cog=whatever.cog to the template.

Quote:
Also, is there a maximum array size in cog? I've only gone up to 70-80...and I probably never even used half of that.


Cogs don't really use arrays so much as they use offset numbers. Say you have:

int red
int blue
int green

red[0] is red, red[1] is blue, and red[2] is green. I doubt they even have to be the same type. So it depends on the size of the variable type you use (e.g., a vector is three times as large as a flex) - you can have as many variables in your array as the cog has room for. And the exact size no one knows.
Historians are the most powerful and dangerous members of any society. They must be watched carefully... They can spoil everything. - Nikita Khrushchev.
Kill one man, and you are a murderer. Kill millions of men, and you are a conqueror. Kill them all, and you are a god. - Jean Rostand.
2004-10-02, 7:11 PM #3
Ok, cool. Yeah, I knew about arrays actually being just a consecutive set of variables...but just how many variables can on cog have? Are you saying its virtually endless? (i.e., no one has met a limit)
-El Scorcho

"Its dodgeball time!" -Stormy Waters
2004-10-02, 8:58 PM #4
Oh, there is a limit, but I don't know off-hand what it is. I believe it's relatively high, though; I've never had a probem with hitting the limit.
Historians are the most powerful and dangerous members of any society. They must be watched carefully... They can spoil everything. - Nikita Khrushchev.
Kill one man, and you are a murderer. Kill millions of men, and you are a conqueror. Kill them all, and you are a god. - Jean Rostand.
2004-10-02, 9:06 PM #5
The limit is probably over 100, since rbots uses an array of size 100, and Warlord's cog had over like 120 sectors in an array...

And I'm sure it's clear by now, but a capture cog is like a secondary class cog, just assigned to a thing differently.

Too bad there isn't a CaptureSurface() or CaptureSector() verb of some sort :( -- those would have been handy on several previous occasions.
May the mass times acceleration be with you.
2004-10-03, 6:26 AM #6
Ok, thanks guys. I think I'll probably just end up going with a class cog anyway and just attach it to the parent template of all the walkstructures.
-El Scorcho

"Its dodgeball time!" -Stormy Waters

↑ Up to the top!