PSOBB Addon Plugin (Lua UI addons)

I am not sure if ill be able to figure that out maybe @Ender has an idea I think the way my current name coloring works doesnt allow for that.
Nah no idea. Looks like this is how imgui just renders text when it starts at a specific X pos. The highlighted lines are a single text call so it wraps back to the beginning.

You would probably have to add something new to the base plugin to get around this that specifies the cursor's X position for lines after the wrap.

Maybe there's a way to calculate the text extent and split it into two strings--one for the first part and then a new line that starts with X pos == 0 for the wrapped text call. But I don't know if Imgui provides the text extent somewhere and the font size isn't really the width of the text.
 
I am not sure if ill be able to figure that out maybe @Ender has an idea I think the way my current name coloring works doesnt allow for that.

Also after enders PR ill prob add a setting so players can choose their highlight color.
I've figured out how to get the text to wrap the way I want it to but I don't use github. I also wouldn't say that its a good solution.
local namePadding = ""
while imgui.CalcTextSize(namePadding) < imgui.CalcTextSize(nameFormat)-imgui.CalcTextSize(" ") do
namePadding = namePadding .. " "
end
imgui.SetCursorPos(imgui.GetCursorPosX()-imgui.CalcTextSize(namePadding), imgui.GetCursorPosY())
imgui.TextWrapped(namePadding .. options.clMessageSeparator .. formattedText)
The idea is to start the text portion of the message at the same place as the name starts so the line wrap starts at the far left and just add spaces to the beginning so that the messages text doesn't overlap the name.
One issue is that a bunch of spaces won't always line up nicely with the end of the name to place the separator so I've dynamically moved the starting position so that the separator does line up but the wrapped text might be a tiny bit indented. I couldn't figure out a way to get both to line up every time so I had to pick one.
 
I've found another issue. It appears that if you've used /modname on a character it won't highlight anymore.
you sure it isnt due to character name length? It looks like Enders code only allowed up to named 7 characters long the issue was
return read_pso_str(player + CHARACTERNAME_OFFSET, 20)
each letter of a characters name is 2 bytes so 20 would in theory work but the issue is there are some characters prior to the character name which we skip but still use part of that 20, I increased it to 24 and it seems to read them all now. (10 letter max)

I just pushed a fix for that as well as a few other things, Let me know more into on your word wrap and I can make it into a toggle setting.
433053974-d8a8045d-ab3b-41b3-af7e-5634acb46129.png
 
you sure it isnt due to character name length? It looks like Enders code only allowed up to named 7 characters long the issue was
return read_pso_str(player + CHARACTERNAME_OFFSET, 20)
each letter of a characters name is 2 bytes so 20 would in theory work but the issue is there are some characters prior to the character name which we skip but still use part of that 20, I increased it to 24 and it seems to read them all now. (10 letter max)

I just pushed a fix for that as well as a few other things, Let me know more into on your word wrap and I can make it into a toggle setting.
View attachment 24129
Still doesn't seem to fix it
YlnNiBe.png
 
  • Like
Reactions: Esc
Hi folks! I'm a newbie lua programmer and I really wished for this addon to have a toggle for coloring player's names according to their section ID, so I modified it to do just that! In the get_chat_log() function, It matches the sanitizedName of a message to the player's pointer in memory, then gets their section ID off of that and attaches it as the 4th row of the message. Then, if the option is toggled on, it bases the coloring of nameFormat off the sectionID instead of the options.clNameColor values in the final part of the DoChat() function.

This method has the major flaw that if two players are present with the exact same name but different section IDs, the section ID of whichever player happens to be loaded first in memory will be used for both their messages. However, it has otherwise worked wonderfully in the little testing I've done.

Would this kind of addition be welcome to the project's github? I'd welcome any and all feedback with the edits should I submit them; my inexperience means that there might be bugs or inefficiency issues I'm not aware of.
 
Clone/download the repository, open it in visual studio, and inside dinput8.cpp, add SetCurrentDirectory("PATHTOYOURPSOBBHERE") somewhere in Initialize() or DllMain(). Probably a better idea to put it in Initialize() near the end. So if your home server's psobb.exe is at C:\MyTeth\psobb, you would add

Code:
SetCurrentDirectory("C:\\MyTeth\\psobb");

at the end of the Initialize() function, rebuild it (in Release x86 mode) and grab the new dll and put it with your psobb.exe.

