file replacements not working

nige1981

New member
Hi all,

I hope you can help me. I'll do my best to explain myself clearly. Essentially, I' trying to achieve 2 things within Streets of Rage 2X:

1. Change my player name
2. Replace some level music.

1. Player name
So I tried the obvious things first. I changed the "Axel" folder to "Rick" folder (but I don't think that's necessary, but I tried this too and went through every file and folder and changed the "axel/" to "rick/"), I changed the text file "axel.txt" to "rick.txt", then I opened the rick.txt and changed the name to rick. I also changed the models.txt file line for axel to say rick.
##PLAYABLE HEROES
load Axel data/chars/heroes/axel/axel.txt

Nothing works for me though. I have no idea where I'm going wrong!

2. Replace level music
I tried replacing the first 20 music files with my own. I kept the names and filetypes the same as the originals(I.e. I swapped a "00.ogg" for another "00.ogg" file) and the game loads fine but there's no music in the levels I changed. They also do not play in the options. The log says:

Can't play music file 'data/music/remake/02.ogg'
Level Unloading: 'data/levels/sor2/st1a.txt'

I hope I have provided enough information and explained it properly. I'm using OpenBOR v3.0 Build 6391 if that helps and it's Streets of Rage 2X v.2.3.1.

Thank you in advance for any help you can provide!
 
1. Change my player name
When you change something name, you need to change it in every place where you call it. The engine doesn't care how you call something (you can call "Joe" player as "Orange"), as long as:

- the engine knows which entity you are talking about
- the path is right
- the name you are referencing to is right
- there isn't another enity with same name
- there isn't an entity with forbidden characters on it's name, like spaces, special character lik "ç" and etc.

So, if you have this "Axel"
##PLAYABLE HEROES
load Axel data/chars/heroes/axel/axel.txt
And want to change it to "Rick", do this:

##PLAYABLE HEROES
load Rick data/chars/heroes/rick/rick.txt

And at rick.txt file, you have to put the right name:

name Rick

You can have a "Rick" entity under the "Axel" folder, the engine won't care about it - as long the path is right.
Just for consistency, its a better idea to name the folder as the character name :)

An extra tip:

For native functions, like spawning an enemy on the stage, the engine doesn't care if you wrote the name with uppercase or lowercase characters - So if your character's name is "Rick" and you named him in the level as "rick", it will work.

However, when you call this entity via script, the name MUST be identical - if the entity is called "Rick" and you use "rick", it does not or does not appear or the engine closes, reporting an error.

2. Replace level music

This could be more tricky. if the path to the file is right (including the file name), maybe you are experiencing an issue with the .ogg file.
At least on the engine build I use (6330), when I tried to use a .ogg converted from a 48khz .wave file, the engine doesn't plays it. I had to change it to 44khz.

Extra tip (again, lol)
When working with .ogg files, I STRONGLY sugges you to use this method:
 
Hi Illusionista,

Thank you so much for your response.
Your advice has solved point 2 completely. You were absolutely right about the bitrate. As soon as I converted them to a lower bitrate (44khz) they worked first time.

What I'll do later, is try renaming every reference to "Axel" again but I'll make doubly sure I keep the case the same ("Rick") to see if there is any difference. I'll post again once I've given it a go. As far as I know, I was doing all of your other suggestions already so hopefully, if I just ensure the case is consistent, I'll have both issues solved!

Thank you again for your response, I really appreciate it!
 
Hi all,

So, all the music and sound effects are working beautifully, which is fantastic!

I'm still struggling with changing the name. As far as I can tell, I have changed every single reference of "axel" to "rick", whether its in a filename, folder name or within a .txt file but it won't let me into the character select screen. The error log only says the following is an error:

Can't play music file 'data/music/remix'
Video track: resolution=1920*1080, display resolution=1920*1080, 29.97 frames/second
Video track: resolution=1920*1080, display resolution=1920*1080, 29.97 frames/second
Audio track: 44100.000000 Hz, 1 channels, 32 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.97 frames/second
Audio track: 44100.000000 Hz, 1 channels, 32 bits/sample
Loaded 32-bit background 'data/bgs/title'

Can't play music file 'data/music/empty.ogg'
Video track: resolution=1920*1080, display resolution=1920*1080, 15.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 16 bits/sample
Loaded 32-bit background 'data/bgs/titleb'

Can't play music file 'data/music/remix' (note: there isn't and never was a remix file or empty.ogg file at this location)

EDIT: I found another reference to axel in data/levels/Select_default. Now I get this error:

Can't set model for entity 'rick', model not found.

I'm sure there's something obvious I'm missing, I just can't see it. I find it really confusing because before I make any name changes, I have no issues with any audio. Really at a loss with this one.

