HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help me create a list of useless bj globals

03-31-2004, 03:58 AM#1
Narwanza
I know there are a lot of bj globals that are set to something before they are used by GUI triggers, and some like bj_LastCreatedUnit() which shouldn't be messed with. But there are a lot that are just dumb and could be used as a go-between for functions. So, help me create a huge list. Please state what type the variable is for.
03-31-2004, 05:21 AM#2
PitzerMike
All the 'Enum'-Variables can be used quite well (not permanent but for handing over values). These are used in functions such as ForAll blah blah to hand over values.

Also I know there are some variables only needed in map initalization that can be used afterwards, can't remember what it was though...
03-31-2004, 09:13 PM#3
Narwanza
I just found two that take care of one primitive type and one handle completly.
Code:
unit array bj_ghoul
integer array bj_meleeTwinkedHeroes
Both of these arrays only have their first 15 indexes tied up, the rest is all free game. So you can have as many integer and unit globals as you want with these because they are only used in BJ functions that deal with the player numbers.
03-31-2004, 11:23 PM#4
Grater
Hmmm global arrays, interesting.
05-06-2004, 09:21 AM#5
PitzerMike
I compiled a small list of usable blizzard.j globals:

Code:
Free variables:

force array bj_FORCE_PLAYER		only used from 0 to 16
integer array bj_meleeTwinkedHeroes	only used from 0 to 16
boolean array bj_slotControlUsed	only used from 0 to 16
boolean array bj_playerIsCrippled	only used from 0 to 16
boolean array bj_playerIsExposed	only used from 0 to 16
unit array bj_ghoul		only used from 0 to 16
boolean array bj_meleeDefeated	only used from 0 to 16
boolean array bj_meleeVictoried	only used from 0 to 16
timer bj_gameStartedTimer		only used at map initialization
real bj_meleeNearestMineDist	only used at map initialization

Hand-over variables (can't use permanent but for handing over data):

integer bj_groupCountUnits
integer bj_forceCountPlayers
integer bj_groupEnumTypeId
string bj_changeLevelMapName (always reset to null after use)
item bj_itemRandomCurrentPick
player bj_forceRandomCurrentPick
destructable bj_destRandomCurrentPick
unit bj_groupRandomCurrentPick
integer bj_itemRandomConsidered
integer bj_forceRandomConsidered
integer bj_destRandomConsidered
integer bj_groupRandomConsidered
real bj_randomSubGroupChance

Unused:

widget bj_lastDyingWidget (can be used for units, items, desctructables)


Where it says 'only used from 0 to 16' this is sometimes only 0 to 15 but for some arrays they use 1 item more, so to be on the safe side you should better start with index 17 or 18.

Also never use fade filter related variables. They will cause desyncs when you show a fade filters in a multiplayer map.
05-06-2004, 02:04 PM#6
Narwanza
Thanks PitzerMike, this will help me when I need to pass stuff between functions. Local handle variables are fine, but can get very messy.
05-06-2004, 02:19 PM#7
PitzerMike
These variables + type casting (using the return bug) should be enough for moste purposes.

Also because most of the stuff you can save in game cache. Global bj-variables should only be required when you need quick access (for example in 0.01 wait loops).