User talk:Big Brother

There are no discussions on this page.

Dragoon Wraith TALK 04:25, 16 September 2006 (EDT): Good catch, that was actually known - if you check the article on float, this is mentioned. In fact, it has been found that all variables (other than Refs, obviously) are floats. Screwed me up pretty good since I really needed a long variable...

Big Brother 02:21, 17 September 2006 (EDT) Could you give me a link to the article you mentioned? I can't seem to find it and would like to read it.
Dragoon Wraith TALK 04:17, 17 September 2006 (EDT): Heh, not as well documented as it ought to be, it seems. I'll remedy that now, actually. Anyway, you can see this information in Variable types: longint, though most of the interesting bit is in the Talk page.
Big Brother 05:08, 17 September 2006 (EDT): Oh yes, I saw that the underlying representation is fp and that roundoff/precision errors can occur. But Bethsoft did some slight of code to make sure that short/long vars behave like integers. When a non-integer value ( like 1.5 ) is assigned to a short or long it gets rounded down or "truncated" to the nearest integer value ( as I'm sure you're well aware ). The issue I encountered is that globals don't seem to follow these rules. Try declaring a global short then making a script simlar to the following:
begin gamemode
    set globalShort to 1.5
    if( globalShort == 1 )
       Message "globalShort == 1"
    endif

    if( globalShort == 1.5 )
       Message "globalShort == 1.5"
    endif

    Message "globalShort == %.2f" globalShort
end

Attach it to a start game enabled quest and every five seconds you'll see

globalShort == 1.5
globalShort == 1.50

Thus, in the example bug that I posted in the globals section, when GetRandomPercent returns a value > 50, the "heads" block still won't run. This problem is peculiar to globals -- I tested other variables types and as long as the var is declared in a script, even if it is not the SAME script ( ie "quest globals" ), it will always get cast appropriately. I'm guessing its another example of OB's weak script compiler ( as static casts are the compiler's domain ). I haven't seen this phenominon documented anywhere else yet so I added it to the globals section.

Dragoon Wraith TALK 17:56, 17 September 2006 (EDT): Ah, I see what you mean. OK, I'll update the appropriate pages.

Big Brother 22:20, 17 September 2006 (EDT): Cool. I have another question: I'm currently working on a scripted variable damage spell ( ie. Another scripter uses globals to specify the desired damage amount and type and casts the scripted spell and the spell does the rest ) and am planning on releasing it as a modder's resource (in .esm format) when it's done. I was wondering if there is a page devoted to script related resources like this that I could put a link on.

Dragoon Wraith TALK 02:30, 18 September 2006 (EDT): Sounds to me like it could very easily go in Category:Useful Code. I think the math.esm file's linked to from one of the article's there, so your esm is just as fitting methinks. Usually we try to avoid 'advertisements' like that, but I agree that your mod is conceivably quite useful to a large number of people, and so ought to be here.
I'm going to put a poll on the Talk page there to see what people think
Return to the user page of "Big Brother".