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 +03: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 09/09/09 04:00
Sevion

Ah, just figured something out.
You can't use operators in vJASS with AdicParser on.
Stuff like Table will bug on the operator declarations.

posted at 08/09/09 05:54
weaaddar

Me again, I'd like to use this to create a simpler define as my types name is now very ugly.
My types name is Dict_integer_integer.
So I'd like to have to type instead Dict(int,int)
So I do the following define:
define <Dict(TKey,TValue)> = Dict_##TKey##_##TValue
And I use it like so:
Dict(int,int) myDict = Dict(int,int).create();
However what translates does not actually make useable jass, it becomes::
Dictionary_Integer_IntegermyDict for some reason. How can I prevent it from slaming the type in?
As I see, there is a bug now: parser removes the spaces after curved brackets. I'll tell that to ADOLF and he'll fix it, I hope.
As I don't know if or when he'll fix this certain bug, for now you can use a workaround:
<div class="code"><b>define</b> {
&nbsp;&nbsp;&nbsp;SPACE =
&nbsp;&nbsp;&nbsp;Dict(TKey,TValue) = Dict_##TKey##_##TValue SPACE
}
</div>
VD

posted at 08/09/09 04:42
Guest

Is there a way to do multiline defines?
Like for instances, I'd like to make multiple structs that are very similar, now I can do that with textmacro and runmacro, but its ugly and would force me to use the runmacro and thus no Cjass syntax.
You are just to use block inside of define like:
<div class="code">define my = {
&nbsp;&nbsp;&nbsp;BJDebugMsg("1")
&nbsp;&nbsp;&nbsp;BJDebugMsg("2")
}</div>

posted at 08/09/09 01:40
Inferior

Hey there guys.
There is something I want you to fix maybe.
If you use cJass you cannot use the feature of JassHelper to declare natives in MapScript, because it is handled as a global declarated Variable and will cause an error in JassHelper syntax.
I would be glad if you could fix this anyhow.
Thanks for report, we'll look through that problem.
VD

posted at 07/09/09 20:36
Sevion

Thanks! Followed the steps, now cJASS works again :D
Don't really know how it happened though.
By the way, don't know if this helps resolve future problems, but my cJASS wouldn't update passed 1.3.3.7 before I downloaded the linked updater.
That was entirely my fault - a small bug in that version of updater (1.0.3.1) From now on everything should be OK.
VD

posted at 07/09/09 17:01
Dark Dragon

i see thats really awesome!
thanks for info :)
~DD

posted at 07/09/09 16:50
Dark Dragon

Hi ADOLF and VD!
first of all i would like to thank u for this change in strings... it is an minor thing but somehow when i see that cJass menu insted of C Jass and such... well all other menues start with upper case and when cJass starts with lower case it is somehow pain in the eye "for me" ofc its not such a big deal but i like it more when everything looks more nice... thats why i asked!
about in C Jass menu names well basically they are almost the same except for AdicHelper was now replace with cJass! since menu name is C Jass and language name is cJass it makes more sence if it tells for example Enable cJass! and update string was just optimitzed... AutoUpdate string remained as you named it...
about this new update it looks awesome, i did not have a net for some time again but now ill be sure to update JNGPS and this update is nice.
if possible can u ADOLF or Van Damm simply write an simple syntax for this new addons like #if and %...
Greets and thanks!
~DD
It's like
<div class="code">
<b>define</b> war3_124 = 1
#if war3_124 == 1 <i>// for now, only == and != are implemented</i>
&nbsp;&nbsp;&nbsp;<b>define</b> H2I = GetHandleId
#endif
</div>
% can be used in string formatting instead of ^ to make it more C-like.
As well, I've completed the manual in russian and now I'm translating it to english.
VD

posted at 06/09/09 07:56
Sevion

