• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

OpenBOR Tools im working on

Trying to improve fontmaker to make the fonts look more 3d and not just flat one color, i do this by pasting copy of the whole font image onto another copy that is a bit darker and shift it by 2 pixels to side and down/up, and this gui does this automatically now.
 

Attachments

  • font_20240531032026.png
    font_20240531032026.png
    38.3 KB · Views: 8
  • font_20240531035119.png
    font_20240531035119.png
    47.8 KB · Views: 8
  • font_20240531035602.png
    font_20240531035602.png
    47.6 KB · Views: 8
  • font_20240531040007.png
    font_20240531040007.png
    52 KB · Views: 8
Slowly getting there , then ill try to display actual lifebars and actual fonts but not sure , it will be possible to specify resolution, p2,p3,p4 will be handled automatically.
The thing is i dont want this to require assets like icons and fonts ... but ok as option... maybe
What i like abnout it is that i can scrollwheel the values and get what i want quickly, also resolution setting can be changed on the fly
OF course i will add save option to store all the values as json, and also export option to export it properly to openbor levels.txt

hud3.png
 
Last edited:
Beautiful work! A radio dial for the player index would be better, even if p2-4 will be automatically set (according to player setting adjustment?).
 
Generates this :
#PLAYER1
p1life 40 32
p1icon 24 50
p1mp 40 64
mp1icon 24 64
p1shoot 120 64 0
p1iconw 104 64
p1lifen 24 32 0
p1lifex 32 32 0
p1score 40 50 86 50 100 50 2
p1namej 205 15 120 15 40 15 1
e1life 40 100
e1icon 24 100
e1name 40 118 0
p1smenu 1 0 84 240
#PLAYER2
p2life 360 32
p2icon 344 50
p2mp 360 64
mp2icon 344 64
p2shoot 440 64 0
p2iconw 424 64
p2lifen 344 32 0
p2lifex 352 32 0
p2score 360 50 406 50 420 50 2
p2namej 525 15 440 15 360 15 1
e2life 360 100
e2icon 344 100
e2name 360 118 0
p2smenu 321 0 404 240

I will try to make it accept actual levels .txt file and populate all positions with it as well.So yo can load existing hud settings from your game and adjust .
Yeah you will be abl to load own image and if not its going to be black bg

h3.png

P2-P4 must be auto generated, caus ethe hud has to look aestheticaly symmetrical.Theres no reason to open up p2 p3 p4 .I will add aligning tho and vaious settings/choices
I was also thinking of allowing to have lifebars on top and bottom at the same time for p1-p4 but i remember trying to do that and it sucks when lifebars obscure the payable area so... il skip that for now.
 
Last edited:
Loading from levels txt is possible now.
I think ill add specifying data folder, so, it will load lifebar size settings, levels txt and fonts automatically, but the icon and bg ... i dont have idea how to solve for now withouyt having own assets, maybe just manual load for both of them
huuu.png
 
Loading from levels txt is possible now.
I think ill add specifying data folder, so, it will load lifebar size settings, levels txt and fonts automatically, but the icon and bg ... i dont have idea how to solve for now withouyt having own assets, maybe just manual load for both of them
View attachment 8153
It's really useful. Will this tool work in the same way as the fontmaker? I could not make it work even after installing python, probably I missed some step.
 
there are ways to convert python to exe , all the tools are python guis. to see what causes the error you type "cmd" wher efolder path is in windows on top , then it opens commandline, then you drag and drop the bat file with gui, it will show error without closing , then we can fix it, i dont have errors here but if i knew i could build autochecks so they prevent errors.
Lifebars are scaled too now, so whats left is loading font , i think ill just make a button to load font file, im on the fence about loading and populating values from txt in data folder. Im not sure if its better to let ppl load manually icon from one place, then fonts from another place etc...
I aso thought about adding button to just check the font size that you have by checking resolution of font file and then detecting size and using this size in this gui.
The thing is i want ppl to experiment with font sizes and not be stuck with just the font they have.


sdfsd.png


--
Ok it loads gif and png icons and first color is transparent and i think this should help a lot with huds , you load levels.txt, load player iucon, load font to detect its size , and youre good to go .IT also shows select screen positions for players.
Now if we could solve all the issues people have running these scripts.
fdsg.png
 
