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 11/10/09 23:32
Troll-Brain

I know you're not a fan about not removing comments from the war3map.j, but i've already explained why it's usefull sometimes for me.
Since you didn't answered clearly no or yes, i ask it again.
Will you leave this part of optimisation only if AdicOptimizer is enable ?

posted at 11/10/09 19:59
weaaddar

I'm having some issue with using defines within defines.
Here is an example map that has the problem::
If you go to the define InitList(T) found in the sometest trigger uncomment the registerType statement and note that it will crash AdicHelper. If rapidshare doesn't work I can just email you guys.
I'm having troubles downloading from rapidshare :( Can you please upload the file somewhere else or send it to my email EvilGreedyStalker@gmail.com
~VD

posted at 10/10/09 21:16
Guest

sorry.. because 1.4.0.1 can work.
so i think this can work too.
Syntax error on such cases was added in recent version.
~VD

posted at 10/10/09 20:55
Guest

can't Work in 1.4.1.5
#if xxx
#define {
yyy = zzz
}
#endif
Please, read manual carefully. <span class="code">#define</span> cannot be used inside of conditional compilation blocks, <span class="code">#setdef</span> can be.
~VD

posted at 09/10/09 20:52
Guest

cJASS 100% does not work with zinc : (
New version (1.4.1.5) 100% works with zinc. It just ignores zinc.
~VD

posted at 08/10/09 23:59
Dark Dragon

i see!
k i actually fixed that!
define <call ...>
will work! but maybe if possible ADOLF can make that defines compile if they are called by call :)
anyway np i know how to fix that now but it would be nice if ADOLF can implement call MyDefine()!
Greets!
~DD

posted at 08/10/09 18:06
Guest

Any cJass way for defaults in interfaces?
private interface MyInterface
method someMethod takes nothing returns nothing defaults nothing
endinterface

posted at 08/10/09 16:22
Guest

Bug! : O
else {
set i = RunStack.current.data
If I get rid of the set, it suddenly freaks O_o, no idea why. Putting the set in there or putting it on the next line or something else fixes, but yea, o-o. weird
else {
i = RunStack.current.data
Please provide slightly more code so I can see the context =)
~VD

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

Hi ADOLF!
i was hooking one of blizzard funcs!
and this line made the cjass not to compile any of code...
define NewSoundEnvironment(file) = { ClearMapMusic(); NewSoundEnvironment(file) }
could u please fix that :)
Greets!
~DD
Damn, I should really write that in manual in capital letters! However, it's written there in the section where function hooking is explained. If you <a href="manual-en#htoc22">read it</a>, you'll find an answer to your question.
And ADOLF should really add some error reporting on this case :/
~VD

posted at 07/10/09 20:46
Guest

Please redownload the updater and replace the old one
Ok, it works
But you didn't update the changelog, what changes in the new version, "only" some bug fix ?
For now, local changelog isn't changed by autoupdater. That will be added in future versions.
~VD

posted at 07/10/09 20:37
Guest

Can't Work:
#define Test (Name) = {
library Name
#include "cj_types_priv.j"
void ABC () {
}
endlibrary
}
Test(Unit)
You cannot use #include instruction in #define block.
~ADOLF

posted at 07/10/09 20:31
Troll-Brain

Nvm, DisplayTextFromPlayer is hella slow, I just benchmarked it o-o
Who care, really ?
I will still use it because its friendly user and don't break replays.
ON-TOPIC
I've a bug with AHupdate.exe , it always try to download a new version and i've to close it with the task manager.
And if fact i don't get the new version with it.
Please <a href="files/?AHupdate.exe">redownload the updater</a> and replace the old one
~VD

posted at 07/10/09 11:22
Guest

Nvm, DisplayTextFromPlayer is hella slow, I just benchmarked it o-o

posted at 07/10/09 11:13
Guest

for printf, rather than using DisplayTextToPlayer(GetLocalPlayer()..), you could use-
globals
player GLOBAL_PLAYER = Player(15)
endglobals
DisplayTimedTextFromPlayer(GLOBAL_PLAYER, 0, 0, 100, "hi")
That auto displays text to all players... : P
It's not widely known. It also displays text to the player it's from ^_^. I believe it broadcasts text out to every given player in the game, including the origin player. It'd be like GetLocalPlayer() but wouldn't corrupt replays and should be faster =).
I haven't benchmarked it, but you should ^_^

posted at 07/10/09 08:06
weaaddar

Congrats on going public.The manual is nice, but you should put a link to it on the front page :).

posted at 07/10/09 04:14
Mooglefrooglian

Slight bug in the new TESH.
private constant string ESCAPED_CHARS = " \\"
This highlights everything after it blue, as if it were a string. cJass compiles fine, but TESH highlights it wrong.

posted at 07/10/09 02:59
Guest

