/////////////////////////////// /// stdArguments.zh - v6.9.9 // /////////////////////////////// /// EXPLANATION ///////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // stdArguments.zh allows you to use portions of a value that you enter into the ZQ script argument values fields // // and save any unused portion of that value to use for other assigns. That is, if you enter a D0 value of 12345.6789 // // normally that is the exact value passed to whatever assign you use for D0. Often, you either do not need a value that // // has a floating point (decimal places), or you do not need all nine digits available, or in some cases, you need a value // // in excess of 32,768.0000, which is the largest value you can normally enter into these fields (due to how ZC converts // // floats into ints. // // What this header does is to allow you to specify the exact digits of an argument that you are using for that assign // // such as using the lowest five digits of the value 12345.6789 (5.6789) and turn that into an integer of 56,789. You can // // use a minimum of a single digit out of any argument, to all nine digits, all as integer values. A good example is using // // the value 12345.6789 to pass as THREE VALUES of 123, 456, and 789. That means that you do not need to hard-code values // // in your scripts, and that you have a very wide range of possible uses. // // You can set up a single argument to use four digits for one value, two for another and a three digit value for arguments. // // A value of 12345.6789 could become four values of (1234), (56), and (789). Alternatively, you could have four two-digit values // // and a single one-digit value, such as converting 12345.6789 into the following values (1), (23), (45), (67), and (89). // // The header contains commands for using each of the nine digits as single values, two methods for using two-digit values // // using the thousands place as the highest portion of a value (e.g. 12345.6789 uses (23) or using the ten-thousands place of a // // value (e.g. 12345.6789 becomes (12). You can combine any of these commands as long as your total value does not exceed nine-digits // // or, if you are very clever, anbd your values overlap, technically squeeze even more out of it. // // For example, if you need the following values (1), (12), (250), (5026), (2250), (265), and (50), (503), (25), and (3) you can enter // // the value 12501.6503, and use the commands to extract the vital areas. This is only useful if you are certain of the values ahead // // of time, but is in theory, possible. The value 12501.6503 would be processed in the following ways, with the sections in parentheses // // as individual values: (1)2502.6503, (12)502.6503, 1(250)2.6503, 12(502.6)503, 1250(2.65)03, 12502.6(50)3, 12502.6(503) and 12502.650(3). // // While this has academic possibilities, in reality you will want to be able to have entirely flexible assigns, to enter any values as // // you need for more generic scripts. You can set up these values in advance, to make sets of values such as (xxx)(xxx)(xxx) for three values // // of three-digits, or as (xx)(xx)(xx)(xxx) fr three values of two-digits, plus one value of three-digits, or as (x)(xx)(xx)(xx)(xx) for // // four two-digit values and a single one-digit value. // // It is important to keep in mind that the largest value that you cna pass in the editor is 32,768.0000, which means that whatever // // value you assign to the highest position (using the ten-thousands-place) should retain a capped range of 0-2, ensuring that all of your // // other value sets have a maximum of (9), (99), (999), (9,999), (99,999), (999,999), (9,999,999), and (99,999,999). // // Therefore, it is wise to plan ahead. If any value needs a range of 000-299, 00-29, or 0-2, then you should assign it to the highest // // decimal places, using the ten-thousands digits. If you are very careful, you can ensure that you can have a tens-thousands value range of 0-3, // // however this caps your thousands/hundreds/tens value at (275), assuming you want to maximise your decimal places, as a value of 32,759.9999 // // can be rendered. // // Prudence of keeping any value using the ten-thoudands place at a maximum of '2' ensures that all of your other values max out. You can // // tinker with the numbers as you see fit, as long as you keep this limitation in mind. // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Commands: int GetRemainderAsInt(value); GetDigit(value,place); -- Use this to extract a single digit at 'place' from any value. This function breaks up each digit of an argument value into a single, usable value. This means that you can use nine values from one argument... As an example, if you have D0 set to 12345.6789, you can break up each digit of this argument value and individually set the values for '1', '2', '3', '4', '5', '6', '7', '8', and '9' as values in an assign. An example sctipt using this is below in 'Example Scripts' To create the assigns, you must first set the D# value that you wish to use to an assign (e.g. 'switches') and then set assigns for each of the GetDigit values. GetPartialArg(argument, place, number); -- This extracts values from an argument by selecting the highest place value and the number of gdigits below that to extract; arg is the original argument, place is the highest place (between 4 and -4); 'number'is the number of digits Examples: 765 from 00765.0000 would be place = 2 and number = 3 2345 from 00002.3450 would be place = 0 and num = 4 item script GetDigitScript{ void run(int switches){ int switch0 = GetDigit(switches, 4); int switch1 = GetDigit(switches, 3); int switch2 = GetDigit(switches, 2); int switch3 = GetDigit(switches, 1); int switch4 = GetDigit(switches, 0); int switch5 = GetDigit(switches, -1); int switch6 = GetDigit(switches, -2); int switch7 = GetDigit(switches, -3); int switch8 = GetDigit(switches, -4); } } // Switch: Decimal Place: Value Range: // 0 #xxxx.xxxx (Ten-Thousands) 0-to-2 // 1 x#xxx.xxxx (Thousands) 0-to-9 // 2 xx#xx.xxxx (Hundreds) 0-to-9 // 3 xxx#x.xxxx (Tens) 0-to-9 // 4 xxxx#.xxxx (Ones) 0-to-9 // 5 xxxxx.#xxx (Tenths) 0-to-9 // 6 xxxxx.x#xx (Hundredths) 0-to-9 // 7 xxxxx.xx#x (Thousandths) 0-to-9 // 8 xxxxx.xxx# (Ten-Thousandths) 0-to-9 Using this, your D0 argument now has nine places, eight of which can have a value that you can place at 0 through 9, and one with a value of 0-2. using these as individual assigns switch0 through switch8, as if each was its own *individual argument*. Now, you can combine both of these special functions in one script, which allows you to use regular argument assigns or split (high and low) assigns, or digit-based assigns as you require. You can make each D# argument in your script use any of these types of assigns: /////////////////////////// // Get Nine-Digit Values // /////////////////////////// GetValueAsInt(argument); -- Use this to utilise all nine places as an integer: Thus, the value 12345.6789 becomes the value 123,456,789. PLACE (#####.####) //////////////// /// CAUTION //////////////////////////////////////////////////////////////////////// ///The equations for eight-digit, and seven-digit values are at present, broken. /// //////////////////////////////////////////////////////////////////////////////////// //////////////////////////// // Get Eight-Digit Values // //////////////////////////// Get8High(argument); -- This returnd the 8 HIGHEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (12345678). Use this if you do not need a value in excess of 32767999. PLACE (#####.###x) Get8Low(argument); -- This returns the 8 LOWEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123456). Use this if you need a value in excess of 32767999; max 99,999,999. PLACE (x####.####) //////////////////////////// // Get Seven-Digit Values // //////////////////////////// //Need to Redo Equations for this. Get7High(argument); -- This returns the 7 HIGHEST (ten-thousands, thousands, hundreds, ones, tenths, hundredths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (1234567). Use this if you do not need a value in excess of 3276799. PLACE (#####.##xx) Get7Mid(argument); -- This returns the 7 MIDDLE (thousands, hundreds, ones, tenths, hundredths, thousandths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (1234567). Use this if you do not need a value in excess of 3276799. PLACE (x####.###x) Get7Low(argument); -- This returns the 7 LOWEST (thousands, hundreds, ones, tenths, hundredths, ten-thousandths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123456). Use this if you need a value in excess of 3276799. PLACE (xx###.####) ////////////////////////// // Get Six-Digit Values // ////////////////////////// GetValue6High(argument); -- This returns the 6 HIGHEST (ten-thousands, thousands, hundreds, tens, ones, tenths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123456). Use this if you do not need a value in excess of 327679. // PLACE (#####.#xxx) GetValue6Low(argument); -- This returns the 6 LOWEST (tens, ones, tenths, hundredths, thousandths, ten-thousandths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456789). Use this if you need a value in excess of 327679; max 999,999. // PLACE (xxx##.####) //////////////////////////////// // Get Six-Digit Alternatives // //////////////////////////////// GetValue6Mid876543(argument); -- This returns the 6 MIDDLE (thousands, hundreds, tens, ones, tenths, hundredths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123456). Use this if you do not need a value in excess of 327679. `// PLACE (x####.##xx) GetValue6Mid234567(argument); -- This returns the 6 MIDDLE (thousands, hundreds, tens, ones, tenths, hundredths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123456). Use this if you do not need a value in excess of 327679. // PLACE (x####.##xx) GetValue6Mid765432(argument); -- This returns the 6 MIDDLE (hundreds, tens, ones, tenths, hundredths, thousandths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123456). Use this if you do not need a value in excess of 327679. // PLACE (xx###.###x) GetValue6Mid345678(argument); -- This returns the 6 MIDDLE (hundreds, tens, ones, tenths, hundredths, thousandths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123456). Use this if you do not need a value in excess of 327679. // PLACE (xx###.###x) GetValue6Low654321(argument); -- This returns the 6 LOWEST (tens, ones, tenths, hundredths, thousandths, ten-thousandths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456789). Use this if you need a value in excess of 327679; max 999,999. // PLACE (xxx##.####) /////////////////////////// // Get Five-Digit Values // /////////////////////////// GetValue5High(argument); -- This returns the 5 HIGHEST decimal places (ten-thousands, thousands, hundreds, tens, ones) and turns it into an individual value. Thus, 12345.6789 becomes a value of (12345). Use this if you do not need a value in excess of 32767. // PLACE (#####.xxxx) GetValue5Low(argument); -- This returns the 5 LOWEST decimal places (ones, tenths, hundredths, thousandths, ten-thousandths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (56789). Use this if you do need a value in excess of 32767; max 99,999. // PLACE (xxxx#.####) ///////////////////////////////// // Get Five-Digit Alternatives // ///////////////////////////////// GetValue5High98765(argument); -- This returns the 5 HIGHEST decimal places (ten-thousands, thousands, hundreds, tens, ones) and turns it into an individual value. Thus, 12345.6789 becomes a value of (12345). Use this if you do not need a value in excess of 32767. // PLACE (#####.xxxx) GetValue5Mid87654(argument); -- This returns the 5 MIDDLE (thousands, hundreds, tens, ones, tenths) decimal places and turns it into an individual value. // PLACE (x####.#xxx) GetValue5Mid23456(argument); -- This returns the 5 MIDDLE (thousands, hundreds, tens, ones, tenths) decimal places and turns it into an individual value. // PLACE (x####.#xxx) GetValue5Mid76543(argument); -- This returns the 5 MIDDLE (hundreds, tens, ones, tenths, hundredths) decimal places and turns it into an individual value. // PLACE (xx###.##xx) GetValue5Mid34567(argument); -- This returns the 5 MIDDLE (hundreds, tens, ones, tenths, hundredths) decimal places and turns it into an individual value. // PLACE (xx###.##xx) GetValue5Mid65432(argument); -- This returns the 5 MIDDLE (tens, ones, tenths, hundredths, thousandths) decimal places and turns it into an individual value. // PLACE (xxx##.###x) GetValue5Mid45678(argument); -- This returns the 5 MIDDLE (tens, ones, tenths, hundredths, thousandths) decimal places and turns it into an individual value. // PLACE (xxx##.###x) GetValue5Low54321(argument); -- This returns the 5 LOWEST decimal places (ones, tenths, hundredths, thousandths, ten-thousandths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (56789). Use this if you do need a value in excess of 32767; max 99,999. // PLACE (xxxx#.####) /////////////////////////// // Get Four-Digit Values // /////////////////////////// GetValue4High(argument); -- This returns the 4 HIGHEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (1234). Use this if you do not need a value in excess of 3275. // PLACE (####x.xxxx) GetValue4Low(argument); -- This returns the 4 LOWEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (6789). Use this if you need a value in excess of 3275; max 9,999. // PLACE (xxxxx.####) ///////////////////////////////// // Get Four-Digit Alternatives // ///////////////////////////////// GetValue4High9876(argument); -- This returns the 4 HIGHEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (1234). Use this if you do not need a value in excess of 3275. // PLACE (####x.xxxx) GetValue4Mid8765(argument); // PLACE (x####.xxxx) GetValue4Mid6789(argument); // PLACE (x####.xxxx) GetValue4Mid7654(argument); // PLACE (xx###.#xxx) GetValue4Mid4567(argument); // PLACE (xx###.#xxx) GetValue4Mid6543(argument); // PLACE (xxx##.##xx) GetValue4Mid3456(argument); // PLACE (xxx##.##xx) GetValue4Mid5432(argument); // PLACE (xxxx#.###x) GetValue4Mid2345(argument); // PLACE (xxxx#.###x) GetValue4Low1234(argument); -- This returns the 4 LOWEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (6789). Use this if you need a value in excess of 3275; max 9,999. // PLACE (xxxxx.####) iGetValue4Low4321(argument); -- This returns the 4 LOWEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (6789). Use this if you need a value in excess of 3275; max 9,999. // PLACE (xxxxx.####) //////////////////////////// // Get Three-Digit Values // //////////////////////////// GetValue3High(argument); -- This returns the 3 HIGHEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123). Use this if you need a value in excess of 326. // PLACE (###xx.xxxx) GetValue3Mid(argument); -- This returns the 3 MIDDLE decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xxx##.#xxx) GetValue3Low(argument); -- This returns the 3 LOWEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (789); max 999. // PLACE (xxxxx.x###) ////////////////////////////////// // Get Three-Digit Alternatives // ////////////////////////////////// GetValue3Upper987(argument); -- This returns the 3 HIGHEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123). Use this if you need a value in excess of 326. // PLACE (###xx.xxxx) GetValue3Upper123(argument); -- This returns the 3 HIGHEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (123). Use this if you need a value in excess of 326. // PLACE (###xx.xxxx) GetValue3Upper876(argument) -- This returns 3 MIDDLE decimal (thousands, hundreds, tens) places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (x###x.xxxx) GetValue3Upper234(argument) -- This returns 3 MIDDLE decimal (thousands, hundreds, tens) places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (x###x.xxxx) GetValue3Upper765(argument) -- This returns 3 MIDDLE decimal (thousands, hundreds, tens) places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xx###.xxxx) GetValue3Upper345(argument) -- This returns 3 MIDDLE decimal (thousands, hundreds, tens) places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xx###.xxxx) GetValue3Mid654(argument); -- This returns the 3 MIDDLE decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xxx##.#xxx) GetValue3Mid456(argument); -- This returns the 3 MIDDLE decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xxx##.#xxx) GetValue3Lower543(argument) -- This returns 3 MIDDLE decimal (tens, tenths, hundredths) places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xxxx#.##xx) GetValue3Lower567(argument) --- This returns 3 MIDDLE decimal (tens, tenths, hundredths) places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xxxx#.##xx) GetValue3Lower432(argument) -- This returns 3 MIDDLE decimal (tenths, hundredths, thousandths) places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xxxxx.###x) GetValue3Lower678(argument) -- This returns 3 MIDDLE decimal (tenths, hundredths, thousandths) places and turns it into an individual value. Thus, 12345.6789 becomes a value of (456); max 999. // PLACE (xxxxx.###x) GetValue3Lower321(argument); {return arg - (arg >> 0) + ( GetDigit(arg, -4) + (GetDigit(arg, -3) * 10) + (GetDigit(arg, -2) * 100 ) );} //This returns the 3 LOWEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (789); max 999. // PLACE (xxxxx.x###) GetValue3Lower123(argument); -- This returns the 3 LOWEST decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (789); max 999. // PLACE (xxxxx.x###) ////////////////////////// // Get Two-Digit Values // ////////////////////////// GetValue2High(argument); -- This returns the decimal places (ten-thousands, thousands) and turns it into an individual value. Thus, 12345.6789 becomes a value of (12). // PLACE (##xxx.xxxx) GetValue2Low(argument); -- This returns the decimal places (thousandths, ten-thousandths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (89). // PLACE (xxxx.xx##) //////////////////////////////// // Get Two-Digit Alternatives // //////////////////////////////// /////////////////////////////////////////////////////////////////////////// // The following GetValue commands *DO NOT* use the ten-thousands place. // /////////////////////////////////////////////////////////////////////////// GetValue278(argument); -- This returns the decimal places (thousands, hundreds) and turns it into an individual value. Thus, 12345.6789 becomes a value of (23). // PLACE (x##xx.xxxx) GetValue223(argument); -- This returns the decimal places (thousands, hundreds) and turns it into an individual value. Thus, 12345.6789 becomes a value of (23). // PLACE (x##xx.xxxx) GetValue287(argument); -- This returns the decimal places (thousands, hundreds) and turns it into an individual value. Thus, 12345.6789 becomes a value of (23). // PLACE (x##xx.xxxx) GetValue265(argument); -- This returns the decimal places (tens, ones) and turns it into an individual value. Thus, 12345.6789 becomes a value of (45). // PLACE (xxx##.xxxx) GetValue245(argument); -- This returns the decimal places (tens, ones) and turns it into an individual value. Thus, 12345.6789 becomes a value of (45). // PLACE (xxx##.xxxx) GetValue243(argument); -- This returns the decimal places (tenths, hundredths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (67). // PLACE (xxxxx.##xx) GetValue267(argument); -- This returns the decimal places (tenths, hundredths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (67). // PLACE (xxxxx.##xx) GetValue221(argument); -- This returns the decimal places (thousandths, ten-thousandths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (89). // PLACE (xxxx.xx##) GetValue212(argument); -- This returns the decimal places (thousandths, ten-thousandths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (89). // PLACE (xxxx.xx##) /////////////////////////////////////////////////////////////////////// // The following GetValue commands *DO* use the ten-thousands place. // /////////////////////////////////////////////////////////////////////// GetValue2_98(argument); -- This returns the decimal places (ten-thousands, thousands) and turns it into an individual value. Thus, 12345.6789 becomes a value of (12). // PLACE (##xxx.xxxx) GetValue2_12(argument); -- This returns the decimal places (ten-thousands, thousands) and turns it into an individual value. Thus, 12345.6789 becomes a value of (12). // PLACE (##xxx.xxxx) GetValue2_76(argument); -- This returns the decimal places (hundreds, tens) and turns it into an individual value. Thus, 12345.6789 becomes a value of (34). // PLACE (xx##x.xxxx) GetValue2_34(argument); -- This returns the decimal places (hundreds, tens) and turns it into an individual value. Thus, 12345.6789 becomes a value of (34). // PLACE (xx##x.xxxx) GetValue2_45(argument); -- This returns the decimal places (tenths, hundredths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (56). // PLACE (xxx##.xxxx) GetValue2_54(argument); -- This returns the decimal places (tenths, hundredths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (56). // PLACE (xxxx#.#xxx) GetValue2_56(argument); -- This returns the decimal places (tenths, hundredths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (56). // PLACE (xxxx#.#xxx) GetValue2_32(argument); -- This returns the decimal places (thousandths, ten-thousandths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (78). // PLACE (xxxxx.x##x) GetValue2_23(argument); -- This returns the decimal places (thousandths, ten-thousandths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (78). // PLACE (xxxxx.x##x) GetValue2Low(argument); -- This returns the decimal places (thousandths, ten-thousandths) and turns it into an individual value. Thus, 12345.6789 becomes a value of (89). // PLACE (xxxx.xx##) ////////////////////////// // Get One-Digit Values // ////////////////////////// // int switch0 = GetDigit(switches, 4); // int switch1 = GetDigit(switches, 3); // int switch2 = GetDigit(switches, 2); // int switch3 = GetDigit(switches, 1); // int switch4 = GetDigit(switches, 0); // int switch5 = GetDigit(switches, -1); // int switch6 = GetDigit(switches, -2); // int switch7 = GetDigit(switches, -3); // int switch8 = GetDigit(switches, -4); GetValue1Highest(argument); -- This returns the single valuee of the ten-thousands (#xxxx.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (1). // PLACE (#xxxx.xxxx) GetValueSingle1(argument); -- This returns the single valuee of the ten-thousands decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (1). // PLACE (#xxxx.xxxx) GetValue9(argument); -- This returns the single valuee of the ten-thousands decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (1). // PLACE (#xxxx.xxxx) GetValueSingle2(argument); -- This returns the single valuee of the thousands (x#xxx.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (2). // PLACE (x#xxx.xxxx) GetValue8(argument); -- This returns the single valuee of the thousands (x#xxx.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (2). // PLACE (x#xxx.xxxx) GetValueSingle3(argument); -- This returns the single valuee of the hundreds (xx#xx.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (3). // PLACE (xx#xx.xxxx) GetValue7(argument); -- /This returns the single valuee of the hundreds (xx#xx.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (3). // PLACE (xx#xx.xxxx) GetValueSingle4(argument); -- This returns the single valuee of the tens (xxx#x.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (4). // PLACE (xxx#x.xxxx) GetValue6(argument); -- This returns the single valuee of the tens (xxx#x.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (4). // PLACE (xxx#x.xxxx) GetValueSingle5(argument); -- This returns the single valuee of the ones (xxxx#.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (5). // PLACE (xxxx#.xxxx) GetValue5(argument); -- This returns the single valuee of the ones (xxxx#.xxxx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (5). // PLACE (xxxx#.xxxx) GetValueSingle6(argument); -- This returns the single valuee of the tenths (xxxxx.x#xx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (6). // PLACE (xxxxx.#xxx) GetValue4(argument); -- This returns the single valuee of the tenths (xxxxx.x#xx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (6). // PLACE (xxxxx.#xxx) GetValueSingle7(argument); -- This returns the single valuee of the hundredths (xxxxx.x#xx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (7). // PLACE (xxxxx.x#xx) GetValue3(argument); This returns the single valuee of the hundredths (xxxxx.x#xx) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (7). // PLACE (xxxxx.x#xx) GetValueSingle8(argument); -- This returns the single valuee of the thousandths (xxxxx.xx#x) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (8). // PLACE (xxxxx.xx#x) GetValue2(argument); -- This returns the single valuee of the thousandths (xxxxx.xx#x) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (8). // PLACE (xxxxx.xx#x) GetValueSingle9(argument); -- This returns the single valuee of the ten-thousandths (xxxxx.xxx#) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (9). // PLACE (xxxxx.xxx#) GetValue1(argument); -- This returns the single valuee of the ten-thousandths (xxxxx.xxx#) decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (9). // PLACE (xxxxx.xxx#) GetValueLowest(argument); This returns the single valuee of the ten-thousandths decimal place and turns it into an individual value. Thus, 12345.6789 becomes a value of (9). // PLACE (xxxxx.xxx#) ///////////////////// // LEGACY COMMANDS // ///////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // These functions are essentially outmoded by the commands above, but are included for legacy support to anyone // // that has elected to use this header up to this point. You may wish to check your scripts to ensure that all the // // functions of your scripts still work, and update any that do not, as I have also corrected a couple bugs in the // // old functions that kept them from working exactly as intended. // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// GetHighArgument(argument); GetLowArgument(argument); GetFiveAndFourBig(argument); GetFiveAndFourSmall(argument); // Similarly, you can use this function to use the lowest five digits of an argument as an integer, while reserving the higest gour digits (ones, hundreds thousands and ten-thousands // as a secondary argument. The maximum value of the five-digit argument // (1) is 99,999, with a maximum value of the four-digit argment is 3199 or; // (2) a maximum five-digit argument of 80,000 and a four-digit maximum value of 80,000 and a dour-digit value up to 3,276. // An exaple value is 30149.6829, which is broken into tw srguments (3014) and (9829). // This is similar to GetHighArgument and GetLowArgument, except that the maximum value of the give-digit // argument is now 99,999 instead of 31999. int GetLowTriArgument(argument); int GetMidTriArgument(argument); int GetHighTriArgument(argument); // These functions allow you to use the integer and decimal portions of an argument as two separate arguments. // For example, if you have D0 as 0010.0023, you can split it into two arguments with the values '10' and '23' respectively. // An example of using this is appended below: int GetFiveAndThreeBig(argument); {return arg - (arg >> 0) + ( GetDigit(arg, -1) + (GetDigit(arg, 0) * 10) + (GetDigit(arg, 1) * 100 ) + (GetDigit(arg, 2) * 1000 ) + (GetDigit(arg, 3) * 10000 ) );} int GetFiveAndThreeSmall(argument); {return arg - (arg >> 0) + ( GetDigit(arg, -4) + (GetDigit(arg, -3) * 10) + (GetDigit(arg, -2) * 100) );} // This works as getFiveAndFourBig & GetFiveAndFourSmall, except that it uses all three values of the small argument (ten-thousands, thousands, and hundreds // changing the range to a five-digit argument of 99,999, a three-digit of either 999 (with the ten-thousands place reserved for getDigit with a value of 0-2 // or 80,000 for the five-digit segment, 276 for the three-digit value, with the ten-thousands digit ranging from 0-3. // For example, the value 31,999.9999 becomes the values (GetFiveAndDThreeBig) of 99,999 and the value of GetFiveAndDThreeSmall // capped at 999 (if you want to use the ten-thousands place with a range of 0-2, or a value of GetFiveAndDThreeSmall from 000-768, and // the tens-thousands place with a range of 0-3. int GetFiveAndDuoTwoFive(argument); {return arg - (arg >> 0) + ( GetDigit(arg, -4) + (GetDigit(arg, -3) * 10) + (GetDigit(arg, -2) * 100 ) + (GetDigit(arg, -1) * 1000 ) + (GetDigit(arg, 0) * 10000 ) );} int GetFiveAndDuoTwoTwoLow(argument); {return arg - (arg >> 0) + ( GetDigit(arg, 1) + (GetDigit(arg, 2) * 10) );} int GetFiveAndDuoTwoTwoHigh(argument); {return arg - (arg >> 0) + ( GetDigit(arg, 3) + (GetDigit(arg, 4) * 10) );} // This splits the value into a give-digit big value, and two dual-digit small values. // The five-digit value remains 99,999, but the two dual-digit arguments can be set to either // (1) GetFiveAndDuoTwoLow as a maximum of 99 and GetFiveAndDuoTwoHigh with a maximum of 31 or; // (2) The five-digit argument capped at 80,000, GetFiveAndDuoTwoLow at a maximum of 76 and GetFiveAndDuoTwoHigh with // a maximum of 32. int GetSixAndTwoBig(argument); {return arg - (arg >> 0) + ( GetDigit(arg, -4) + (GetDigit(arg, -3) * 10) + (GetDigit(arg, -2) * 100 ) + (GetDigit(arg, -1) * 1000 ) + (GetDigit(arg, 0) * 10000 ) + (GetDigit(arg, 1) * 100000 ) );} int GetSixAndTwoSmall(argument); {return arg - (arg >> 0) + ( GetDigit(arg, 2) + (GetDigit(arg, 3) * 10) );} // This splits the argument into a six-digit value, and a two-digit value, leaving the ten-thousands place reserved // for GetDigit. Them aximum values are: GetSixAndTwoBig at 999,999, GetSixAndTwoSmall at 99 and the ten-thousands place // for GetDigit with a range of 0-2. // Else, GetSixAndTwoBig at 680,000, GetSixAndTwoSmall at 27 and the tens-thousands place for GetDigit with a range of 0-3. int GetSixAndThreeBig(argument); {return arg - (arg >> 0) + ( GetDigit(arg, -4) + (GetDigit(arg, -3) * 10) + (GetDigit(arg, -2) * 100 ) + (GetDigit(arg, -1) * 1000 ) + (GetDigit(arg, 0) * 10000 ) + (GetDigit(arg, 1) * 100000 ) );} int GetSixAndThreeSmall(argument); {return arg - (arg >> 0) + ( GetDigit(arg, 2) + (GetDigit(arg, 3) * 10) + (GetDigit(arg, 4) * 100) );} // This splits the argument into a six-digit value, and a three-digit value... // Them aximum values are: GetSixAndTwoBig at 999,999, GetSixAndTwoSmall at 326 or; // Else, GetSixAndThreeSmall at 680,000, GetSixAndThreeBig at 327. int GetSevenAndOneBig(argument); {return arg - ( ( (arg >> 0) * 10000 ) - ( GetDigit(arg, 2) * 10000 ) - ( GetDigit(arg, 1) * 10000 ) );} int GetSevenAndOneSmall(argument); {return arg - (arg >> 0) + ( GetDigit(arg, 0) );} //This returns the 7 HIGHEST (ten-thousands, thousands, hundreds, ones, tenths, hundredths) decimal places and turns it into an individual value. Thus, 12345.6789 becomes a value of (1234567). Use this if you do not need a value in excess of 3276799. // PLACE (xx###.####) and the value of the thousands place as separate values. // This splits the argument into one seven-digit value, and a one-digit value, leaving the ten-thousands place reserved // for GetDigit. Them maximum values are: GetSevenAndOneBig at 9,999,999, GetSevenAndOneSmall at 9 and the ten-thousands place // for GetDigit with a range of 0-2. // Else, GetSixAndTwoBig at 7,680,000, GetSixAndTwoSmall at 0-2 and the tens-thousands place for GetDigit with a range of 0-3. //Need to Redo Equations for this. int GetSevenAndOTwoLow(argument); {return arg - ( ( (arg >> 0) * 10000 ) - ( GetDigit(arg, 1) * 10000 ) );} int GetSevenAndTwoHigh(argument); {return arg - (arg >> 0) + ( GetDigit(arg, 3) + (GetDigit(arg, 4) * 10) );} // This splits the argument into one seven-digit value, and a two-digit value. // Them maximum values are: GetSevenAndTwoBig at 9,999,999, GetSevenAndTwoSmall at 36. // Else, GetSevenAndTwoBig at 7,680,000, and GetSevenAndTwoSmall at 0-32. // //item script HighLow{ // void run (int High0_Low0, int High1_Low1, int High2_Low2, int High3_Low3, int High4_Low4, int High5_Low5, int High6_Low6, int High7_Low7) { // argumentument0H = GetHighArgument(High0_Low0); // argumentument0L = GetLowArgument(High0_Low0); // argumentument1H = GetHighArgument(High1_Low1); // argumentument1L = GetLowArgument(High1_Low1); // argumentument2H = GetHighArgument(High2_Low2); // argumentument2L = GetLowArgument(High2_Low2); // argumentument3H = GetHighArgument(High3_Low3); // argumentument3L = GetLowArgument(High3_Low3); // argumentument4H = GetHighArgument(High4_Low4); // argumentument4L = GetLowArgument(High4_Low4); // argumentument5H = GetHighArgument(High5_Low5); // argumentument5L = GetLowArgument(High5_Low5); // argumentument6H = GetHighArgument(High6_Low6); // argumentument6L = GetLowArgument(High6_Low6); // argumentument7H = GetHighArgument(High7_Low7); // argumentument7L = GetLowArgument(High7_Low7); // } // } // // Obviously, you will want to name assigns in a way that allows you to remember what they do! // Merely change both the original assign for the D# argument in your void run() command to something you can rememeber... // Then name the assigns (or sub-assigns) for the high and low halves to something that makes sense for your script. // For example: // //item script SpecialItem{ // void run (int hearts_magic, int colour_duration, int power_speed, int FFCSlot_SpecialCounter, int LType_nouse, int SFX_Weapon_SFX_ERROR, int ItemNumber_SWSprite, int other1_other2) { // int hearts = GetHighArgument(hearts_magic); // int magic = GetLowArgument(hearts_magic); // int colour = GetHighArgument(colour_duration); // int duration = GetLowArgument(colour_duration); // int power = GetHighArgument(power_speed); // int speed = GetLowArgument(power_speed); // int FFCSlot = GetHighArgument(FFCSlot_SpecialCounter); // int itemCounter = GetLowArgument(FFCSlot_SpecialCounter); // int LType = GetHighArgument(LType_nouse); // int nouse = GetLowArgument(LType_nouse); // int SFX_Weapon = GetHighArgument(SFX_Weapon_SFX_ERROR); // int ERROR_SFX = GetLowArgument(SFX_Weapon_SFX_ERROR); // int ItemNumber = GetHighArgument(ItemNumber_SWSprite); // int SWSprite = GetLowArgument(ItemNumber_SWSprite); // int Other1 = GetHighArgument(Other1_Other2); // int Other2 = GetLowArgument(Other1_Other2); // } // } // int GetFirstDuoArgument(argument); {return arg - (arg >> 0) + ( GetDigit(arg, 2) + (GetDigit(arg, 3) * 10) );} int GetSecondDuoArgument(argument); {return arg - (arg >> 0) + ( GetDigit(arg, 0) + (GetDigit(arg, 1) * 10) );} int GetThirdDuoArgument(argument); {return arg - (arg >> 0) + ( GetDigit(arg, -2) + (GetDigit(arg, -1) * 10) );} int GetFourthDuoArgument(argument); {return arg - (arg >> 0) + ( GetDigit(arg, -4) + (GetDigit(arg, -3) * 10) );} // int GetHighTriArgument (max value 255) // int GetHighMidArgument (max value 999) // int GetHighLowArgument (max value 999) // Example Value: 12345.6789 becomes 123 (high), 456 (mid) and 789 (low); (123)(456)(789) -- (123)(45.6)(789). // int GetFirstDuoArgument = (max value 99) // int GetSecondDuoArgument = (max value 99) // int GetThirdDuoArgument = (max value 99) // int GetFourthDuoArgument = (max value 99) // Example Value: 01234.5678 becomes 12 (first), 34 (second), 56 (third), and 78 (fourth). // 0(12)(34)(56)(78) -- 0(12)(34).(56)(78) //////////////////// ///////////////// // Example Values // // Translation // //////////////////// ///////////////////////////////////// // D0: 06400.0001 // // D0: (064)(000)(001) // // D1: 00040.0126 // // D1: (000)(400)(126) // // D2: 00008.9050 // // D2: 0(00)(08)(90)(50) // // D3: 00100.2200 // // D3: 0(01)(00)(22)(00) // // D4: // // D4: // // D5: // // D5: // // D6: // // D6: // // D7: 10000.0000 // // D7: (1)(0)(0)(0)(0)(0)(0)(0)(0) // //////////////////// ///////////////////////////////////// ////////////////////////////// /// CREDITS (ALPHABETICAL) /// ////////////////////////////// /////////////////////////// /// Programming Credits /// /////////////////////////////////////////////////////////////////////// /// Aevin /// /// Alucard (Testing, and function discussion). /// /// blackbishop89 /// /// Gleeok (GetDigit, and other key, base functions.) /// /// grayswandir /// /// jsm116 (GetHighArgument/GetLowArgument base functions.) /// /// MasterManiac /// /// MoscowModder (Too much to list; possible also UseRItem) /// /// Saffith (Function discussion) /// /// SUCCESSOR (GetpartialArg Funtions) /// /// Zecora (Forum discussions, and assistance.) /// /// ZoriaRPG (Functions, testing, and /Library Maintainer.) /// ///////////////////////////////////////////////////////////////////////