Last edited:
New tool to load gif/png and pick colors from ref image, or just edit palette normally , i needed it often trying to match capcom colors or skin colors on sprites but no program allowed for fast picking, so had to made my own.
You load image , then you can load reference image, and just right click reference to automatically apply its RGB color to currently selected color of the top image.
 

Attachments

  • palref.png
    palref.png
    18.1 KB · Views: 5
renamer.jpg
Wrote something new, this one lets me point to existing character folder with text files, specify current name as input word and new name as output word, and so it will automatically go over every line in all text files in folder and change input line to output line.

So on image example character will be called gober after its done , and all his paths and all mentions of gob in files will be changed to gober , with just one click.
It saves time especially if you create a game and follow specific naming, this can help and you dont have to manually replace the names in each txt one by one.

It also changes the names of the txt files themselves... so its all consistent and easier to manage.

But yeah this wont help if you name your char "buddy" but you keep his files in folder caled "champ" and his text files are named like"borky.txt" so its all over the place ... But you can fix this with this tool so... its just more steps
This helps me to change weapon names and all paths for chars fast.

You can drag and drop any file from folder into the folder path in the gui - it will detect the path for you.

I guess i can make it also insert new names into models.txt file, and also copy all txt and pngs whatevers in folder to new folder with new name... So you don really have to do anything at all and your char will be cloned with just one click and added to models and will work right away in game.

Code:
0<0# : ^
'''
@echo off
set script=%~f0
python -x "%script%" %*
exit /b 0
'''

import subprocess
import sys
import importlib

def install_library(library):
    subprocess.check_call([sys.executable, "-m", "pip", "install", library])

def is_library_installed(library):
    try:
        importlib.import_module(library)
        return True
    except ImportError:
        return False

libraries_to_check = ["tkinter", "tkinterdnd2"]

for library in libraries_to_check:
    if not is_library_installed(library):
        print(f"{library} is not installed. Installing...")
        install_library(library)
        if not is_library_installed(library):
            print(f"{library} installation failed. Please install manually.")
        else:
            print(f"{library} installed successfully.")
    else:
        print(f"{library} is already installed.")
    
import tkinter as tk
from tkinterdnd2 import DND_FILES, TkinterDnD
import os
def handle_drop(event):
    if event.data:
        try:
            files = event.data.split()
            dropped_file_path = files[0]  # Take the first file path dropped
            folder_path = os.path.dirname(dropped_file_path)  # Get the directory of the dropped file
            if os.path.isdir(folder_path):
                entry_folder.delete(0, tk.END)  # Clear any existing text
                entry_folder.insert(tk.END, folder_path)
        except IndexError:
            pass
def rename_files_and_update_content():
    input_word = entry_input.get()
    output_word = entry_output.get()
    folder_path = entry_folder.get()
    rename_files(folder_path, input_word, output_word)
    update_text_files(folder_path, input_word, output_word)
def rename_files(folder_path, input_word, output_word):
    for filename in os.listdir(folder_path):
        if input_word in filename:
            new_filename = filename.replace(input_word, output_word)
            os.rename(os.path.join(folder_path, filename), os.path.join(folder_path, new_filename))
def update_text_files(folder_path, input_word, output_word):
    for filename in os.listdir(folder_path):
        if filename.endswith('.txt'):
            file_path = os.path.join(folder_path, filename)
            with open(file_path, 'r') as file:
                content = file.read()
            updated_content = content.replace(input_word, output_word)
            new_filename = filename.replace(input_word, output_word)
            new_file_path = os.path.join(folder_path, new_filename)
            with open(new_file_path, 'w') as new_file:
                new_file.write(updated_content)
root = TkinterDnD.Tk()
root.tk.call('tk', 'scaling', 3.0)
root.title("CharRename")
tk.Label(root, text="Input Word:").pack()
entry_input = tk.Entry(root)
entry_input.pack()
tk.Label(root, text="Output Word:").pack()
entry_output = tk.Entry(root)
entry_output.pack()
tk.Label(root, text="                            Folder Path:                               ").pack()
entry_folder = tk.Entry(root)
entry_folder = tk.Entry(root, width=36)
entry_folder.pack()
entry_folder.drop_target_register(DND_FILES)
entry_folder.dnd_bind('<<Drop>>', handle_drop)
tk.Button(root, text="Rename", command=rename_files_and_update_content).pack()
root.mainloop()
 
Last edited:
Ok i made it so it just clones all files to new folder, then changes all the names paths and mentions of input word, and then detects models.txt location and appends "know" commands there and it works right away in chronotools without errors.

