[SCRIPT] FyreByrd's Share Trading Index (FTSI) v1.0B

The place to discuss scripting and game modifications for X³: Reunion.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply

What do you think of this script

Great
4
44%
Ok - but needs some work
4
44%
Rubbish
1
11%
 
Total votes: 9

User avatar
FyreByrd
Posts: 185
Joined: Thu, 9. Jun 05, 03:50
x3tc

[SCRIPT] FyreByrd's Share Trading Index (FTSI) v1.0B

Post by FyreByrd » Sun, 3. Sep 06, 16:13

SCRIPTID = FyrePackA1
NAME: FyreByrd's Share Trading Index (FTSI)
VERSION: 1.0 BETA
LANGUAGES: English
COMPATABLE WITH: Vanilla x3/XFP Mod
LANGUAGE FILE: 447889
COMMANDS USED: 847, 848, 849 (General tab)


THIS IS A BETA VERSION IT HAS BEEN TESTED THOUROUGHLY ON TWO DIFFERENT MACHINES BUT THERE MAY STILL BE SOME ISSUES.

YOU NEED CYCROWS SCRIPT MANAGER and EMP FOR THIS SCRIPT TO WORK

DETAILS

-This script is a dynamic stockmarket for the X-verse enabling trading in the shares of a number of different companies, just like the FTSE100 (or Nasdaq or equivilant)

INSTALLATION
Choose either the XFP or vanilla X3 version of the script (the only difference is that the XFP version uses sectors only found in XFP) then using Cycrow's Script manager install the script.

HOW TO USE

-You must have the trading system extension installed on your ship once this is installed three new commands will appear in your "General" menu of the command console: Access FTSI, Buy Shares, Sell Shares

-ACCESS FTSI: this comand sends you an immediate message, which asks you which service you desire, there are two services: View Stockmarket and View Portfolio. The "View Stockmarket" option sends you a message with the details of all the current companies available, and the current price of a share. WARNING: this option will sometimes take between 1-2minutes for the message to appear because of the math involved...please be patient (or just use seta!) The "View Portfolio" option, deals with the shares you own, when selected it will send a message to you with all the companies listed, and the number of shares you own of each company also listed.

-BUY SHARES: this command allows you to purchase shares. When selected it will ask you to input the ID of ths company you wish to buy into (The three letter id is displayed on both the "View Portfolio" and "View Stockmarket" options above) type in the ID making sure it's all in CAPITAL LETTERS and is accurate. The command will then ask you to type in the amount of shares you wish to buy (Remember if you buy 10 shares at 100 credits a share you will be charged 1000 credits!) once done shortly afterwards you will recieve a message confirming your purchase.

-SELL SHARES: this command allows you to sell your shares. Like the buy shares command the sell shares command will ask you for the ID of the company and the number of shares you wish to sell. (YOu cannot sell more shares than you own!) shortly after entering these details you will recieve a confirmation message and the money will be added to your account.

THE STOCKMARKET

Each company on the market is assigned a home sector, the following is a description of all the factors that effect the share price:

-Sector Economy: number of stations/complexes, amount of wares available, price of wares
-Security of Sector: Kha'ak presence, Xenon presence, Pirate Presence.

For example, the more stations in a sector=the more wares being sold. The more wares being sold will drive up the price of the share. For instance if a sector has three stations (i.e. three wares being sold) and the stations are all full. The share price will be higher than if the stations were all empty.

If there is an enemy presence in the sector the share price drops drastically, as the company is in serious danger

HINTS AND TIPS

-watch the stockmarket for a while before investing...get to understand how the price fluctuates so you know what is cheap and what is expensive (Remember every sector is different for some 75 credits a share is expensive, for others 400 credits a share is cheap!)

-To drive the price up of a share you own, build stations in that sector - this will make the price of the share rise

-Find sectors that have Kha'ak or Xenon presence, making the companies share cheap...buy in bulk, then clean out the enemy from the sector pushing the share price back up!


COMPANY NAMES
If you would like your company name to be included in the index (instead of one of the crappy ones i made up!) please add it to this thread

KNOWN ISSUES

-Complexes not recognised some of the time
-Slow response for "View Stockmarket" option

~~~~~~~~~~~~~~~~~~~~~#

This is script A1 of FyreByrd's Script Pack A. Script A2 can be found here
Last edited by FyreByrd on Mon, 4. Sep 06, 19:39, edited 1 time in total.

