The basics of Script

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

  1. The_Pastmaster

    The_Pastmaster It Wandered In From the Wastes

    113
    Feb 26, 2004
    Is ther anyone who know were you can find and learn the basics of
    Fallout 2 Scripting for newbs the learn insted of asking the same
    annoying question over and over...

    "How do I script that"
    "How do I do this"
    "What dose that do"
    "How do I make that"

    Gez I get a headache just thinking about it...
     
  2. Shadowbird

    Shadowbird Where'd That 6th Toe Come From?

    442
    Jul 20, 2003
    Well, there are some tutorials around, but the best way to learn is, IMO, first-hand. Take decompiled working scripts as examples and off you go! :) Also, Fallout scripts are basically C programming language, so it helps a lot if you know that....
     
  3. The_Pastmaster

    The_Pastmaster It Wandered In From the Wastes

    113
    Feb 26, 2004
    I know that but I don´t get it and my skull is to thick for me to teach my self.
     
  4. dude_obj

    dude_obj Vault Senior Citizen
    Moderator

    Oct 19, 2004
    The FO2 script source that comes with the mapper is a much better reference than decompiled scripts for learning how they work. You see all the names that are in the headers, not just numbers.

    First step is being able to compile the existing scripts that came with the mapper (without changing them). You need to have watcom installed and edit the p.bat file in the \mapper2\scripts directory.

    Then when compiling works, do a very simple script, like the one I posted at DAC yesterday, the actual code is 3 lines.

    You need to study the mapper docs (script commands) and look at FO2 script source to learn how they work. Its not like a regular programming language. We are using existing procedures that are already set up for different things like:

    talk_p_proc - when player tries to talk to this critter
    use_p_proc - when player does the "use" function on this critter
    combat_p_proc - actions during combat

    The rest are documented in the mapper docs, and you can see example of their use in the FO2 script source.
     
  5. The_Pastmaster

    The_Pastmaster It Wandered In From the Wastes

    113
    Feb 26, 2004
    Thanks and I´ll try...
    *sight*
     
  6. dude_obj

    dude_obj Vault Senior Citizen
    Moderator

    Oct 19, 2004
    Read these two descriptions on setting up for script compiling:

    http://www.coljack.pwp.blueyonder.co.uk/fallout/compsetup.html
    http://modguide.nma-fallout.com/#Scripting002

    Get watcom 11 from here:
    http://openwatcom.mirrors.pair.com/watcom/11.0c/watcom-c-11.0c.exe

    And get to the point where you can compile existing scripts. Look in one of the script directories in the mapper, like \mapper2\scripts\arroyo and you'll see a batch file there arroyo.bat

    If you look at that batch file what it does is

    call ..\p ACBRAHMN
    call ..\p ACDOG
    call ..\p ACERIC
    call ..\p ACFIST
    call ..\p ACGECKO
    etc

    So once your p.bat (in \mapper\scripts) is properly set up, you can compile any script using this call ..\p SCRIPT in a batch file.

    When you have successfully compiled existing scripts, then try to compile that simple floating text example.
     
  7. The_Pastmaster

    The_Pastmaster It Wandered In From the Wastes

    113
    Feb 26, 2004
    Okay, now I gotta go...
    Auf Winerschitsell
     
  8. pillbrain

    pillbrain First time out of the vault

    8
    Feb 24, 2004
    Just to query, the fallout scripting language looks a lot like pascal to me, so is it actually based off c or is it pascal? ( Ive never really used either much, but had to do a small amount of pascal for a course, syntax is just about identical, so I guess it could be some form of hybrid but maybe c is similar to pascal? )

    Anyway, yeah id also go with just messing around with preexisting scripts after going through the tutorials on getting compilers set up and everything.
     
  9. red

    red Still Mildly Glowing

    271
    Apr 5, 2003
    It was programmed in C (which is mostly irrelevant, but anyway...)

    It looks a lot like pascal, with some C/C++ additions and using a preparser to use macros, something which is not at all common with pascal programs (though doable).
     
  10. pillbrain

    pillbrain First time out of the vault

    8
    Feb 24, 2004
    yeah, I figured they might have a calgorithm for decoding the pascal into predefined methods ( well thats fairly obvious i guess, but what the hell )