So now if you have a char, want to make a clone of i this char with all weapons retained and script names and give him different name to start new character from him as base - you can do it easily.

In this instance its "gob" and his files are in gobtest , and you can change this char name to whatever and clone his all files to new folder and i works, input folder path does not matter much , does not have to be the same as input word

Output folder does not have to be named the same as the output word, but it helps with consistency.

Yes some names like "char" or "data" will have issues cause these words are in actual path to the files, but i dont think anyone names his chars like this.

Best naming would be hero.txt, burnhero.txt,freezehero.txt , wep1hero.txt,wep2herop.txt , gunhero.txt, bathero.txt or similar so all files in folder are named with hero that will be input word - All txt files names need to contain input word to make this work properly and i do this from the beginnings but sometimes i dont, so im sure others dont do this always as well.
renamer.jpg
 
Last edited:
OK i built a tool that cleansup data folder and leaves only the files that are in use.... what it does is :


Collects all txt files and c files ( yes in scripts as well) inside data and all folders and reads all paths mentioned inside them.
The paths recognized must be paths to files like - pcx,gif,png,bor,ogg,wav,txt,c - If i miss any type of file let me know.

Then it puts all paths to these files into a log, and it applies actual path of the files so its not just data/spriters/flash.gif fron inside of flash.txt , it actually adds entire path to extracted paths.

Once all files are acquired from txt files and put into a log file then i add required files into that log file as well - files that should never be deleted which are ( i think i miss some for widescreens alternative levels.txt or for psp or something ):
for file in [
'bgs/loading.png', 'bgs/loading.gif', 'bgs/loading2.png', 'bgs/loading2.gif',
'bgs/title.png', 'bgs/title.gif', 'bgs/titleb.png', 'bgs/titleb.gif', 'bgs/logo.png',
'bgs/logo.gif', 'sprites/font.gif', 'sprites/font2.gif', 'sprites/font3.gif',
'sprites/font4.gif', 'sprites/font5.gif', 'sprites/shadow1.png', 'sprites/shadow1.gif',
'sprites/shadow2.png', 'sprites/shadow2.gif', 'sprites/shadow3.png', 'sprites/shadow3.gif',
'sprites/shadow4.png', 'sprites/shadow4.gif', 'sprites/shadow5.png', 'sprites/shadow5.gif',
'sprites/shadow6.png', 'sprites/shadow6.gif', 'sprites/arrow.png', 'sprites/arrow.gif',
'sprites/arrowl.png', 'sprites/arrowl.gif', 'bgs/hiscore.gif', 'bgs/hiscore.png',
'bgs/complete.gif', 'bgs/complete.png', 'bgs/select.gif', 'bgs/select.png',
'bgs/unlockbg.gif', 'bgs/unlockbg.png', 'models.txt', 'levels.txt', 'script.txt',
'lifebar.txt', 'select.txt', 'touch.txt', 'video.txt', 'scenes/gameover.txt',
'scenes/logo.txt', 'scenes/intro.txt', 'scenes/howto.txt', 'data/sounds/beat1.wav',
'data/sounds/fall.wav', 'data/sounds/get.wav', 'data/sounds/money.wav', 'data/sounds/jump.wav',
'data/sounds/indirect.wav', 'data/sounds/punch.wav', 'data/sounds/1up.wav', 'data/sounds/go.wav',
'data/sounds/timeover.wav', 'data/sounds/beep.wav', 'data/sounds/beep2.wav', 'data/sounds/bike.wav',
'data/sounds/block.wav', 'data/sounds/pause.wav'
]


If i miss any required file ( i dont think i do cause i checked manual) then let me know.

Cause not all paths are actually mentioned inside txt files - for example theres no path to loading.gif mentioned anywhere but the file must be saved so its excluded from deletion/cleanup and its on a list above.
Theres no paths to font files as well, no paths to shadows cause you just use numbers for them in header etc .... so all this must be preserved and eventually manually removed if you want to.

Then the process moves all unused files to REMOVED folder ( while preserving structure so you can bring them back by just copy pasting back into data folder)

This also scans inside scripts ! So it detects even files when you have something like : set(prevs, i, loadsprite("data/bgs/prev/"+(i+1))); - the code will make sure files from prev folder are not removed.

Of course i cant predict all the scripts people make, but it is possible to make it work with anything IMO.

