Jump to content
LordJashin

OSI Major Changes to the Constants! Moving Forward! Relativity!

Recommended Posts

The infamous Patch9 has been pushed as the ALMIGHTY PUSH to OSI

 

Explanation of why everything was changed a bit:

Most of the constants are relative to each other, so that if we

need to change one. It will automatically update the rest of them.

Things like toolbar changes will be easier to overcome with Relative

constants. The formulas used are all relatively the same except for

when ZERO is involved. If something starts at 1 and ends at 3 the

width of it is not 3. But 3 - 1. Now if it was 0 to 3, the width

would be 3. Things like this make the math look different, etc.

 

Relativity, is the primary reason. If we make the constants relative to each other. Then when we change one, everything else will be updated too accordingly. Making for a smarter world of coordinates. Screen scraping crap. But beware, sometimes the MATH of one of the constants will need to be changed. The DIV and / operators are one of the reasons why. One rounds down, and the other is extended. So if the number changed, we might have to change how it is divided based on if the number divides evenly or not, or w/e.

 

Examples:

Chat Box Center Point - Rounded

(7 + 345) div 2 + 1

 

With DIV, 352 div 2 = 176 (SO IT ROUNDS DOWN) In real division this would actually be 175.5, but div rounds down

So that's what the + 1 is for because us Mathematicians want to round UP

 

So lets say one day it changed to 354. We would have to get rid of the "+ 1" on the end because it DIVIDES evenly now!

 

If anyone knows a way around this with some kewl stuff. Let me know or just pull it yourself on github, the changes.

 

Moving Forward!

 

Starting with the constants. All of OSI's functions that use COORDINATES outside of the constants should be changed to USE Constants! (x1, x2, y1, y2). Once we do this, things will be easier to fix as well.

 

Then things won't just one day, break. Because of gey toolbars

Link to comment
Share on other sites

You could replace the 1 with a variable. Set it 1 or 0 with a function which needs a bool.

 

[scar]

Procedure RoundUp( set = bool );

begin

if set is true then

extravariable = 1;

else

extravariable = 0;

end;

[/scar]

 

Should be made more neat, but you get the point.

Link to comment
Share on other sites

Not sure what you are trying to accomplish here. Why not simply call the Round() function directly and let it handle deciding whether to round up or down?

 

Are you guys POSITIVE that it works!? Have you tried it with Constants before??? I thought that you couldn't put Functions or use Functions inside Constants??? If you can then %)_$#@_$#@* lols

 

 

Wanted is very knowledgeable, I want him to write up a big list of things he remembers he wanted to add to OSI. Because looking at his past posts, he's had some excellent ideas.

 

Now this is very straightforward. But there is a way to get the math in there. I just know there has to be a way to automatically do it. But you need more parenthesis and some nifty math skills. Like it took me a while to understand how GetItemBounds works, even had a discussion with Wanted about it. I was stumped till I sat there messing with it for hours lols...

 

So like: Constant1 = some way in math (if extended at or above .5) then roundup; Mod, and Div, among other things ....

Edited by LordJashin
Link to comment
Share on other sites

Oh right we are talking constants. Duh!

 

Anyway it may be overkill to make the constants relative to one another. The major point is to make all coord references in the includes relative to the constants we already have, rather than hardwired like GetColor(150, 253). Anything beyond that is gravy IMHO.

 

Yes you're right. I'm just astounded in Delphi you can do Const constant1 = Round(1.11); but in SCAR you can't. I wonder what's different?

 

Anyway. For ALL the constants that are important, we could make them into variables and move them. I don't like the idea of being able to change values though. But most likely, only some will be non-relative versus having a lot. So we can just keep those updated the old fashion way. Or move them around some.

 

I want to make a new Globals file. But this time with unuseful to us, constants, but useful to functions. For instance. The distance between boxes in the inventory. I made constants for that in the inventory.scar file.

 

Goal: Have most of the constants/variables in 2 files. Globas, and like maybe Constants.scar or Extended Globals or something. Once I start making new constants I will start with all the GetBounds functions...

Link to comment
Share on other sites

Sounds like some of those extras are better in your include building on top of OSI rather than in OSI itself? Just a thought.

 

We have slightly different priorities. If I had the time I would:

  • First go through the functions and make their coords reference the existing consts.
  • Remove the +50 pixel hack and adjust global constants accordingly.
  • Backport changes to 3.34 OSI so SPS fanboys will stop whining? :P
  • Then stop and re-evaluate where to go from there.

Link to comment
Share on other sites

Constants were first. Then organization, and then functions. In my priority list lols.

 

But I've been heavily toying with this +50pixel, crap. And SCAR 3.34 Old GMRL, Old OSI, etc. I will be posting a fix for 3.34 eventually. Still need to figure out how to make the bitmap that SCAR reads, from SMART, act like this: (0, 50*, 750, 500)

But as for everything else, you just go into SMART.scar and replace all of the overrides with +50 to the Y values. I'll post this soon with just those, probably work good enough.

 

As to the hack it will have to stay until we fix all the functions. Or we could make the toolbar be there, but make it so SCAR only acts on everything after the 50px.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...