For some reason I can't use cJASS in my maps anymore. I have cJASS enabled, but it doesn't (seem to be) run. Any time I use something like
scope Test {
}
JassHelper pops errors on { saying "Unexpected '{'"
<a name="update-fix"></a><br/>Please follow the next steps to fix the issue:
<ol style="padding-left:40px;">
<li>Download <a href="files/?AHupdate.exe">updater</a></li>
<li>Place it to the "AdicHelper" folder, replacing the old one</li>
<li>Delete "cjcv.dll"</li>
<li>Run AHupdate.exe</li>
<li>Now everything should be OK</li></ol>
Sorry for inconvenience, such issues will not happen again.

posted at 05/09/09 17:47
weaaddar

Just want to point out that this is incorrect:
// When player drags item to slot NN
order_itemdrag00 = 852002
order_itemdrag01 = 852003
order_itemdrag02 = 852004
order_itemdrag03 = 852005
order_itemdrag04 = 852006
order_itemdrag05 = 852007

// When player uses item in slot NN
order_itemuse00 = 852002
order_itemuse01 = 852003
order_itemuse02 = 852004
order_itemuse03 = 852005
order_itemuse04 = 852006
order_itemuse05 = 852007
I believe the uses start 852008, but its been a long while.
I realize that you guys don't want to mess with vJass syntax too much, but I think that this projects more powerful syntax could be used to implement some much improved features::
i.e.
int[] myArray = {1,2,3,4,5} (or maybe new int[]{1,2,3,4,5}).
I would also recommend a std::collection type library. Collections are used allover the place, and arrays don't always cut it in Jass. Now that the Hashtable type exists, you have an object that can be treated like a first class Jass object. Add a layer of compile time type-safety and then you can fix the operators. Hashtable could be used to implement all the objects, and its performance is only slightly worse then the Jass's array.
It can then be trivial to create an iterator class, and leave us with this syntax:
foreach(T obj in myCollection)
{
...
}
Thanks for pointing it out! I've just fixed it.
As for array declarations, they are probable to be implemented.
As for everything other, now we have no type check layer in the tool and I don't know if ADOLF will add it in the future, but we'll discuss your propositions, thanks.
VD

posted at 03/09/09 14:45
Dark Dragon

ohh that was a quick reply, thanks VD i am looking forward to ur manula :)
Greets!
~DD

posted at 03/09/09 14:41
Dark Dragon

Hi ADOLF!
well i see u relesed new version and in changelog u say smth about "setdef"
can u tell me what is that, or simply syntax... i guess it changes the defined value?
btw is there #ifndef and that stuff?
sry its just that i would like to know features but since Van Damm did not release jet his manual it would be great if u would explain some features :)
Greets!
~DD
setdef changes the define value
<div class="code">
void test () {
&nbsp; <b>define</b> msg = "text"
&nbsp; BJDebugMsg(msg) <i>// will print "text"</i>
&nbsp; <b>setdef</b> msg = "other text"
&nbsp; BJDebugMsg(msg) <i>// will print "other text"</i>
}
</div>
undef is not yet implemented, but it will soon be
The manual is in process, I hope to finish it rather soon =)
VD

posted at 02/09/09 02:58
Dark Dragon

Hi ADOLF!
well since there was that problem with cjass updater, Van Damm has recoded some part of code and send me the scripts...
its for JNGPS which u can find here: www.hiveworkshop.com/forums/pastebin.php?id=pf0275
i would like that u check it (yes i know that ur not to good with english but...)
anyway stuff i would like to gain is permission to change cJass strings "names" in JNGPS menu.
at first i coded my onw cJass code but updater deleted/replaced it so i accepted it since its fine... but the names just do no look right to me somehow, so i would only like to know do u allow me to set them that way, VD said that u liked this other names so i wanted to know!
thanks and greets!
~Dark Dragon
ok, but why?)
ADOLF

posted at 01/09/09 15:32
Dark Dragon

k i updated my JNGPS to 1.2f and everything works again but anyway if you know what caused this bug, try to fix it xD
i as well recoded my part in JNGPS on that editor startup it completely again edited the code but sry i dont know why it again happend... anyway i used global strings as names coz i again saw names changed to smth like cJass in menu and such! however i am glade that stuff again works and i hope that next update cJass will have AutoUpdater will be fine ;)
Greets!
~Dark Dragon
I've sent you a PM @ hive
VD

posted at 01/09/09 14:58
Dark Dragon

Van Damm! i just executed JNGPS editor and it updater crashed, one guy discoverd it before i did and well yeah it for some reason crashes... if possible please fix it!
thanks!
~DD
Bugs fixed, thanks.

posted at 30/08/09 16:47
Element of Water

Oh, I just saw they fixed it. I'll update now.
=)
ADOLF

posted at 30/08/09 13:07
Dark Dragon

