HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Yet another completely bogus and stupid bug.

11-12-2006, 11:35 AM#1
xombie
I'm probably one of the best "bug" (discovered already or not they are new to me) finders in the world. Every single thing I do I uncover an exception.. howcome I can't just EDIT like a normal person... I have everything set in motion against me... anyways... to my point:

I'm making this ability and I use my own method of loops to get a random unit from a unit group. This little snippet resembles my code:
Collapse JASS:
call BJDebugMsg( <message 1> )
if ( count > 0 ) then
    call BJDebugMsg( <message 2> )
    ...
endif
call BJDebugMsg( <message 3> )
Logically, and in my situation, the variable 'count' will not be greater than 0, so it should skip the IF. My problem is, the only message that shows up in this situation is <message 1>. Please somebody explain to me the sense behind this...

:: Edit ::

I don't know why I am always the one to answer my own idiotic questions... the reason is because I thought when you declared an integer variable it set it by default to 0. I was obviously wrong. This solved every problem.
================================================================
Anyways, while people are reading this.
Does anybody know how to make a unit visible in fog, even though not selectable. An example would be in ToB where you can fully see only the unit's model, but it is unselectable and all that jazz.
11-12-2006, 01:13 PM#2
shadow1500
local integer count
if you operate on the variable "count" before setting it to a value, your thread will crash.
Here's how to fix it:
local integer count = 0
11-12-2006, 01:19 PM#3
johnfn
To make a unit unselectable, you have to give it the 'aloc' ability, or Locust.
11-12-2006, 01:27 PM#4
xombie
john, thats not what I mean. I'm talking about enemy units being visible in fog but not selectable in fog... I couldn't have been more clear either.
11-12-2006, 01:29 PM#5
shadow1500
Set the "Stats - Building" to true for it to appear through fog. You can also try the "Use extended line of sight" field if you are using units.