UI Builder Changes
I just realized that I made a change back in August so that the Left, Top, Width and Height functions would take a float value but apparently I forgot to push the version out to the patcher.
I'm going to do that today, but first I'm going to try to add an Int() function that will convert a value into and integer. If you'd be interested in testing this version out before I patch it, I can send you a copy today. Just PM me your email address. I'd like to make sure the changes don't break anything. |
While I'm working on this Evaluation hook, are there any other simple functions that would save you some work? I was thinking about adding int, abs, floor and ceil functions.
|
The int() function would be great, that would simplify many things. However we are currently using left, top, width, height not only to convert float to int, but also to shave off other characters at the end of a numeric string, such as a percentage sign. Therefore it would be great if the int() function would do that as well.
Your change will require a lot of mods to be changed (at least I assume that this does not only affect UIbuilder but also the ingame scripting engine) but this is a welcome change. :) You can send me a copy of UIbuilder for testing although I'm more anxious to test in game on Test. |
haven't used the live one in a while, been using the last one you sent me. Just figured you wasn't as forgetful as me o_O Ya send me the new build and I'll run it. I'll email you also.
As for more function A function like Windows StringCchCopyW API would be killer :) edit Changed Copy to StringCchCopyW, I've use my own wrapper for to long now.. |
Quote:
Hmm, can you give me an example? With the old version of our UI library, Left,Top,Width and Height were parsing the text as a Long value. If it encountered a non-numeric digit it should have failed and not set the value of the property. So I'm not sure how you are using it to strip non-numeric characters. |
I think gm9 meant to say we're using Top, Left, Width and Height to get Integers after we put values into the comma delimited values like Location and Size.
Not sure about percentages. Been outta the loop with stuff the past few weeks. Code:
iMathEvaluation=4+4 |
I'm not sure if this is UIBuilder related or not, but LocationEffector does not work vertically. I tried this in UIBuilder and it did not work.
|
Quote:
Percentages is actually something I thought you discovered Drumstix, lol. :p To shave off percentages I think you can use the Top, Left, Width, Height directly: Code:
Left=Parent.Spell_Cast_Percent.Text Edit: Yup, you discovered it: http://www.eq2interface.com/forums/s...9&postcount=13 |
That makes sense that you're using Top,Left etc to read out an integer. All that I changed is when you set the Top,Left values, it will now properly parse a float and treat it like an int. So even though you'll have an int() function now, you won't need to use it to do something like.
Control.Left = 5 + 10 I just finished writing the int() function and made sure it works with any non-digit character. It'll strip spaces off the front too, so basically it'll look for a dash and then numbers. When it hits a non-number it'll terminate and return what it found. These changes will not go live in the game until the next GU. I'm not sure when we are going to push them to test, but if you want to test script sooner, I can send you a copy of the new UI builder. |
That's great. So how is it implemented, classic way like this?
Code:
intValue=int(floatValue) |
Quote:
|
While you were asking about other simple functions: We do not have any string manipulation possibilities, maybe some standard string manipulation functions could be introduced? E.g. one thing we currently cannot do is remove a color code from a string. In other instances I might want to explode() a string or at least get the substr() until the occurance of a specific character in the string.
And to squeeze my constant request in: Non-ASCII support in UI scripting would be very very very helpful. :p |
Quote:
12.9% for example, and the reasoning originally was because we wanted to subtract and add percentages. Direct reasoning because there was no dynamic data available outside a tooltip for avoidance percent. |
Quote:
and what is explode() & substr() |
exploding a string returns a portion of a string up to a certain point.
substr is to get a sub portion of a string, similar to above, in a different method. |
Non-ASCII is mostly an issue on localized servers, yes, but theoretically you can run into the same issues on English servers. It also breaks some default UI functions on localized servers.
With explode(delimiter, input) I meant a function to split a string into an array based on the occurance of the delimiter string. E.g. explode(",", "123,456") you'd end up with a "123" string and a "456" string. With substr(input, start, length) I was referring to a substring function that returns part of a string. EDIT: Drumstix ninja'd me. :p |
I was just implementing the abs() function and had an idea.
I am making this function work for floating point numbers, so I take the value passed into abs() and parse it as a float. After calculating the absolute value I have to turn the float back into a string. This has the unfortunate side effect of doing what all the other math functions would do. so... abs(-4) would output 4.000 I decided to modify our floating point parser which currently takes a precision value (defaults to 3) and make it so I can pass a precision of -1 to indicate that it should not use trailing spaces. So now abs(-4) equals "4" while abs(-4.5) would still equal "4.5". Now to the interesting part. I got to thinking that there's no reason why the output of the math functions should always return a precision of 3. If anything it should use this new change I made and only return the precision necessary. So 4 + 5 = "9" and not "9.000". 2 / 4 would = "0.5" and not "0.500". So my question is, would this mess any of your mods up? Are there situations where you are relaying on a precision of 3 by default? Oh, one other thing. I found a bug that was fixed. Wanted to give you a heads up in case this would affect you. Currently if you try to use a negative floating point number in script, it will stop parsing the number when it hits the period. I've fixed this so now you write -4.5 and it'll work instead of returning -4. |
That is great, this facilitates a whole lot of things.
There will however be an impact on mods since currently due to the know precision of 3 we right align numbers and "hide" the decimals. Now if decimals are not shown anymore by default that will mess up the placement and thus the display of numbers in a couple of mods. But since the placement was only done that way to get rid of the decimals in the first place personally I'd say go ahead with your change. |
Quote:
StringCchCopy and StrPos is all we really need for stings and its low lever so it would be easy to make a UI wrapper for. But yea if u wanna go all out and make explode, left, right, substr I will not complain :P Really if your gonna go that far might as well put in a language interpreter for Lua or some other common OO scripting language. |
Sounds good. I know that going back and tweaking things will probably be a pain and several hours of work for many of you but hopefully in the long run this will be much better going forward.
If no one has taken the time to say it recently, we really appreciate all the trouble you guys go through to help make the game more fun for everyone. I'm just doing the job I get paid to do, but you guys are really putting in a lot of effort and it means a lot not only us at SOE but certainly to all of the players. I've pretty much got all the changes wrapped up for today so if you think you want to test out the new UI Builder this weekend, shoot me a PM on here with your email address, or just email me at [email protected] and I'll send you the latest version. Here are a summary of the changes for those that don't want to read back through the entire thread. * Top, Left, Width, Height properties now accept floating point numbers * The results of math operations no longer return 3 decimal places. * Fixed a bug with negative floating point numbers not parsing correctly * UIScript now supports the following functions: int() - return the integer portion of a value |
Quote:
With that said..any chance of adding any more event trigger functions? :D |
Quote:
|
Quote:
|
Quote:
PS: As you discussed with drago: OnAutoAttack ;) |
Quote:
OnPrimaryAA OnSecondaryAA OnRangedAA but this could be DD element and not an event off a object IMO but either works. |
All times are GMT -5. The time now is 02:40 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI