[SCRIPT] Ware notoriety checker v1.2 (6/21/07)
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
[SCRIPT] Ware notoriety checker v1.2 (6/21/07)
xfir.notor1.2.rar
***XTM USERS*** (version .7a)
XTM notoriety t file
XTM w/Ashley's factories t file
This returns the minimun notoriety need to buy a ware or the title assosiated with a given notoriety.
usage: call the script passing a ware, it'll return the notoriety needed as a number, or null if it doesn't recognize it.
call the script passing a number and a race, it'll return the title (i.e. "Federal Marshall") as a string, or null if given a race with no titles (like Xenon).
Fully compatible with X3 2.0.02 and EMP 2.01 (not required)
Changes:
1.2 6/21/07 - added ability to check notoriety of ships and stations. uploaded premade XTM t file, minor bug fix in t file builder.
1.1 Fixed a small error with unknown items returning 0 instead of null.
For modders:or mod users.
notoriety t file builder
Just put any modified Tfiles.txt in the same folder as this program and run it. If everything goes well it'll output a new 448382.xml with all the extra's you've added.
Or to do a single file, modify the Tfile.txt you want to extract (see readme to see how) then run it through
Notoriety Extractor
and add the values of the output file into the t file. (see its readme for more detailed instructions.)
Resources used:
t file 8382
page file 8382
***XTM USERS*** (version .7a)
XTM notoriety t file
XTM w/Ashley's factories t file
This returns the minimun notoriety need to buy a ware or the title assosiated with a given notoriety.
usage: call the script passing a ware, it'll return the notoriety needed as a number, or null if it doesn't recognize it.
call the script passing a number and a race, it'll return the title (i.e. "Federal Marshall") as a string, or null if given a race with no titles (like Xenon).
Fully compatible with X3 2.0.02 and EMP 2.01 (not required)
Changes:
1.2 6/21/07 - added ability to check notoriety of ships and stations. uploaded premade XTM t file, minor bug fix in t file builder.
1.1 Fixed a small error with unknown items returning 0 instead of null.
For modders:or mod users.
notoriety t file builder
Just put any modified Tfiles.txt in the same folder as this program and run it. If everything goes well it'll output a new 448382.xml with all the extra's you've added.
Or to do a single file, modify the Tfile.txt you want to extract (see readme to see how) then run it through
Notoriety Extractor
and add the values of the output file into the t file. (see its readme for more detailed instructions.)
Resources used:
t file 8382
page file 8382
Last edited by xfir01 on Thu, 21. Jun 07, 18:17, edited 9 times in total.
Guess I could create yet another post but... this does the same thing.
Well, without the limitations. =)
lib.gz.get.ware.notoriety
This is not just a long list of wares.
There is not a single ware entry in it so it returns the notoriety of all wares, ships, stations... whatever.
It's pure math and scans a range of over 1 million notoriety in 30-40 iterations.
In addition to that it is... fast.
[ external image ] (ZIP)
Well, without the limitations. =)
lib.gz.get.ware.notoriety
- Arg1: Ware
- Arg2: Buyer race or object
Only used as "race" internally.
If you supply any kind of object or sector, the race is extracted from that.
If you supply a race/object for Buyer you also have to supply a value for seller.
If the race/object is Player, the script returns null if the player can not afford 1 unit of Ware at average price.
If you do not supply any values for Buyer or Seller, the default notoriety (as in TWares) is returned. - Arg3: Seller race or object
Basically the same except...
If you supply an existing station, the result is null if the station can not sell this ware or does not have any stock.
Also, if the Buyer race/object is Player, the script returns null if the player can not afford 1 unit of Ware at the current price in this existing station. - Arg4: Mode
String: "allowed" or null
Returns 1
if Buyer race/object is allowed to buy Ware at/from Seller race/object at the current notoriety.
else returns null - RESULT
If the library has to return a notoriety value it never returns a value below -999.
Even though a ware can have such a low value, it's completely pointless because a minimum notoriety of -999 is required to dock anywhere in the game. (Minimum of -9 in core sectors)
This is not just a long list of wares.
There is not a single ware entry in it so it returns the notoriety of all wares, ships, stations... whatever.
It's pure math and scans a range of over 1 million notoriety in 30-40 iterations.
In addition to that it is... fast.
[ external image ] (ZIP)
Code: Select all
@ $Noto = [THIS] -> call script 'lib.gz.get.ware.notoriety' :
Ware=Gamma Photon Pulse Cannon
Buyer race or object=null
Seller race or object=null
Mode=null
...returns 10000
$Ware = get ware from maintype 7 and subtype 5
@ $Noto = [THIS] -> call script 'lib.gz.get.ware.notoriety' : Ware=$Ware
...returns 3333 (=Nova)
$Ware = get ware from maintype 7 and subtype 24
...returns 100 (=Pericles)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 24
- Joined: Fri, 25. Jul 08, 07:25
So basically you buy the ware at the current notoriety. then you change the notoriety with a binary search till you see at what point its no longer possible to buy. then you reset the notoriety, readdd the ware at the station, subtract the ware from the ship and readd the money to your account.
Is it just me or is this a rather unconventional way of doing this? what happens if another script tries to buy something at exactly the same time?
Is it just me or is this a rather unconventional way of doing this? what happens if another script tries to buy something at exactly the same time?