On a separate note, I'm also struggling with changing an enemy sprite design. His palette always messes up when I check him in game, I know its something to do with the palette but I just can't get my head around it. I've tried Googling it but I just don't understand how palettes are allocated to the gif or how I declare a palette and get all images within that entity to use it.

Sorry I'm a total noob, and thank you for the warm welcome and support here, I really appreciate it!
 
Last edited:
I wouldn't try edit modding SOR2X, It's the equivalent of passing your drivers test and immediately buying a Lamborghini as your first car.
It's no coincidence that you're having so many issues with a simple name change as there's more going on under the hood that would take you a long time to realise.

try


edit names, music and sprites etc and see how you go. I know it's not what you WANT but If you start off at an easier point you won't flood your thread with question after question as SORX2 is probably the most advanced mod out there and you'll have to change at least 20 text files and 90 lines of code just to change a name.
 
I've sorted the name. I installed Visual Studio and find a replaced every instance on all the .c files.

Only thing I plan to do now is get to the bottom of how the palettes work properly. When I make changes I keep ruining the sprites when I load it up. I kinda understand what's happening but I don't quite know what steps to follow to make sure I include all the colours I want/don't use colours that throw the palette into chaos when I load up the game. I've read the various tutorials on this but I still keep messing it up lol. I understand that each entity has a palette and you need to stay within that. The bit I don't understand is how to 'declare what my palette is'. each sprite within the entity is saved as a gif with the same palette applied but the sprites still come out as different colours when I load it up.

For anyone else who has problems trying to rename the main characters in Streets of Rage 2X, make sure you access ALL of the .c files (and find and replace ALL instances, not just the .txt names/folder names/text within in the txt files.

If anyone can explain the whole palette process to me basic terms (I use Photoshop). I would really appreciate that. Failing that, hopefully I can muddle through like I did with the renaming.

Thank you to everyone who was welcomed in here, and provided help and assistance so far. I truly appreciate it.
 
I wouldn't try edit modding SOR2X, It's the equivalent of passing your drivers test and immediately buying a Lamborghini as your first car.
It's no coincidence that you're having so many issues with a simple name change as there's more going on under the hood that would take you a long time to realise.
I can't agree more. It's a very complex game - Kratus is one of our best coders - and It won't be an easy task. Specially if you are having issue with such basic task.

Keep in mind that we are not trying to put you down or say that you are not capable, none of that (this community is even known for doing the opposite - making people learn, sharing knowledge in a friendly place, away from internet kids).

We're just telling you that you chose an extremely complex game to use as a base, precisely from one of the engine's developers.

About palettes, I've made a tutorial long time ago here:

I am using Fighter Factory on that tutorial, but you can follow it without a issue. Basically, you need to have your background color (the one you want transparent) as yout first color on your palette.

Even Fighter Factory being a mugen tool, its very useful for OpenBOR tool - specially its palette tool.
It can beat any other tool on this, including Photoshop itself.
 
You guys have been awesome. I don't often use forums as I (wrongly) thought it was full of people who made beginners feel like failures but you guys have been so welcoming and helpful!

I just read through the link you provided and you're absolutely right, for what I need, it blows Photoshop out the water! Great job on the tutorial too by the way.

I'll give it a go and I should be pretty much done with my edits!

Thank you so much Danno and Illusionist for your help. I'll do my best not to bombard with questions. Wherever possible, I like to try and solve it myself so I understand the process better, its how I learn lol.

Thank you again guys! I'm really, really grateful.
 
I'll do my best not to bombard with questions.

No problem that's what we're here for, I was actually in the middle of making you a mini tutorial but O'ilu beat me to it as photoshop is my weapon of choice also, fighter factory is the best for palette creation.

Bare in mind also that some of your questions may have been answered already so using the search function might help finding a solution.
 
I installed Visual Studio and find a replaced every instance on all the .c files
Good catch, I would say exactly that. But as a shortcut you may change only the select screen's name and the player alias using changeentityproperty(self, "name", "Rick") at the onspawn event.

What makes renaming players a complicated process in SOR2X is the custom select screen and attributes appliance, which is connected to many other scripts in order to spawn him properly.
 
Its a fantastically well put together game. Just working through the various files and lines of code. It's so much fun just seeing how all the various components work together to create a desired effect. Ah! The onspawn event would have been a perfect solution too. In a way, I'm glad I did it the long winded way, it's enabled me to get to other bits and pieces I wanted to work with, such as the intro. All in all, its an incredibly well-executed evolution of the classic Streets of Rage experience. Its fun to play and to work with in equal measure.
 
Back
Top Bottom