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 → Send in... Kusari.
Send in... Kusari.
2005-08-25, 12:48 AM #1
  • Static Arrays
  • Dynamic Arrays
  • Prefix and suffix incrementation operators
  • Full set of assignment operators (+=)
  • Boolean type


Apart from the above which have already been added, the first person to post a language feature here wins it.

Then I'll see how bored I am after that.
2005-08-25, 3:06 AM #2
* FindSectorAtPos(vector)
* String variables, ie: `string foo="test" local`, `print(foo)`
* Function to split strings into arrays
* String concatenation, ie: `foo="test" . "blah" . "test"`
* Convert functions for string->int and int->string
And when the moment is right, I'm gonna fly a kite.
2005-08-25, 3:56 AM #3
Language features please.

Those are all COG Library improvements, I'm looking for base language changes.
2005-08-25, 4:13 AM #4
* Function declarations with return values

[EDIT] I was thinking of JavaScript when I mentioned these, but if inline variables and functions are going to be implemented then these should be considered:
* reference operator
* VBscript 'option explicit'-like command to force explicit variable declarations
Dreams of a dreamer from afar to a fardreamer.
2005-08-25, 12:55 PM #5
Returning functions - somewhat exist.
Additional threads per cog would be nice if not already implemented. (JK limit is 5)
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-08-25, 1:16 PM #6
I'm referring to user-defined functions (with arguments and a return value) that can be called like standard cog library functions, and which you can #include into other cogs (I think Jon implemented such a directive).

Another feature that would be nice is inline variable definitions, i.e.
thing player = jkGetLocalPlayer();
vector myVec = GetThingLVec(player);

Variable scope should be the { } block or message in which it is declared.
Dreams of a dreamer from afar to a fardreamer.
2005-08-25, 1:36 PM #7
I'm reluctant to add inline variables because that would mean adding them to the stack, but functions sound like a fun and simple addition.

EDIT: Actually, in order to add functions I'll also need to add inline variables.
COG's going to look mighty different in a couple of hours.
2005-08-25, 2:01 PM #8
Yes, I realized that as well, which is why I brought it up. Fun and simple? Glad to hear it, I was expecting to hear it's not feasible. I remember reading in that Gamasutra aritcle on COG that they dropped function declarations due to complexity.
Dreams of a dreamer from afar to a fardreamer.
2005-08-25, 4:12 PM #9
Originally posted by gbk:
* String variables, ie: `string foo="test" local`, `print(foo)`
* Function to split strings into arrays
* String concatenation, ie: `foo="test" . "blah" . "test"`
* Convert functions for string->int and int->string

COG already has strings. I don't think you can define them in the symbols section though. Everything else is already in the C++ standard library, plus many more string manipulation functions. I can't imagine it being hard to extend those into COG.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-08-25, 4:25 PM #10
Originally posted by Jon`C:
Language features please.


Fine. Make it object oriented. ;)
And when the moment is right, I'm gonna fly a kite.
2005-08-25, 5:11 PM #11
print(isTernarySupported()?"thanks!":"damn you!");
[ B A H ]
Bad *** by nature,
Hackers by choice
2005-08-25, 5:16 PM #12
Give us switch/case too
[ B A H ]
Bad *** by nature,
Hackers by choice
2005-08-25, 5:43 PM #13
Cogsole input/output in Canyon Oasis:
Code:
printvector(getthingpos(getlocalplayerthing()));printint(getthingsector(getlocalplayerthing()));printint(findsectoratpos(getthingpos(getlocalplayerthing())));
<x.-3.0447 y.2.42107 z.1.12011>
4
4
printvector(getthingpos(getlocalplayerthing()));printint(getthingsector(getlocalplayerthing()));printint(findsectoratpos(getthingpos(getlocalplayerthing())));
<x.-0.565079 y.-1.93497 z.-0.879786>
42
42
printvector(getthingpos(getlocalplayerthing()));printint(getthingsector(getlocalplayerthing()));printint(findsectoratpos(getthingpos(getlocalplayerthing())));
<x.-1.62434 y.2.45721 z.-1.67979>
37
37

Sige actually wrote the findsectoratpos function a while back for visibility, my COG function is really just a wrapper.
Capitalization
Commas
Periods
Question Marks
Apostrophes
Confusable Words
Plague Words
2005-08-25, 7:11 PM #14
Oh. String variables are already in, they can be defined in the symbols section or assigned in code.

In fact they should be in the last Linux version of the COG VM.

↑ Up to the top!