So this helps to trim down data folder by a lot sometimes.
 
txt_and_c_files = [file for file in all_files if file.endswith('.txt') or file.endswith('.c') or file.endswith('.h')]

and i also think ill add a field to the gui so you can input paths to the files you dont want to remove manually for the specific scenarios amd ill add REVERT button that will undo deletion in case the cleaned data wont work, this way you can test this faster and pinpoint problematic unique paths to the files you want to keep from deletion./cleanup
 
Trying to improve fontmaker to make the fonts look more 3d and not just flat one color, i do this by pasting copy of the whole font image onto another copy that is a bit darker and shift it by 2 pixels to side and down/up, and this gui does this automatically now.
Where do I download the fontmaker tool?
Thank you
 
OK i built a tool that cleansup data folder and leaves only the files that are in use.... what it does is :


Collects all txt files and c files ( yes in scripts as well) inside data and all folders and reads all paths mentioned inside them.
The paths recognized must be paths to files like - pcx,gif,png,bor,ogg,wav,txt,c - If i miss any type of file let me know.

Then it puts all paths to these files into a log, and it applies actual path of the files so its not just data/spriters/flash.gif fron inside of flash.txt , it actually adds entire path to extracted paths.

Once all files are acquired from txt files and put into a log file then i add required files into that log file as well - files that should never be deleted which are ( i think i miss some for widescreens alternative levels.txt or for psp or something ):
for file in [
'bgs/loading.png', 'bgs/loading.gif', 'bgs/loading2.png', 'bgs/loading2.gif',
'bgs/title.png', 'bgs/title.gif', 'bgs/titleb.png', 'bgs/titleb.gif', 'bgs/logo.png',
'bgs/logo.gif', 'sprites/font.gif', 'sprites/font2.gif', 'sprites/font3.gif',
'sprites/font4.gif', 'sprites/font5.gif', 'sprites/shadow1.png', 'sprites/shadow1.gif',
'sprites/shadow2.png', 'sprites/shadow2.gif', 'sprites/shadow3.png', 'sprites/shadow3.gif',
'sprites/shadow4.png', 'sprites/shadow4.gif', 'sprites/shadow5.png', 'sprites/shadow5.gif',
'sprites/shadow6.png', 'sprites/shadow6.gif', 'sprites/arrow.png', 'sprites/arrow.gif',
'sprites/arrowl.png', 'sprites/arrowl.gif', 'bgs/hiscore.gif', 'bgs/hiscore.png',
'bgs/complete.gif', 'bgs/complete.png', 'bgs/select.gif', 'bgs/select.png',
'bgs/unlockbg.gif', 'bgs/unlockbg.png', 'models.txt', 'levels.txt', 'script.txt',
'lifebar.txt', 'select.txt', 'touch.txt', 'video.txt', 'scenes/gameover.txt',
'scenes/logo.txt', 'scenes/intro.txt', 'scenes/howto.txt', 'data/sounds/beat1.wav',
'data/sounds/fall.wav', 'data/sounds/get.wav', 'data/sounds/money.wav', 'data/sounds/jump.wav',
'data/sounds/indirect.wav', 'data/sounds/punch.wav', 'data/sounds/1up.wav', 'data/sounds/go.wav',
'data/sounds/timeover.wav', 'data/sounds/beep.wav', 'data/sounds/beep2.wav', 'data/sounds/bike.wav',
'data/sounds/block.wav', 'data/sounds/pause.wav'
]


If i miss any required file ( i dont think i do cause i checked manual) then let me know.

Cause not all paths are actually mentioned inside txt files - for example theres no path to loading.gif mentioned anywhere but the file must be saved so its excluded from deletion/cleanup and its on a list above.
Theres no paths to font files as well, no paths to shadows cause you just use numbers for them in header etc .... so all this must be preserved and eventually manually removed if you want to.

Then the process moves all unused files to REMOVED folder ( while preserving structure so you can bring them back by just copy pasting back into data folder)

This also scans inside scripts ! So it detects even files when you have something like : set(prevs, i, loadsprite("data/bgs/prev/"+(i+1))); - the code will make sure files from prev folder are not removed.

Of course i cant predict all the scripts people make, but it is possible to make it work with anything IMO.

So this helps to trim down data folder by a lot sometimes.

Pretty slick stuff @bWWd.

DC
 
Back
Top Bottom