Hello World script.

Discussion in 'Fallout General Modding' started by Mulligun, Mar 24, 2020 at 8:41 PM.

  1. Mulligun

    Mulligun First time out of the vault

    64
    Dec 14, 2006
    Hello.
    I'd like to write a super simple hello world script like this:
    Code:
    procedure start;
    
    procedure start begin
       display_msg("Hello world!");
    end
    I've compiled it & saved as hello_world.int in
    Code:
    Fallout2\data\scripts
    but when i run the game nothing happens. What should i do to make the game engine run my script when i load/start new game?
     
  2. Zorchar

    Zorchar First time out of the vault

    64
    Jun 18, 2018
    The easiest way for me would be to edit the "start" procedure in the map script for the first map in the game.
    you should also add the conditions
    Code:
     if (is_loading_game == false) and (game_loaded == 1) then begin
    BTW, adding a script to the script directory does absolutely nothing as far as the game is concerned. After doing so, you'll need to add the scriptname.int line to the appropriate line in the script.lst file, so if your new script was defined in the script.h header file as - (1383) - , you'll have to add the line scriptname.int in line 1383 of the script.lst file. Once you've done that, you will have to actually appropriate the script to a certain critter, item, scenery, map, or whatever.
    You want the hello world massage to be displayed independent of any critter or whatever, so I think the solution I suggested will work just fine here.

    Edit: also, I'm pretty sure your script name is illegal. Never use more than 8 characters for scripts or maps names, and also the underscore I think is a big no no.
     
    Last edited: Mar 24, 2020 at 11:05 PM
  3. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    293
    Oct 29, 2015
    procedure start begin
    if (game_loaded) then display_msg("Hello world!");
    end

    gl_hello_world.int put to scripts folder
     
  4. Zorchar

    Zorchar First time out of the vault

    64
    Jun 18, 2018