struct Hi {}
struct Oh : Hi {}
One liner control structures-
if true printf("hi")
do printf("hello") whilenot ++x > 100
Collections (2 lines of extra code in the map)
collection x
x[x.size++] = 1 //push, 2 lines
value = x[x.size--] //pop, 2 lines
value = x[3] //array implementation
value = x.delete(3) //removal, auto index, and return the removed value, 2 lines
I made a very tiny utility that does this... and it's literally 2 lines of code in the map for all of these features-
integer index
type array collection
And that is it. Everything else is something of a definition. Auto indexed arrays would be extremely nice. Reason they are collections and not stacks is the order isn't maintained ><.
Here is my implementation:

private static integer size = -1
private static $type$ array data

public static method last takes nothing returns integer
return thistype.size
endmethod

public static method add takes nothing returns nothing
set thistype.size = thistype.size + 1
endmethod

public static method remove takes nothing returns nothing
set thistype.size = thistype.size - 1
endmethod

public static method operator []= takes integer index, $type$ value returns nothing
set thistype.data[index] = value
endmethod

public static method operator [] takes integer index returns $type$
return thistype.data[index]
endmethod

public static method push takes $type$ value returns nothing
set thistype.data[thistype.size] = value
endmethod

public static method pop takes nothing returns $type$
return thistype.data[thistype.size]
endmethod

public static method index takes integer slot returns nothing
set thistype.data[slot] = thistype.data[thistype.size]
endmethod

It's put into a struct that extends an array, meaning everything is removed and all of the methods are inlined. The optimizer is screwy (vex did it on purpose) and won't remove all inlined methods.. : |... I can't make a cJASS version on definitions because it'd still work off of inlined methods, which wouldn't get removed by vexorian's vJASS or optimizer >< (no apparent reason).
Soo... : D
Also, I brought this up with Vexorian too-
Make an inline keyword that automatically inlines the contents of a method or function.
Of course, answer again was no, which makes 0 sense =P. If I have a 2 line method and I want to inline it, Vexorian is pretty much saying, too bad, my language, don't like it, make your own.
So yea : D, fixing up stuff Vexorian refuses to address like those issues would be a major plus ^_^.
Oh yes, and sealed structs and protected members would be fun. Sometimes I have private members in a module to prevent collision (proper OOP) when people use them and what not (no need to show them), but then I can't use them in other add-on modules because they are private ><. I really need a protected thing and bad, =).
Again, great work guys, check out this almost unreadable code I wrote-
scope MyScope initializer MyFirstLoop {
void MyFirstLoop() {
int array myArray; int max = GetRandomInt(1, 100), iterator = max
do {myArray[iterator] = iterator * 10} whilenot --iterator == 0
max = 0; iterator = 1
do {printf(I2S(myArray[iterator]))} whilenot myArray[++iterator] == 0
}
}
gg : D

posted at 07/10/09 00:47
Troll-Brain

Thx.
I hadn't understood this part, now it's clear :)

posted at 06/10/09 19:43
Troll-Brain

So in other words, is it possible , and how exactly, or would you add this feature ?
I've deleted your post cause it's too huge.
You cannot directly use same name for define and for its contents as it will cause recursive replace. But you can do it by using concatenation operator <span class="code">##</span>. In your case you should do the following:
<div class="code">#define private CreateTimer = Create##Timer
#define private DestroyTimer = Destroy##Timer</div>And you're done!
~VD

posted at 06/10/09 09:31
Guest

int[] who
vrs
int array who
Oh yea, sry for this double feedback thing, but can't really edit ^_^
int[12] who
vrs
int array who[12]
Tx, lol. Yea : D. Was surprised that wasn't in cJASS actually o-o.
And-
int[12,12] who
vrs
int array who[12][12]
Yeah, this thing is obvious and it's already in our to-do list.
Not completely as you suggest, rather like <span class="code">int who[]</span> or <span class="code">int who[12]</span>
~VD

posted at 03/10/09 23:19
Dark Dragon

Yeah thanks!
i did use the #guard
however problem is that i need to init specific variables before anything is called, infact i have to hook InitBlizzard but i need to know if in specific level i do need to init that variable, basically is smth included... or simply is specific define defined anywhere in the map :)
Greets and thanks!
~DD

posted at 03/10/09 23:12
Sebra

@Dark Dragon
About #if DidIDefineIt != null ...
#guard construction is enough to protect you from multiple including the same file.

posted at 03/10/09 22:56
Dark Dragon

yes i do know it does not work but i would like that it works... anyway its not top priority!
ill send u an pm at hive VD!
~DD

posted at 03/10/09 21:57
Mooglefrooglian

"bug, says double define!
define <GetDummyFilter()> = LibMain_dummy_filter
#if GetDummyFilter() != LibMain_dummy_filter
define <GetDummyFilter()> = null
#endif
i am currently using 1.4.0.1!
Greets!
~DD"
Read the manual. It is included so you don't have to spam these feedback sections. It says you must use setdef, or it will error. Somewhere around 3.7 in the manual.
Please, read the documentation carefully.
<a href="http://cjass.xgm.ru/manual-en#htoc26">Here</a> in the second paragraph:
"In such conditional blocks you can write any code with one limitation: they shouldn’t contain identical define declarations: "
Please read it, the way of doing it is described there.
In the future, parser will give errors if you try to use #define in conditional blocks
~VD
Parser 1.4.0.2 do it
~ADOLF

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]