If you have others who use the client+addons for your server with the launcher, it might be a good idea to hack something so that the directory isn't hardcoded in the addon. I came up with this monstrosity a year+ ago... I put this code at the end of Initialize() in the plugin instead of the code above.
Code:
    char *pdir = getenv("PSO_HOME");
    if (pdir)
        SetCurrentDirectory(pdir);

And then where the psobb.exe and launcher.exe are located, I created a bat script with this:
Code:
setx PSO_HOME "%cd%"
echo %PSO_HOME%
launcher.exe

So when I run this bat script, it will set an environment variable named PSO_HOME with the current directory, and it will then run the launcher.exe. The plugin will grab the PSO_HOME variable value (the current directory) and set that as its current directory.

Just wanted to let you know that Google search brought me here and i found this incredibly helpful/it fixed my issue. I now have an item and monster reader on my offline server despite never coding anything, never using Visio Studio. Between this guidance and some chat gpt questions we are good to go!

So thank you so much nearly 6 years later :)

(who knew you needed two \'s for the file location? ha. )
 
I've run into an issue with the Theme Editor. I'm trying to replicate the settings for this skin, but my color settings already match what the picture on the wiki entry shows! But the color does not match at all!1755947922704.png
 
Hello, is there something specifically I have to do other than putting the folder in my PSO folder? It just doesn't do anything in-game
 
Hello, is there something specifically I have to do other than putting the folder in my PSO folder? It just doesn't do anything in-game
Which folder did you put into your PSO folder?

You need to install the base plugin first. And then other addons can be added.
 
Which folder did you put into your PSO folder?

You need to install the base plugin first. And then other addons can be added.
The base plugin is not working for me. I put it into the epineaPSO (the one with the online.exe)

I only put the XPbar into it, but "`" won't open the plugin menu.

I am just confused, as I see it as straightforward, like many other games I added mods to.
Maybe my C++ 2015 is wrong (newer version)

Maybe the skins I tried adding in the data folder in different ways messed it up.
Tried a lot of different skins, but I think none worked either. (HD forest, HD HUcast, OG PSO1 UI, OG PSO1 Intro and maybe a few more..)

..or any settings in the launcher options messed it up.

I think I tried to put them first into the data folder before seeing that they actually go into the custom folder nowadays.
..got confused at this point and wasn't sure anymore.

Probably confused myself in between.

Would it be smart to reinstall the game and start fresh with the plugin?

Help is really appreciated!

-----------------------------------------------------------------------------------------------------------------------
I wish I had known about Ephinea/blue burst 10 years ago.. I have been craving PSO for a very long time. Super addicted again.
Trying to get my first char to ultimate solo atm :)
 
You likely downloaded the source code for the base plugin instead of the release. You're supposed to grab bbmod.zip from here. Do NOT download the source code files.


You should extract that zip directly to your EphineaPSO folder so that dinput8.dll, dinput8.pdb, and the addons folder are created in the same place as where psobb.exe and online.exe reside.

When you download an addon, they are usually downloaded through the Code > Download Zip button on the repository's main page. This will give you a zip file containing a single folder of the repository before it gets to the actual addon. For example, the XP Bar addon will be psobb-addon-xpbar-master.zip with a single folder psobb-addon-xpbar-master. You need to go into that folder and copy the XpBar folder to your EphineaPSO/addons folder.
 
You likely downloaded the source code for the base plugin instead of the release. You're supposed to grab bbmod.zip from here. Do NOT download the source code files.


You should extract that zip directly to your EphineaPSO folder so that dinput8.dll, dinput8.pdb, and the addons folder are created in the same place as where psobb.exe and online.exe reside.

When you download an addon, they are usually downloaded through the Code > Download Zip button on the repository's main page. This will give you a zip file containing a single folder of the repository before it gets to the actual addon. For example, the XP Bar addon will be psobb-addon-xpbar-master.zip with a single folder psobb-addon-xpbar-master. You need to go into that folder and copy the XpBar folder to your EphineaPSO/addons folder.
Most likely downloaded some very old addons that messed everything up.
I reinstalled the game and used the same plugin and addons I downloaded before.. I also put it on another drive to be sure it is just away from the other old folder.
Left all the skins out this time.

In future, I'll look at the release years of stuff before I install them.

Sry for not trying this first.. but I just thought it can't hurt to start connecting through the forum.

I want my PS5 controller mapped for "0-9" and then I am golden.

Luckily, I started with a HUcast, so it isn't too urgent.
 
Back
Top