Skip to content
SnoeGit edited this page Jul 2, 2024 · 3 revisions

Note: These tutorials are made only for the Ultimate Edition mod and only explain how to add a stuff! These tutorials don't explain programming on the Blitz3D.

Description of the functions, variables, and codes you can find here: http://chipmunkplayer.free.fr/help/command_list_2d_cat_2.htm

Download the Blitz3D TSS

  1. First, download the Blitz3D TSS itself.

    Download link: https://github.com/ZiYueCommentary/Blitz3D/releases/tag/v1.132

  2. Run the installer, or extract the zip file in any folder.

  3. When the Blitz3D TSS was installed, go to the folder where you installed it.

  4. After, copy all .decls from the game directory to userlibs folder in your Blitz3D TSS folder.

Compile the source code

  1. Run the Blitz3D TSS.exe.

  2. Find the Program tab:

    image

    1. Run program - Compiles the code and runs the program.
    2. Run program again - Compiles the code and runs the latest program.
    3. Check for errors - Check the code for errors.
    4. Create Executable - Creates an exe file for running the program.
    5. Program Command Line - Specify a program-readable startup parameter.
    6. Debug Enabled? - Turns on the debug panel. The debug panel is used to find any errors while the program is running.
    7. Not Address Large Aware? - Allows the program to use 4GB instead of 2GB RAM. This should be useful for 64-bit OS. Note that this config does not work fine, please instead with 4GB Patch.
  3. Download the Ultimate Edition mod assets in Github. UET_DEV is the latest dev branch.

  4. Unzip to any folder.

  5. Open the Game.bb file. This file is the main file for compiling the game. You should compile only this file!

    The Blitz3D TSS opens .bb files only, and .bb file is a file containing a source code.

  6. Try to compile and run the program.

Use the debug mode

  1. Find the "Program" tab. Check if the "Debug Enabled?" is turned on.

  2. Compile and run the program. You should see the debug window.

    image

  3. If you get an error, the debug window will show you a line where this error is located. It should be like this:

    image

Add a new room