@ Element of Water
ohh i see it compiles at first but laiter say error not on define but on scope where you call it. it says unknown block, it hink its coz you can use {} inside defines but not sure...

posted at 30/08/09 11:53
Element of Water

BUG
library TimedCLoop
{
define CLoop (ScopeName, Period) =
{
scope ScopeName
{
private real TIMER_INTERVAL = Period
}
}
}
CLoop(Test, 0.01)
Unkown block error on the scope. It seems you can't use all the cJass features inside cJass defines... maybe you need to do the search and replace on the defines before you handle any of the other syntax.
Thanks for report. We'll look into your problem and find out what we can fix =)
VD
Fixed in 1.3.4.1
ADOLF

posted at 29/08/09 17:10
Dark Dragon

k xD np! but i saw an large code out there and i am lazy to understand all that but i feel that ADOLF added some new cool features. anyway ill wait for manual.
Greets!
~DD

posted at 29/08/09 13:54
Dark Dragon

Hi ADOLF!
auto updater updated cjass to latest version but when i inclde cj_print.j it says that it cant open the include, whatever it may be...
as well i thought that file would be in "lib" folder but i cant find it xD
anyway nice update as always!
~DD
Sorry, that's my fault, I wasn't fast enough to reconfigure autoupdater. For now you can get the file from <a href="files/?cJass_AdicHelper_v01030400.zip">zip archive</a>, I'll reconfigure the updater now.
VD

posted at 29/08/09 12:07
ADOLF

print demo:
<div class="code">
<b>include</b> "cj_print.j"
void Trig_esc_Actions () {
&nbsp;&nbsp;&nbsp;&nbsp;<b>printf</b> ("^pc was defeated by evil ^pc - he lost ^igold gold."&nbsp;,\
&nbsp;&nbsp;&nbsp;&nbsp;Player(0), Player(1), GetRandomInt(0,1))
}
</div>
<a href="http://img86.imageshack.us/img86/3549/demoa.jpg">screenshot</a>

posted at 27/08/09 21:24
Dark Dragon

k will do, thanks :)

posted at 27/08/09 21:15
Dark Dragon

not sure did i do smth wrong again but this does not compile... says missing enddefine...
define {
private <GetEnumEntity()> = entity.EntityId[HtoI(GetEnumUnit())]
}
It's a bug! Seems like it doesn't understand private defines, which start with &lt;. But if you omit "private", it works. I'll report that to Adolf tomorrow.
VD
Fixed
ADOLF

posted at 27/08/09 21:06
Dark Dragon

i see np! i knew that its something easy to fix, i again installed 09 and this time it said that 14 is new one... kk it works :)
about paint_text() its like you said i just went to try it but still bugs... it will be good if it gets fixed in new version :]
thanks for your work again guys all bugs from v12 where fixed and it now compiles without problems "exept for paint_text"
Greets!
~DD

posted at 27/08/09 18:30
Strilanc

Feature Request/query.
Is there a way to insert a unique'value into macros?
I've always hated having to declare functions in one place and hook them to an event in another. I wanted to write a macro to do something like this:
handlerForUnitEvent(EVENT_PLAYER_UNIT_UPGRADE_START)
...
endhandler
which would translate into something like:
library Lib_??UNIQUE_NAME?? initializer init
private function run takes nothing returns nothing
...
endfunction
private function init takes nothing returns nothing
trigger t = ...
add event ...
add action ...
endfunction
endlibrary
Maybe anonymous functions will be the way of doing it? Like:
<div class="code">
trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEvent(t, Player(0), EVENT_PLAYER_UNIT_SELL, \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lambda(){ return true } )
call TriggerAddAction(t, lambda(){ RemoveUnit(GetTriggerUnit()) })
</div>
They are not yet implemented, anyway, but I hope they will be.
We'll also think about some macro to get unique names for usage inside of defines.
VD

posted at 26/08/09 22:02
Strilanc

Another macro question.
How do I place an argument inside a keyword?
define mac(type) = {
module object_??type??
...
}
You can use concatenation operator anywhere, like:
<div class="code">
<b>define</b> mac(type) = {
&nbsp;&nbsp;module object_ ## type
&nbsp;&nbsp;...
}
</div>
It simply merges anything on the left of it with any other thing on the right.

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]