HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Quick Questions about Jass

12-29-2007, 01:27 PM#1
Tide-Arc Ephemera
Do BJs leak?

Do calls leak?

That is all. Thanks for the future answer.
12-29-2007, 01:48 PM#2
zen87
some BJs are leaky, most are useless

and i don't quite understand what do you mean by leaking a calls..
12-29-2007, 01:52 PM#3
Tide-Arc Ephemera
Yeah, I ask if calls leak because I heard that they make a leak when you try to call a native with 2 calls as opposed to 1. I don't understand this 100%, but as far as I know, calls do not leak.
12-29-2007, 01:55 PM#4
zen87
well i understand that you use GUI, but I guess you really should switch to jass now, as you want to improve your triggers and code
12-29-2007, 01:58 PM#5
Tide-Arc Ephemera
I can't use vJass due to my OS, but I would like to know (Vexorian's tutorial is an entrance point but it doesn't seem to do what I need it to) a good way of manipulating object data as opposed to strings....
12-29-2007, 02:05 PM#6
zen87
im not asking you to use vjass... just normal jass, as normal editors will be able to support those for good
12-29-2007, 02:11 PM#7
Tide-Arc Ephemera
I'm very sorry if I made it seem like I was asking... but all I was requesting was a tutorial on object manipulation as well as how to work loops... that'd get me on my way for Jass.
12-29-2007, 02:57 PM#8
Castlemaster
If you are curious how BJ's work, go to http://www.wc3jass.com/index.php?scr...e8feb0f85c82d0
and look around in blizzard.j scripts (which is where the BJ's are). BJ's are just functions that reference other functions. Some where made to unify a couple of lines of code (like opening/closing gates) and others I don't know (some BJ's reference a function that does the exact same thing but the variables are in different order)

There are plenty of tutorials here if you want to learn JASS, that's how I llearned.
12-29-2007, 05:40 PM#9
Earth-Fury
Blizzard.j
Common.j
Common.ai

The 3 most used script files in the game. Common.j holds natives (functions defined in the game engine itself). Blizzard.j holds JASS-written functions, mostly used for the GUI. Common.ai holds ai related natives.

A leak is caused by something being created, loosing all references, and then never being destroyed. WC3's reference counter for handles is broken, thus even if the garbagecleaner did anything useful, it wouldn't clean most handles anyway. (Thus why we null locals, as the "set" statement properly decreases and increases reference counts) You must manually remove any handles you create. (with the exception of things like "player", where they will exist for the whole game and automagically stop existing when the game ends. Units also clean themselves from memory after decay.) Eg:
Collapse JASS:
function ABC takes nothing returns nothing
    local location l = Location(0,0)
    call RemoveLocation(l) // remove what you create
    set l = null // You must null local variables. globals will eventually have their values changed anyway, so they don't mater in that aspect.
endfunction

loops are easy...
Collapse JASS:
loop
    exitwhen a == b == c
endloop
the code between "loop" and "endloop" will loop over and over from top to bottom until an "exitwhen" statement within the loop evaluates as false. (the exitwhen statement takes a predicate on the right, ala the "if predicate then" statement.)
12-30-2007, 06:01 AM#10
Tide-Arc Ephemera
It's good and all that there are tutorials about strings but I REALLY want object data... Does anyone have any object editor tutorials?

On side note, this is mostly unrelated, but what happens if I set a unit/doodad's transparency in a GetLocalPlayer() loop? Will it make that object transparent or will it desync that player?
12-30-2007, 06:34 AM#11
Anopob
Quote:
Originally Posted by Earth-Fury
the code between "loop" and "endloop" will loop over and over from top to bottom until an "exitwhen" statement within the loop evaluates as false. (the exitwhen statement takes a predicate on the right, ala the "if predicate then" statement.)

Wait don't you mean as TRUE? Like "exitwhen a = b" so if it's false then a =/= b so therefore it repeats itself right?
12-30-2007, 06:56 AM#12
zen87
Quote:
Originally Posted by Tide-Arc Ephemera
It's good and all that there are tutorials about strings but I REALLY want object data... Does anyone have any object editor tutorials?

On side note, this is mostly unrelated, but what happens if I set a unit/doodad's transparency in a GetLocalPlayer() loop? Will it make that object transparent or will it desync that player?
desync, i guess, try to avoid such a thing anyway...
12-30-2007, 06:58 AM#13
Tide-Arc Ephemera
Why would it desync, though? It's not affecting the physical gameplay, is it?
12-30-2007, 11:52 AM#14
blu_da_noob
Changing an object's transparency in a LocalPlayer block should not cause a desync.
12-30-2007, 12:09 PM#15
Tide-Arc Ephemera
Hm... kay...

This may seem like I'm jumping around the topic yet again but, are there any tutorials on object manipulation? I've not seen one yet.