Note: This lesson doesn't explain how to use the mapping applications!

  1. Download the mapping applications.

    1. 3D World Studio - can be used only on Windows 7 and lower.
    2. CBRE-EX - program designed specifically for SCP - Containment Breach.
  2. Create the room and export it as .rmesh file into the GFX\map\ folder. The lightmap files will be created automatically.

  3. Go to Data folder, find and open the rooms.ini file.

  4. Let's look at the following example:

    [cont2_409]
    Descr = SCP-409's containment chamber.
    Mesh Path = cont2_409.rmesh
    Shape = 2
    Commonness = 0
    DisableDecals = 1
    Large = 1
    Zone1 = 2
    1. cont2_409 - the room name.

    2. Descr - description of the room. Used in Map Creator.

    3. Mesh Path - path to the room file. Use the file name only.

    4. Shape - the room has 5 different shapes:

      1. 1 - the room has one door leading to the room.
      2. 2 - the room has two doors leading to the room.
      3. 2C - the room has two doors leading to the room, but looks like a corner.
      4. 3 - the room has three doors leading to the room.
      5. 4 - the room has four doors leading to the room.
    5. Commonness - room spawns chance. 0 is a minimum value, and it is used for spawning the room only one time. 100 is a maximum value.

    6. DisabledDecals - disable the random decals inside the room.

    7. Large - marks the room as a large room. Used for map generation algorithm.

    8. Zone1 - a zone where the rooms can be spawned. The game has three zones:

      1. 1 - the room will be spawned inside the Light Containment Zone.
      2. 2 - the room will be spawned inside the Heavy containment Zone.
      3. 3 - the room will be spawned inside the Entrance Zone.

      The rooms spawned outside the map don't have "Zone1" parameter. Also you can use "Zone2" parameter. This parameter allows the room to spawn inside two zones at the same time.

    9. DisableOverlapCheck - turns off the overlap checking. Used for map generation algorithm.


    [room ambience]
    Ambience0 = SFX\Ambient\Room ambience\rumble.ogg
    Ambience1 = SFX\Ambient\Room ambience\lowdrone.ogg
    Ambience2 = SFX\Ambient\Room ambience\pulsing.ogg
    Ambience3 = SFX\Ambient\Room ambience\ventilation.ogg
    Ambience4 = SFX\Ambient\Room ambience\drip.ogg
    Ambience5 = SFX\Alarm\Alarm1.ogg
    Ambience6 = SFX\Ambient\Room ambience\895.ogg
    Ambience7 = SFX\Ambient\Room ambience\fuelpump.ogg
    Ambience8 = SFX\Ambient\Room ambience\Fan.ogg
    Ambience9 = SFX\Ambient\Room ambience\servers1.ogg

    [room ambience] parameter is used for adding an ambience sound for the room.

  5. For spawning assets inside the room, go to the Source Code folder and find the Rooms_Core.bb file. This file contains all the necessary functions and variables for the map.

  6. Find the FillRoom() function. This function spawns assets inside the room. Example for adding assets:

    Case r_cont2_860_1
    	;[Block]
    	; ~ Doors to observation room
    	d.Doors = CreateDoor(r, r\x + 928.0 * RoomScale, r\y, r\z + 640.0 * RoomScale, 0.0, False, DEFAULT_DOOR, KEY_MISC, Str(Rand(1000, 9999)))
    
    	d.Doors = CreateDoor(r, r\x + 928.0 * RoomScale, r\y, r\z - 640.0 * RoomScale, 0.0, True, DEFAULT_DOOR, KEY_MISC, Str(Rand(1000, 9999)))
    	d\MTFClose = False
    
    	; ~ Doors to SCP-860-1's door itself
    	d.Doors = CreateDoor(r, r\x + 416.0 * RoomScale, r\y, r\z - 640.0 * RoomScale, 0.0, False, DEFAULT_DOOR, KEY_CARD_3)
    
    	d.Doors = CreateDoor(r, r\x + 416.0 * RoomScale, r\y, r\z + 640.0 * RoomScale, 0.0, False, DEFAULT_DOOR, KEY_CARD_3)
    
    	; ~ SCP-860-1's door
    	d.Doors = CreateDoor(r, r\x + 184.0 * RoomScale, r\y, r\z, 0.0, False, WOODEN_DOOR, KEY_860)
    	d\Locked = 1 : d\DisableWaypoint = True
    	r\RoomDoors.Doors[0] = d
    
    	; ~ The forest
    	If (Not I_Zone\HasCustomForest)
    		fr.Forest = New Forest
    		r\fr = fr
    		GenForestGrid(fr)
    		PlaceForest(fr, r\x, r\y + 30.0, r\z, r)
    	EndIf
    
    	it.Items = CreateItem("Document SCP-860-1", "paper", r\x + 1158.0 * RoomScale, r\y + 250.0 * RoomScale, r\z - 17.0 * RoomScale)
    	RotateEntity(it\Collider, 0.0, r\Angle, 0.0)
    	EntityParent(it\Collider, r\OBJ)
    
    	CreateCustomCenter(r, r\x + 927.0 * RoomScale, r\z)
    	;[End Block]
  7. If the room has Commonness = 0, then you should find the CreateMap() function. Find these lines and make something similar respecting the shape of the room and position. Don't use the same positions.

    ; ~ [LIGHT CONTAINMENT ZONE]
    
    Local MinPos% = 1, MaxPos% = Room1Amount[0] - 1
    
    MapRoom(ROOM1, 0) = "cont1_173"
    
    SetRoom("cont1_372", ROOM1, Floor(0.1 * Float(Room1Amount[0])), MinPos, MaxPos)
    SetRoom("cont1_005", ROOM1, Floor(0.3 * Float(Room1Amount[0])), MinPos, MaxPos)
    SetRoom("cont1_914", ROOM1, Floor(0.35 * Float(Room1Amount[0])), MinPos, MaxPos)
    SetRoom("cont1_205", ROOM1, Floor(0.5 * Float(Room1Amount[0])), MinPos, MaxPos)
    SetRoom("room1_archive", ROOM1, Floor(0.6 * Float(Room1Amount[0])), MinPos, MaxPos)
    
    MapRoom(ROOM2C, 0) = "room2c_gw_lcz"
    
    MinPos = 1
    MaxPos = Room2Amount[0] - 1
    
    MapRoom(ROOM2, 0) = "room2_closets" 
    
    SetRoom("room2_test_lcz", ROOM2, Floor(0.1 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("cont2_427_714_860_1025", ROOM2, Floor(0.2 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("room2_storage", ROOM2, Floor(0.3 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("room2_gw_2", ROOM2, Floor(0.4 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("room2_sl", ROOM2, Floor(0.5 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("cont2_012", ROOM2, Floor(0.55 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("cont2_500_1499", ROOM2, Floor(0.6 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("cont2_1123", ROOM2, Floor(0.75 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("room2_js", ROOM2, Floor(0.85 * Float(Room2Amount[0])), MinPos, MaxPos)
    SetRoom("room2_elevator", ROOM2, Floor(0.9 * Float(Room2Amount[0])), MinPos, MaxPos)
    
    MapRoom(ROOM2C, Floor(0.5 * Float(Room2CAmount[0]))) = "cont2c_066_1162_arc"
    
    MapRoom(ROOM3, Floor(Rnd(0.2, 0.8) * Float(Room3Amount[0]))) = "room3_storage"
    
    MapRoom(ROOM4, Floor(0.3 * Float(Room4Amount[0]))) = "room4_ic"