Saint-Ashley
Posts: 1262
Joined: Sat, 3. Dec 05, 04:40
x4

Post by Saint-Ashley » Sun, 3. Sep 06, 17:27

So theirs no current income to be made by owning any shares besides when you sell the shares?

If that is looked into further it would make a nice AL plugin. :wink:

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 20585
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Sun, 3. Sep 06, 19:13

u know, its possible to write both versions in the same script, just get it to detect XFP then use hat version, otherwise use the standard version ;)

i did something simlar for my scripts

russbo
Posts: 855
Joined: Sat, 12. Nov 05, 22:53
x4

Post by russbo » Sun, 3. Sep 06, 20:05

A stock market for X3. Good lord I'm overwhelmed, lol.

Great stuff. Now I'll never leave the house.

User avatar
FyreByrd
Posts: 185
Joined: Thu, 9. Jun 05, 03:50
x3tc

Post by FyreByrd » Sun, 3. Sep 06, 21:07

@Saint-Ashley - i wanted to stick to the stock market principle, putting it in the players hands the power to infulence the market and change the price of the share as much as the x3 economy did so, giving the player money while owning shares doesn't appeal to the principle of the script for me.

@cycrow...I thought i probably could, and is one of the things i'm thinking about for v2...as well as implementing Stone-D's suggestion of being able to float you're company on the market. (This is still only my second major script...i was just glad it worked how i wanted it to at v1.0 stage...it should be much improved at v2.0 hopefully)

Stone-D
Posts: 151
Joined: Wed, 6. Nov 02, 21:31

Post by Stone-D » Mon, 4. Sep 06, 05:27

Another idea to file away, FyreBird!

Calculating the index.

Code: Select all

1) Scan assets and assess base credit rating.
   Stations, vessels excluding navsats.
   0  cr per LT
   1  cr per m3/m4/m5
   3  cr per ts/tp
   5  cr per tl/m6
   7  cr per m2
   10 cr per m1
   20 cr per resource fab (EC, Ore, sunflower etc) + 5 per size level
   30 cr per product fab (shield, weapons, etc) + 5 per size level
   40 cr per retailer (EQ dock, shipyard) x (percentage of all stock items with at least one in stock)
   60 cr per wholesale (trading station) x (percentage of all stock items with at least one in stock x 2)

2) Breakdown of assets.
   Station type (resource, End User product, retailer, wholesale)
   Ship types

3) Security assessment.
   Security level of sectors with fixed assets, eg stations.
   Enemy presence vs System Defence. Company's defence forces outweigh sector/government defence.
   Weigh the assessment by determining percentage of company assets within that sector.
   M-level is the calculating factor. (M1=10, M2=12, M3=3, M4=2, M5=1, M6=6, LT = 1)

4) Infrastructure assessment.
   Navsat deployment - core systems, border systems with resource fabs. Ignore sats in company-useless sectors.
   Natsat overall coverage, percentage of universe.

5) Calculate final stock price.


So, taking this imaginary company, in one sector :

3x  resource fab : 60
1x  product fab  : 30
1x  M6           : 10
2x  TS           : 6
1x  TP           : 3
2x  M3           : 2
4x  M4           : 4
4x  M5           : 4
Total            : 119

Sector presence depends on whether or not you have a fab there. 

Company Security : 1 m6 (6) + 2 m3 (6) + 4 m4 (8) + 4 m5 (4) = 24
Threat Level     : 1 khaak cluster (8, it represents many but is inactive) + 3 pirate harriers (3) + 2 pirate novas (6) + 3 pirate falcons (9) = 26
Sector Security  : Say, non, can't be bothered but its the same method but the result is halved as it isn't dedicated to your assets.
Final security   : Sector defence + Self defence / Threat level :: 24/26 = 0.92
Sector Presence  : 1
Security Level   : (Total of Final Security for all company sectors) / Num Sectors = 92%  (eg, average)

Company only has assets in one sector, so we'll ignore infrastructure.

Stock Price      : Credit rating * Security Level = 119 * 0.92 = 109.48 = 109 cr
--
Look, no SIG!

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 20585
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Mon, 4. Sep 06, 05:45

yyou want to use the plugin.xfp.isInstalled script which is include in the core of the XFP mod, this is used to detect if the mod is running or not in the current game

