Comments are closed

cJass on the Google Code.
Our BugTracker (recommend to post bugreports and features request there).
Beta tester notes.

all times are GMT +04:00
Latest posts

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27

posted at 22/08/09 01:10
Dark Dragon

Ok, I see now.
Adolf didn't fix all textmacro-related bugs. By the way, we still weren't able to get along with the way of doing that. But I hope, we'll come to one decision soon and ttxtmacro processing will be remade in the next version.
VD

posted at 22/08/09 01:07
Dark Dragon

Or if you want you can change my librarys so that they compile with cjass if its more easy for u!
Саn you upload your code with the changes you made to the hive's pastebin and give me a link? I'll take a look at it.

posted at 22/08/09 01:05
Dark Dragon

Hi VD!
well you said that you tested my librarys and that there are 4 things i need to change to make them compile with cjass! could u please tell me what all did i do wrong, i mean what i need to change to make cjass compile them!
i already took all textmacros out from functions so it should be fine but now it crashes causing cjass not to compile it at all!
Thanks!
~DD

posted at 21/08/09 20:50
Dark Dragon

Could maybe ADOLF implement this?
real Min(real x, real y) {...}
real Max(real x, real y) {...}
nothing test() {
real f(real, real) = Min
real f2(real, real) = Max
f(1., 0.)
f2(1., 0.)
}
compiled to:
real Min(real x, real y) {...}
real Max(real x, real y) {...}
function interface func_type0 takes real arg1, real arg2 returns real
nothing test() {
func_type0 f = Min
func_type0 f2 = Max
f.evaluate(1., 0.)
f2.evaluate(1., 0.)
}
its more c++ like style but its not i cant live with function interface...
Greets!
~DD

posted at 21/08/09 18:44
Dark Dragon

I find out what causes it:
when i typed this:
boolean b = f.trans.value == f.e_trans
f.ff.evaluate(f.pp, f.trans.value, b)
it now works!
Yeah, I think that's because AdicHelper finds = and thinks that's a variable set, but it shouldn't do so.
Anyway, I'll notify Adolf =)

posted at 21/08/09 18:33
Dark Dragon

I found another bug!
f.ff.evaluate(f.pp, f.trans.value, f.trans.value == f.e_trans)
was compiled to:
set f.ff.evaluate(f.pp, f.trans.value, f.trans.value == f.e_trans)
it should be 'call' not 'set'
i can give you the whole include if u want! f is struct and ff is object of type function:
function interface fade_f takes pointer pp, real trans, boolean done returns nothing

posted at 21/08/09 17:41
Hellfim

Я тут пропустил немного... Добавьте break (exitwhen true), мелочь, а приятно =)
это можно задефайнить =)
define break = exitwhen true

posted at 21/08/09 17:09
Dark Dragon

K thanks did not know that! awesome and operators can be wrote in c++ like way!
really cool, now i hope &func can be added but well its just for nice look of code :)
Greets to u and ADOLF!
~Dark Dragon

posted at 21/08/09 17:00
Dark Dragon

heh i found a bug!
define {
Vector(v) = CopyVector(v)
Vector(x, y) = Vecto ## r(x, y, 0.)
}
nothing test() {
unit u = GetTriggerUnit()
vector v = Vector(GetUnitX(u), GetUnitY(u))
}
it will call Vector(v) instead of Vector(x, y)
why?
coz GetUnitX(u) takes 1 argument! and it thinks it needs to call Vector with 1 argument!
There is a small nuance in calling defines: if you want to pass an argument with brackets, you have to enclose it with <>, eg:
nothing test() {
unit u = GetTriggerUnit()
vector v = Vector(&lt;GetUnitX(u)&gt;, &lt;GetUnitY(u)&gt;)
}

posted at 21/08/09 14:44
Dark Dragon

k thats really cool!
btw now i was wondering is smth changed with defines as said in this new version coz my includes work different now...
maybe you will know better but here they are:
Thanks and greets!
~Dark Dragon

posted at 21/08/09 14:35
Dark Dragon

new version is out! well i would just like to know this new feature enums! whats that?
enum {Apple, Banana, Pear,...}
is it that or smth else? and how does it work!
thanks!
~Dark Dragon
Yeah, it's what you think.
Just in current version you are to use semicolon:
enum {Apple; Banana; Pear; ...}
or linebreak
enum (fructs) {
Apple
Banana
Pear
}
comma will be added in the next version
Still, now you cannot declare values to enum items - this will be added in next versions
VD

posted at 20/08/09 23:19
Dark Dragon

k ill do that!

posted at 20/08/09 23:05
Dark Dragon

K thanks and glade to hear that they might be added!
i think that this is a bug now!
operator nothing value= (real x) {
//...
}
Yeah, Adolf didn't implement c blocks for operators yet, so you are to write them in vex way (method operator value= takes ...) till next version :/

posted at 20/08/09 23:00
Van Damm

I think, both do{...}while() and for(,,,){...} loops will be added.
As for your first question, read my reply under your post =)

posted at 20/08/09 22:40
Dark Dragon

I see, i did not know how exactly this worked so yeah now i get it, ty!
btw i tested that whilenot! and it worked fine, but then i tried this:
does not work!

integer i = 0
while (i++ != 7) {
}

works:

integer i = 0
whilenot (i++ == 7) {
}

i was wondering why is that and is that correct or did i do again something wrong!
in c++ as far as i know there was while, for, do-while and goto loops...
anyway this is really not a problem, i was just wondering does while loop work and will maybe for loop be added! coz if i define while or for with defines i must use again endwhile and endfor...
Greets!
~Dark Dragon
The reason why there is whilenot, but no while is simple. Adolf just didn't want to add extra stuff to user-generated code. Here's the catch:
whilenot( cond ) { ... } is easily translated to
loop
exitwhen cond
...
endloop
But if we needed this: while( cond ) { ... } , we needed to add one not:
loop
exitwhen not cond
...
endloop
____________________________________________________________________
So, you can use this:
define while = whilenot not
and live in peace
VD

