Thread: Saving Settings
View Single Post
  #1  
Unread 01-30-2006, 09:41 PM
maddbomber83's Avatar
maddbomber83 maddbomber83 is offline
A Fallen Diplomat
Interface Author - Click to view interfaces
 
Join Date: Dec 2004
Server: Oggok
Posts: 52
Default Saving Settings

I have made a mod to the Bag Window. I followed the stay put instructions (for having bag save location) and it works! The only problem is due to the way my bag is designed it immediatly breaks in game.

http://www.eq2interface.com/download...fo.php?id=4171

I am looking for ideas on how to fix this. When my bag gets posted by the mod you can see exactly what I am talking about, so let me explain the basics on how my bag works. I am using a lot of new things I havn't seen "done" before but have been explained in these forums.

Inside the bag there is a Data File that stores variables that I allow the user to modify in game. Then the bag will change its shape and size based off the variables the user sets. The Variables are. . .

Area.Base (Used to Calculate page.y)
Cell.Num (Set by how many cells are visible)
CellSize (Set by user, defualt is 40)
Colums (Set by user, default is 4)

condition (used in if statments)
page.x (Size of Window)
page.y (Size of Window
pixels.y (used to calculate page.y)
rows.base (used to calculate page.y)
rows.round (used to calculate page.y)


Now there are two sets of cells, the ones you see and the dummy array (using a volume page). What basicaly happens is when the user changes the size of a cell, or the number of colums, they are actualy changing the volume pages info.
Then I calculate the new size of the window (based off how many colums, how many cells, and how big each cell is) and resize the whole bag window accordingly (including the volume page). Once resized, the volume page will automaticaly reposition all the dummy cells to fit perfectly. I then set the size/location of all the real cells to the dummy cells. The result, the user can change the size/shape of bags in game.

So that is the basics behind the mechanics of my mod. It works great in game.

The problem is when you exit the game, the UI will (because of the stay put code) save the location and size of the bag. When you log back in the bag will be in the location and the same size as you left it.
However, the cells default back to 40x40 and the colums are back to 4. As soon as you make any adjustments it pops the way it should be (based off defaults) but not the way you set it up last.

If I could do math with the size it would be great, but because its in the (100,50) format I can't. I havn't figured out how to seperate the , from the equation. So I am stuck with the file.

The only thing I can think of to do, is to make a seperate file that the user can modify. This would be my data file. Use the Include to put it in my code. This way the user could set the defualt size and colum number out of game, and it will load that in game (where they can edit it further). However that kinda defeats the purpose of in game modifable bags (although it does give the end user much more flexibility than the current multi format bags).

The basics of my problem are above and I hope to get some good ideas. Below I am going to make a post with some code babble about how I used math and conditional operators and such so that in the future people who are looking to do stuff like this can see what I did. (because thats how I learned to do any of this, looking at other's work and posts).
__________________

Last edited by maddbomber83 : 01-31-2006 at 10:35 AM.
Reply With Quote