Fallout 1/2 windowed mode possible?

Discussion in 'Fallout General Modding' started by Skynet, Feb 15, 2005.

  1. dude_obj

    dude_obj Vault Senior Citizen
    Moderator

    Oct 19, 2004
    Hey qwerty ... I was doing some experiments with interface graphics changes last week. Here's an FRM that changes the AC and HP numbers to a blue LCD style look (which would actually be more like a vacuum flourescent display).

    http://home.cogeco.ca/~desolation/numbers.frm

    Try dropping that into \art\intrface. It looks better when the iface.frm has a black background behind it. I have a modified iface.frm that does this along with other changes but its not done yet.

    I also tried using these nixie tube style number, which would be more appropriate for fallout, but they didn't look very good:
    http://www.cim.mcgill.ca/~danny/jsfonts//nixie/6.png

    The blue LCD look is actually this one with a color and size change:
    http://www.cim.mcgill.ca/~danny/jsfonts//7led_red/6.png

    Those are from this clock program:
    http://www.cim.mcgill.ca/~danny/jsclock.php

    I looked all over for better nixie tube style fonts but didn't find any :(
     
  2. dude_obj

    dude_obj Vault Senior Citizen
    Moderator

    Oct 19, 2004
    I think there might be some space. Rumor has it that the exe used to have mapper functions but they were taken out before shipping. Take a look at hex offsets from B1E0-BBDF in the exe. It starts with a bunch of FF and then a huge section of 00. Maybe this is where the mapper functions used to be. There is a large contiguous space of all zeros between B204-B95F, maybe you can use that. Hopefully its not a space where stuff gets initialized after loaded into RAM, I have no idea how this could be checked.
     
  3. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    Great job you did jdoe :D

    I remember that when i was working on 12 years limit problem I found a "small" gap at the end of CODE segment.
    This gap was on 12CF88 - 52DB88 (dynamic) but I worked on mapper.exe not Fallout2.exe so you need to confirm this.

    BTW Have you used Abel Names script?
     
  4. Jagasian

    Jagasian First time out of the vault

    24
    Feb 26, 2005
    Why not insert a small jump in place of the error checking code, which jumps to a new region in memory created by extending the size of the executable? This new region of memory could include the error checking code that was replaced by the jump, as well as the resolution switching code.
     
  5. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    Hmm that would be great but do you know how to do this?
    Add new code segment or something?
     
  6. Jagasian

    Jagasian First time out of the vault

    24
    Feb 26, 2005
    It has been a long time since I have done any PC assembler programming, but you should just be able to extend the existing code segment. Various console game translations from Japanese to English work this way: replace instruction X with an unconditional branch/jump to the first free address A after the last instruction of the program. Then at A you have the first instruction as the one previously removed, i.e. X. The rest of the instructions are new code for whatever you are trying to do with the last instruction an unconditional branch/jump to the instruction just after the first unconditional jump.

    Between this high-resolution hack and Seraph's patch, all of the new locations, addons, and mods, Fallout 2 is just screaming for a unified addon packaged into a user-friendly single-click auto-installer. Who would want Fallout 3 when you have a perfected Fallout 2?
     
  7. jdoe407

    jdoe407 First time out of the vault

    30
    Feb 18, 2005
    I'll probably continue working on this stuff this weekend (friday). I don't have much time during the weekdays to do much. I'll worry about cleaning up the executable after I kinda figure out what I'm doing ; ). thanks for the support
     
  8. Raven_2

    Raven_2 First time out of the vault

    39
    Mar 2, 2005
    Sorry for bad English.

    About windowed mod and flags. I almost newbie in asm and disassembling (I join to TeamX as a scripter, now try to dig engine), I know nothing about DDraw programming also. But But maybe you find something usefull in this post[all for Mapper.exe, not for FO itself].

    0x3b788 [01h by default] - this byte set resolution to set before window/ddraw surface created.

    Table:
    Code:
    DGROUP:005624C8 _gfx_init       dd offset init_mode_320_200 ;[0]
    DGROUP:005624CC                 dd offset init_mode_640_480 ;[1]
    DGROUP:005624D0                 dd offset init_mode_640_240 ;[2]
    DGROUP:005624D4                 dd offset init_mode_320_400 ;[3]
    DGROUP:005624D8                 dd offset init_mode_640_200 ;[4]
    DGROUP:005624DC                 dd offset init_mode_640_400 ;[5]
    DGROUP:005624E0                 dd offset init_mode_800_300 ;[6]
    DGROUP:005624E4                 dd offset init_mode_800_600 ;[7]
    DGROUP:005624E8                 dd offset init_mode_1024_384 ;[8]
    DGROUP:005624EC                 dd offset init_mode_1024_768 ;[9]
    DGROUP:005624F0                 dd offset init_mode_1280_512 ;[10]
    DGROUP:005624F4                 dd offset init_mode_1280_1024 ;[12]
    
    All none-standart modes drop an error. I set 800x600 [set byte to 07] and 1024x768 [09], but:
    1. in 1024 mapper set resolution, create window, paint in something and then generate an error
    2. in 800x600 mapper look weird, pallete is not being loaded I supose. On exit there is an error window

    0xeb9ba - [11h by def] I belive it`s a flag for SetCooperative level. But set it to 08h does nothing [well, nothing more then weird colors].

    Disasm listing for this piece:
    Code:
    mov     eax, ds:GNW95_DDObject
    mov     eax, [eax]
    push    11h
    push    ds:GNW95_hwnd
    push    ds:GNW95_DDObject
    call    dword ptr [eax+50h]
    
    0xeb820 - [00 00 08 90 == 90080000h] dwStyle flag for mapper window
    0xeb83b 0 [08] - dwExStyle for mapper window

    You can set it to popup window style and set nWidth and nHeight to fixed values [by default there is GetSistemMetrics(0/1) for this] - smaller window would be created, but ddraw surface steel be use fullscreen, so any mouse move would repaint original fullscreen mapper window :-(

    Disasm:
    Code:
    AUTO:004EC405                 push    0               ; lpParam
    AUTO:004EC407                 push    ds:GNW95_hInstance ; hInstance
    AUTO:004EC40D                 push    0               ; hMenu
    AUTO:004EC40F                 push    0               ; hWndParent
    AUTO:004EC411                 push    1               ; nIndex
    AUTO:004EC413                 call    cs:GetSystemMetrics
    AUTO:004EC41A                 push    eax             ; nHeight
    AUTO:004EC41B                 push    0               ; nIndex
    AUTO:004EC41D                 call    cs:GetSystemMetrics
    AUTO:004EC424                 push    eax             ; nWidth
    AUTO:004EC425                 push    0               ; Y
    AUTO:004EC427                 push    0               ; X
    AUTO:004EC429                 push    90080000h       ; dwStyle
    AUTO:004EC42E                 mov     eax, offset GNW95_title
    AUTO:004EC433                 push    eax             ; lpWindowName
    AUTO:004EC434                 mov     eax, offset ClassName ; "GNW95 Class"
    AUTO:004EC439                 push    eax             ; lpClassName
    AUTO:004EC43A                 push    8               ; dwExStyle
    AUTO:004EC43C                 call    cs:CreateWindowExA
    
    Seems that surface sizes are equal to screen resolution, they use one table for set resolution/surface sizes:
    Code:
    DGROUP:00562528 _sizes          dd 320
    DGROUP:0056252C dword_56252C    dd 200
    DGROUP:00562530                 dd 640
    DGROUP:00562534                 dd 480
    DGROUP:00562538                 dd 640
    DGROUP:0056253C                 dd 240
    DGROUP:00562540                 dd 320
    DGROUP:00562544                 dd 400
    DGROUP:00562548                 dd 640
    DGROUP:0056254C                 dd 200
    DGROUP:00562550                 dd 640
    DGROUP:00562554                 dd 400
    DGROUP:00562558                 dd 800
    DGROUP:0056255C                 dd 300
    DGROUP:00562560                 dd 800
    DGROUP:00562564                 dd 600
    DGROUP:00562568                 dd 1024
    DGROUP:0056256C                 dd 384
    DGROUP:00562570                 dd 1024
    DGROUP:00562574                 dd 768
    DGROUP:00562578                 dd 1280
    DGROUP:0056257C                 dd 512
    DGROUP:00562580                 dd 1280
    DGROUP:00562584                 dd 1024
    
    Maybe some of you find this useful...

    BTW, where I can find info about addkey, playmovie, soundplay, say* functions? About interface mode (CreateWin and stuff)?

    [EDIT]

    BTW2. What did you know about flags in mapper2.cfg [Debug]->mode ? There is "environment" by default, but you can set "log", "gnw", "mono" and "screen". Why mono and screen mode need for?
     
  9. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    Well best source is TeamX :) http://www.teamx.ru/docs/bis_help.zip
     
  10. Raven_2

    Raven_2 First time out of the vault

    39
    Mar 2, 2005
    >>Well best source is TeamX http://www.teamx.ru/docs/bis_help.zip

    LOL 8-) I am from TeamX. I am one of the moderators of Tech Support and Research forums :-) And research of playsound, movieplay and say*-functions in bis_help.zip are mostly my work. I hope to find some *other* info here, at NMA.
     
  11. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    I know that Raven ;), good job witch that btw.
    Well i read that doc and it covers all that prety good, there is not much to add.
    For what function you need info?

    BTW The very very best source of script information is.... Abel :o
     
  12. Raven_2

    Raven_2 First time out of the vault

    39
    Mar 2, 2005
    For functions than was not covered by this doc :-) List:

    Say-mode funcs:
    sayScrollUp [6]
    sayScrollDown [6]
    sayGetLastPos
    saystartpos
    sayrestart


    Movie funcs:
    playmoviealpha - fake (there is no code for it in .exe)
    playmoviealpharect - fake
    playmovierect, playmovie - they work, but the pallete get screwed and game crashes after movie end

    Mouse funcs:
    setglobalmousefunc(p1,p2,p3,p4)
    refreshmouse(p1)
    mousepress
    mouserelease
    mouseon
    mouseoff
    mouseheld
    mouseright

    There is more.

    BTW, mouseshape("file.pcx",int x,int y) load file.pcs as a mouse cursor. Only in say-mode, of course. AddKey warks only in say mode also.

    And now we dig this say-mode. Well ... how it english? ... thats rock. Currently WG and I wrote the script that allow you to construct your own item from components. Like in Arcanum :-) Not in dilog mode, with pictures of items and stuff.

    >>BTW The very very best source of script information is.... Abel

    :-( I can rare see Abel this days. He now work on three jobs :-( And he is .. an aspirant. Don`t know how it in english.
     
  13. izuken

    izuken First time out of the vault

    2
    Jan 6, 2005
    "aspirant" is a mistranslation for "post graduate student"
    :wink:
     
  14. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    Uhm looks just like mine todo list.
    Have the same problem with playmovie :/.

    I didn't (yet) do much work on this say mode functions, but this can be interesting.

    Yup ,Scripts can create custom windows with gfx,buttons.
    Recently for NA mod I made full working elevator ;).


    Yes i think about using this for drag and drop items in custom iterfaces(say...).
     
  15. dude_obj

    dude_obj Vault Senior Citizen
    Moderator

    Oct 19, 2004
    Wow that's cool. Can you share any screen shots?


    I didn't know scripts could do this. Could you post some example script code that shows how this works?
     
  16. WraithUV

    WraithUV It Wandered In From the Wastes

    139
    Feb 22, 2005
    Indeed. If I'm not misreading what you mean, I'd be rather interested in how that works.

    Specifically, things such as a script popping up a dialogue box with a cusom message and a couple buttons -like the one you get when you click the exit button- which would then pass the result as a boolean or int back to the script depending on which button was pushed.

    That'd be handy...

    -Wraith
     
  17. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    No problem ;)

    Ok this is a simple procedure that creates custom window (for elevator this case)
    with background, 4 animated buttons, and one animated image (for displaying elevator arrow)
    Code:
    // 'createwin' procedure will create a new window
    // createwin("name",posx,posy,widht,height)
    
    createwin("win1",150,50,230,284);
    
    //Now we will add four buttons to this window
    //addbutton("nameofbutton",posx,posy,widht,height)
    // 0,0 point for posx and posy paremeters is left upper corner of a new window.
    AddButton("button1",17,44,44,43);
    AddButton("button2",17,104,44,43);
    AddButton("button3",17,164,44,43);
    AddButton("button4",17,224,44,43);
    
    //adding procedures to buttons
    //addbuttonproc("nameofbutton",mouse_on_procedure,mouse_out_procedure,buttonpres_procedure,buttonrelase_procedure);)
    AddButtonProc("button1",buton,butoff,butpres,butoff);
    AddButtonProc("button2",buton,butoff,butpres2,butoff);
    AddButtonProc("button3",buton,butoff,butpres3,butoff);
    AddButtonProc("button4",buton,butoff,butpres4,butoff);
    
    //adding graphics to buttons
    //addbuttongfx("buttonname","buttonpres_file.pcx","buttonrelise_file.pcx","mouse_over_file.pcx")
    //graph files must be in pcx format and in fallout2 standart color palette
    addbuttongfx("button1","ebut_in.pcx","ebut_out.pcx"," ");
    addbuttongfx("button2","ebut_in.pcx","ebut_out.pcx"," ");
    addbuttongfx("button3","ebut_in.pcx","ebut_out.pcx"," ");
    addbuttongfx("button4","ebut_in.pcx","ebut_out.pcx"," ");
    
    //create window bakground graphics
    //display("graph_filename.pcx")
    //file must be in pcx format and have fallout2 standart palette
    display("el_base1.pcx");
    
    //this command draws sprite on given coordinates in window
    //displaygfx("filename.pcx",posx,posy,hight,weight)
    //it draws elevator level arrow
    displaygfx("1.pcx",120,40,92,55);
    
    //This command will redraw curent window
    ShowWin;
    
    ah i forgot to add that we must use pcx format and is best to put all gfx files in main data (fallout2/data/)
     
    • [Like] [Like] x 1
  18. WraithUV

    WraithUV It Wandered In From the Wastes

    139
    Feb 22, 2005
    :shock:

    Um... Ok, n00b question #1042 here but...

    I just searched everything I have on script commands, including all the FO2 headers I could think of that would potentially hold defines for these, and they don't appear anywhere...

    So, assuming they do in fact work in scripts, er... Are these simply undocumented commands? If so, is there somwhere you could point me to lists of such things since I would presume if this is the case, there must be some more of them as well.

    Grrr... I hate it when they keep secrets! lol

    -Wraith
     
  19. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    Well yes i think you can call them undocumented.
    This are all built in functions not macros from header files and they were never used in any Fo2 Scripts (why use them when you can do all this in source code).

    Here is list of this functions from FSE function list(there are some more):


    Code:
    callstart
    exec
    spawn
    fork
    detach
    startcritical
    endcritical
    sayquit
    sayend
    saystart
    saystartpos
    sayreplytitle
    saygotoreply
    sayreply(p1:number,p2:number);
    sayoption(p1:number,p2:number);
    saymessage(p1:number,p2:number);
    sayreplywindow
    sayoptionwindow
    sayborder
    sayscrollup
    sayscrolldown
    sayspacing
    sayoptioncolor
    sayreplycolor
    sayrestart
    saygetlastpos
    sayreplyflags
    sayoptionflags
    saymessagetimeout(time:number);
    createwin(name:string,X:number,Y:number,Width:number,heigth:number);
    deletewin(name:string);
    selectwin(name:string);
    resizewin(name:string,X:number,Y:number,Width:number,heigth:number);
    scalewin(name:string,X:number,Y:number,Width:number,heigth:number);
    showwin;
    fillwin
    fillrect
    fillwin3x3
    display(filename:string);
    displaygfx(filename:string,X:number,Y:number,Width:number,heigth:number););
    displayraw(filename:string);
    loadpalettetable(palette_file:string);
    fadein
    fadeout
    gotoxy
    print
    format
    printrect
    setfont
    settextflags
    settextcolor
    sethighlightcolor
    stopmovie
    playmovie
    movieflags
    playmovierect
    playmoviealpharect
    addregionflag
    addregionproc
    addregionrightproc
    deleteregion
    activateregion
    checkregion
    addbutton(button_name:string,posx:number,posy:number,widht:number,height:number);
    addbuttontext(button_name:string,text:string);
    addbuttonflag
    addbuttongfx
    addbuttonproc
    addbuttonrightproc <-- (this function is disabled)
    deletebutton(button_name:string);
    hidemouse
    showmouse
    mouseshape
    refreshmouse
    setglobalmousefunc
    addnamedevent
    addnamedhandler
    clearnamed
    signalnamed
    addkey
    deletekey
    soundplay
    soundpause
    soundresume
    soundstop
    soundrewind
    sounddelete
    setoneoptpause
    selectfilelist
    
    For full list of opcodes see http://www.teamx.ru/fop/index.php
     
  20. red

    red Still Mildly Glowing

    271
    Apr 5, 2003
    Here's a list of the BIS compiler supported script commands. This is simply taken from compile.exe. I did that list quite a while ago when I stumbled upon them. I nerver looked into them further then this, hope it can be useful.