posted at 20/08/09 18:10
Dark Dragon

K not sure is this a bug! but this does not work!
define {
integer = integer
integer (h) = GetHandleId(h)
}
Now there are some limitations as for defines:
1) if define is overloaded, it should always be called with the braces after it even if there are no arguments (i think, this limitation will be removed)
2) if you want to redefine something to the same word, you should use ## inside of the define like
define TimerStart(time) = Timer ## Start(new timer, time, false, null)
3) I don't know why, but AdicHelper removes all spaces after defines with arguments (and overloaded defines are considered so even if they take no arguments), so if you write
define {
integer() = i ## nteger
integer(h) = GetHandleId(h)
}
you won't be able to use it because anything like
integer() i
will be transformed to
integeri
I'll discuss it with Adolf when he's back.
VD

posted at 20/08/09 13:27
Dark Dragon

k, and that "function smth" well its not like it takes to much time to write, but just simply i dont like it... it does not match c++ syntax at all :)
anyway do whatever u want and think is best, from now all things u guys implemented are awesome ;)
I understand, and don't like it too.
VD

posted at 20/08/09 01:42
Van Damm

I've thought about private: and public:, I'll propose that to Adolf when he's back.
And I'll think what we can do about that "function smth" stuff

posted at 19/08/09 22:27
Dark Dragon

As well i would like this syntax, if u like it as well maybe it can be implemented!
struct some {
private:
real x, y;
public:
static create() {return some.allocate()}
...
}
// yes i did read that pointers will not be included but i think this sytax will really be fine!
define void = nothing
void test() {
//..
}
void init() {
TimerStart(new timer, 0.1, false, &test)
}
or this maybe to..
void init() {
void* f(void) = &test;
TimerStart(new timer, 0.1, false, f)
}
that "void*" = "code"!
it really looks bad when i have to type that function test... its not any more cool when everything is in c++ like mode ;)
Greets!
~Dark Dragon

posted at 19/08/09 16:45
Dark Dragon

Ehh well i was thinking about cjass and stuff which i could make (i mean campaign or smth)
however i noticed what is missing xD
i know ur working hard, but i was wondering when will that TESH for cjass come out! coz i remember that u said that cjass TESH will have all this keywords and ofc that [ array bug fixed.. since when i press [ (Ctrl+Alt+F) it opens a search window but i want to write array [!
anyway keep it up!
~Dark Dragon

posted at 18/08/09 17:15
Dark Dragon

Lol i cant belive it but it actually fixed the problem!
once again thanks for help and i updated JNGPS 1.2 to 1.2a
Greets to u and ADOLF!
~Dark Dragon
np =)

posted at 18/08/09 16:57
Van Damm

OK, I've discovered what's the matter and fixed the glitch.
But please, make sure you do one of the following and update your JNGPS archive:
a) Replace all code in your wehack.lua, which deals with cJass, to the one, provided by cJass installer (including all " cJass" and " /cJass" comments)
b) (NOT RECOMMENDED!) You can use your own code dealing with cJass, but begin it with " cJass" and end with " /cJass" lines.
PS: these lines are required for the updater to find what code to replace if it needs to update it.

posted at 18/08/09 16:19
Dark Dragon

Yeah it seems i got it all working, exept that random error pops up when that AutoUpdater is executed. for example i enabled AutoUpdater and i put the old version of AdicHelper.exe. i started the editor and: www.hiveworkshop.com/forums/pastebin_data/r3x66d/untitled2.jpg
after i press "Close" it will say whats the new version and will update it. so it works but this pops up for no reason.
yeah sry i really should notify u faster but this is really the last comment xD
Greets and thanks for help!
~Dark Dragon
Thanks, I'll look into it
VD

posted at 18/08/09 15:35
Dark Dragon

k ty this helps a lot!
btw i am currently trying to add your cjass.lua features, but i have a question.
wehack.runprocess2("AdicHelper\\AdicHelper.exe /mapoptz=\ .. mappath.."\)
should that go after JH or before it and what does optimizer actually do? since cjass by default optimizes script, this must do smth else or does it tell not to remove spaces and so on if its disabled...
as well define <test this> = smth
this is new as well? and i can do new timer and so on :)
i saw that in your .j example
It will really be easier if you contact me via some instant messenger =)
It's AdicHeler's own optimizer, it's run after jasshelper optimizations. For now it doesn't do much, but eventually Adolf promised to implement more =)
If you want to see where anything goes in wehack.lua, just install latest cJass to a folder with a clean JNGP. Then you can open wehack.lua, all cJass code regions are surrounded by cJass#x and /cJass#x comments =)
Btw, you can check the file "cj_typesEx.j" in the "AdicHelper\lib\syn\" folder. So you can include and use it if you like.
VD

posted at 18/08/09 14:40
Van Damm

I'm working on the full-scale manual for cJass syntax now.
For now there is no public description of new features available, so I'll describe some of them:
  • any blocked construct can now be used with {} (like loop {} etc.)
  • locals can be declared anywhere in the function
  • in-line ++ and -- were added, so now you can write smth like b = ++с
  • whilenot (cond) { ... } is equal to loop { exitwhen cond; ... }
  • overloaded defines can be used like a temporary substitute to default arguments:
define {
TimerStart() = Timer ## Start (CreateTimer(), 65536., false, null)
TimerStart(t) = Timer ## Start (t, 65536., false, null)
TimerStart(t, x, b, f) = Timer ## Start (t, x, b, f)
}

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27

[back to top]