• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

cJASS Definition Library

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
Starting a thread where we can post definitions for common use or w/e : ). They may be keywords that are in C and are missing in cJASS, or they may be keywords to make life easier that are just obvious : ).

JASS:
define 
{
    <const> = constant
    <init> = initializer
    <Int> (x) = R2I(x)
    <Float> (x) = x.
}

JASS:
//Use
const int x = 0
scope Hi init ini
Int(7.2)
Float(7)

Trying to make the last 2 into this
JASS:
(Int) 7.2
(Float) 7

This is the start of my list. Everyone feel free to reply with more keywords for shortcuts and better ways to do stuffs =P.
 
Last edited:
Level 3
Joined
Oct 20, 2008
Messages
43
If you want print, you'd better use "cj_print.j" - among all others, it introduces "printf" function, which uses C-like formatting rules for output formatting and "DisplayTextToPlayer" for text output.

For now, you can read about it here


Anyway, the manual is coming in a couple of days =]
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
I think a very simple print statement should still be added, like Perl's simple print. I'm not into typing a whole lot of extra parameters I really don't need and I def hate the idea of typing sBJDebugMsg O-o.

sBJDebugMsg should just be print ^_^.

Also, for the float, didn't think about that, but really I'm still trying to get it to go with just plain typecasting =).

(float) (int) (unit) etc : D. The other handle types will require a special object handling thingie tho that Spawn uses : \.
 
Level 11
Joined
Feb 22, 2006
Messages
752
cJASS has not really become a standard yet. And in my opinion it's not going to become a standard anytime soon because all it really is is a bunch of syntactical eye candy that doesn't really add anything truly functional to JASS.

And in any case, I don't think this is the right place for this thread. I'm moving it to the triggers and scripts section.
 
Status
Not open for further replies.
Top