User avatar
FyreByrd
Posts: 185
Joined: Thu, 9. Jun 05, 03:50
x3tc

Post by FyreByrd » Mon, 4. Sep 06, 12:38

@Stone-D - man the idea's just keep coming don't they!! Cheers dude, will certainly be looking once i get to v2.0 to include the ability for the player to float his company on the market..and depending how i can manage it some of your other ideas may find there way in too!

@Cycrow - cheers i thought there would be something similar but the cursory look i took while writing the script didn't turn anything up.


FUTURE PLANS

V1.1
- fix complex issues (i.e make sure that all products are taken into account in a complex...not just the first!) also check and possibly fix equipment dock/shipyard issues
-Try to speed the thing up....may limit the number of companies back down to 20 rather than 35...during testing i started off with only 5 companies...which made it a whole lot quicker...I obviously have to find a good middle ground
-Implement XFP check, and switch to one install.

V2.0
-Add ability to float player company on stock market...and add dividend system when AI 'buys' into player company shares
-Adjust enemy checking routines to allow a comparison between enemy forces and sector security
-add player property modifiers to the GetPrice rouitnes

Hopefully this should all be done this week....(hopefully but not sure how likely!) plus if i can finsih off the last couple of bits the second scriot of FyreScriptPack A will be released: Lord FyreByrd's Foes (LFBF) a combat/money earning/ship stealing/rep gaining script!

Cheers

FyreByrd

Stone-D
Posts: 151
Joined: Wed, 6. Nov 02, 21:31

Post by Stone-D » Mon, 4. Sep 06, 17:16

Hehe, just trying to save your brain computation time mate!
FyreByrd wrote: V1.1
- fix complex issues (i.e make sure that all products are taken into account in a complex...not just the first!)
Remember... do the shareholders know *everything*? What about that mysterious shack in the nevada desert? :)

You can expand on that later... much later... by 'missing out' bases that lie way outside the regular traffic lanes until, say, a customs patrol swoops by...
FyreByrd wrote: Lord FyreByrd's Foes (LFBF) a combat/money earning/ship stealing/rep gaining script!
Ooooh, that sounds tasty. :D
--
Look, no SIG!

User avatar
FyreByrd
Posts: 185
Joined: Thu, 9. Jun 05, 03:50
x3tc

Post by FyreByrd » Mon, 4. Sep 06, 19:48

mysterious shack in nevade desert????

I have now completed Lord FyreByrd's Foes v1.0 and released on forums...will for a couple of days (unless unforeseen circs obviously!) be working on v1.1 and v2 of FSTI

Cheers

FyreByrd

Stone-D
Posts: 151
Joined: Wed, 6. Nov 02, 21:31

Post by Stone-D » Tue, 5. Sep 06, 17:16

Hehehe, sorry about that. It was a lame reference to all those scifi movies where you have some barn in the middle of nowhere with an elevator inside leading down to some cavernous black-ops installation.

Ie, secrets! :D
--
Look, no SIG!

russbo
Posts: 855
Joined: Sat, 12. Nov 05, 22:53
x4

Post by russbo » Thu, 7. Sep 06, 01:26

Mysterious shacks in the nevada desert usually don't have elevators inside them.

They're usually full of women.

OH, say no more. I've lived in Vegas far too long.

Looking forward to the next iteration of this stock market thing. Awesome undertaking Freebyrd. Wish you luck with it.

User avatar
FyreByrd
Posts: 185
Joined: Thu, 9. Jun 05, 03:50
x3tc

Post by FyreByrd » Thu, 7. Sep 06, 13:46

UPDATE:

My girlfriend is now here for the week(i've sneaked away to get on the internet for five mins don't tell her!) so there will be no movement on v1.1 as yet...however i can tell you that 1.1 will now be just one download that can detect if fusion is running or not (Saving hassle with two downloads!) and the number of companies on the stockmarket will decrease to 20 simply because of speed issues. I'm hopeful that by friday next (not tomorrow!) i should have something for you guys

Cheers

FyreByrd

Mailo
Posts: 696
Joined: Wed, 5. May 04, 01:10
x3

Post by Mailo » Fri, 29. Jun 07, 20:09

Does anyone still have this script? The download links in the original post are unfortunately dead :(

Post Reply

Return to “X³: Reunion - Scripts and Modding”