Last resort logo

SWAT 3 - LAST RESORT GAME MODIFICATION


Spam Prevention - PLEASE READ !! (23 Apr 2021)

Due to a problem with spammers the rules for posting in the forums have changed for new users.

Newly registered users won't have their posts published until a moderator approves them.

Fixing the Screens(Work flow)

More
4 years 2 weeks ago - 4 years 2 weeks ago #1429 by Copy-Cat
I couldn't let it go and after reading the post on the loading images and potential fix for em. I decided to give it another shot.

I ran some test and created a 800 x600 LC_Callup_background screen and ran it in 1366 x 768. The results made me rethink the current solution for this post and I am going to research it further. The 800 x 600 callup background was centered without the need to manually recenter. This tells me that somewhere it is being centered.

I played with the con settings and wrote my observations.
Code:
prompt LanLobby LanLobby LC_Callup_background 0 0 1366 768 0 0
The screen will run with all the values replaced with 0's; Why?
The con files are run dynamically, and the values they load are not loaded into memory, meaning they are loaded as needed. When the game needs to load a screen it loads a con file, passes in values, but the values are all ignored.

Test this for yourself.
make a mod with a con file. I chose the lanlobby.con, run the game , and create a Multiplayer>Lan and click GO!.
go back to your mod and open the con file. Add a 1 to the file name, save and go back into game. Go to main and recreate your game and notice the image is no longer showing up.

This gave me the location in the assembly code where I can throw an exception and crash the game. If I remove all values save and try again the game crashes. Create a software breakpoint at this location, step thru and watch the values being passed in, to see where and why they are ignored and what is loading in its place. Hopefully it is loaded from exe, find location and chage value to see if it shoots it up to the corner of the screen. (I know I know) this is not the desired result but I'm trying to break it to find the value, if its 0 or 1 or screenRect/2 or what ever it is.

I will continue and post my findings.

Please Log in or Create an account to join the conversation.

More
4 years 2 weeks ago - 4 years 2 weeks ago #1430 by Slippery Jim
Yes, I was aware the game auto-centered the multiplayer screens. With those screens I don't manually center them. I actually have to do the opposite - I have to manually reset the top left to 0,0 by subtracting from the coordinates. The game ignores the top line coordinates but it does not ignore the rest of the entries that come after the top line.

I was aware the game ignored the top line numbers after the .bmp title but I always added the info because I was worried the game needed it at some point. I remember long ago deciding to follow their example just because it is "good form" and because it helped me keep track of which file was which. Until you posted I completely forgot all about that. It has been 10 years since I touched some aspects.

After reading your post I want to smack you upside the head (benny hill style) because I have been trying to get you to look at the .exe this whole thread!

Please Log in or Create an account to join the conversation.

More
4 years 2 weeks ago - 4 years 2 weeks ago #1432 by Copy-Cat
Messing around with the con files I think i may have found and more elegant solution jump on mate!B)

UPDATE:
The position of the image can be anywhere ya want and configured within the con file.
Code:
prompt LanLobby LanLobby
it seems to me at the moment that this code is a placeholder or namespace with unused values.

so I removed the use of this image by replacing the code with this code
Code:
prompt LanLobby LanLobby BeGoneFromMe! 0 0 0 0 0 0

and then added to the bottom of the con file this.
Code:
promptctrl "sprite 99 1366 768 0 (LC_Callup_background -400 -103 966 665 1 1 1 LC_Callup_background 1 1 0 1)"
Just add this new sprite to each menu with the image and position you want. Add it to the bottom of the con so it is treated as background. I was then able to use any image I wanted and stretch it to fit the screen.

Still working on to find a more elegant solution. Looking thru the exe now..

This could potentially fix the menu lag issues too.

Please Log in or Create an account to join the conversation.

More
4 years 2 weeks ago #1433 by Slippery Jim
Hmmm, doing funky things like that sounds like a bad idea to me upon first impressions.

Please Log in or Create an account to join the conversation.

More
4 years 1 week ago - 4 years 1 week ago #1437 by Slippery Jim
Good news.

With the help of my son Noisyboy all the other screens have been centered. He wrote a script in Python that automatically calculated the adjustments needed in the Menu.dat for the x,y coordinates of all the screen elements. This script can be re-used for any resolution we choose. Very handy to have someone taking computer science in university on the payroll (humble brag, lol).

I just have a few more screens I need to spruce up in photoshop and then I need to do a complete test of 1920x1080 (the first one I am fixing).

Copy-cat, that doesn't mean your work is wasted. It still would be nice to be able to control if a screen gets centered or not.

The big problem with centering the metro map screen manually by modifying the coordinates is that all custom maps show dots off the map. (See the screenshot I attached - look for dots in top left of screen).

We would have to add entries for every single custom map to fix this.

UPDATE: Perhaps the best solution is to not move the map section at all. I will have to see how it looks with the map still in upper left corner and the rest of the screen elements in their new spots.

Please Log in or Create an account to join the conversation.

More
4 years 1 week ago #1452 by Slippery Jim

Please Log in or Create an account to join the conversation.

Moderators: DarkSynopsis
Time to create page: 0.290 seconds
Powered by Kunena Forum