[Script] TC Stock Exchange "The Evolution of a Financial Revolution" v4 Full Release.

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Thu, 17. Jun 10, 15:26

Umm ... what do i say to those responces, except, Thank You.

Yeah, go on, have a laugh, cos i'm stumped for words.

MarCon

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x4

Post by Idea » Thu, 17. Jun 10, 16:33

I can offer to build new stations for every race stock market, bank, company you make so that we could have even more realistic feeling then now if you want too, but this would mean that your work would become a mod which then I need to make compatabile with many others mod because I am sure many people would use this script.

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Thu, 17. Jun 10, 17:20

Idea

Thanks for the offer, and as tempting as it may be, and i mean that, you pointed out yourself the big downfall with it, Mod compatabilty.

Without trying to go into another essay. One of the things i was trying to do was get this to report on the current state of the players universe without adding or removing anything from it.

There are plenty of options out there for the player to pick and choose what mods / scripts they want to run. Then this script would report on how those choices had influenced their universe.

Even the sectors that are conected to an Exchange are dynamic, if you use a sector takeover script and another race takes over a sector or the player takes over the sector, it will be removed from the exchange it was part of, but the rest of the exchange for that area will still work. there has to be 2 sectors side by side removed before the outlying sectors are not seen by the exchange for that area.

Just hope it doesn't effect your shares to much cos that will be taken into consideration due to the effect on the supply and damand figures. Only problem at the moment is if the sector with the exchange station in it is taken over that whole exhange for that area will cease to function. Same as if the exchange station is destroyed, all info will be lost and the exhange for that area will cease to function.

I've kept everything as dynamic as i can to allow the player to still shape the universe how they want and the Stock Exchange still function.

I'm currently working on the 'Detailed Summary of Shares Owned', got it to a point that my CPU is only glowing red when run, instead of letting smoke out as well. :D

I suppose what do i expect, AMD 3000+, Win XP, 1 gig DDR Ram (no not even DDRII) and a GT9400 512 ram GPU. Sweet little script building machine, if it doesn't slow down to much on that, all should be fine.

MarCon

User avatar
SoliDeoGloria
Posts: 61
Joined: Tue, 29. Dec 09, 23:29
x3tc

Post by SoliDeoGloria » Thu, 17. Jun 10, 17:21

Idea wrote:I can offer to build new stations for every race stock market, bank, company you make so that we could have even more realistic feeling then now if you want too, but this would mean that your work would become a mod which then I need to make compatabile with many others mod because I am sure many people would use this script.
I would recommend staying away from the [mod] option as well - I think we can help you make this work without leaving the [script] arena.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 17. Jun 10, 17:31

Bug Report:

Bought 10,000 shares of Firefly Missiles at Argon Prime Exchange:
[ external image ]

But summary shows Omicron Lyrae:
[ external image ]

I used Propmongler (love this utility) to check both Trade Posts for any saved values as I assumed that's were you'd save them. Nothing for Argon Prime but they show up at Omicron Lyrae:
[ external image ]

Local Stock Exchange for Omicron Lyrae:
[ external image ]


LA
Last edited by Logain Abler on Thu, 17. Jun 10, 17:35, edited 1 time in total.

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x4

Post by Idea » Thu, 17. Jun 10, 17:34

Then all I can do to help is testing and ideas :( .

I don't know how to script.I tried severel times but as English isen't my native language it's prety hard to understand script terms and logic(get array from that,varibale that,if that isen't then go to.... :evil: ).I diden't had a teacher for scripting not like for moding(DeadlyDa is my teacher in that area).

Edit:Damn LA found a bug :wink:

Edit:I had Amd 2600+,6600GT 128mb and 1,5 Gb of ram.The procesor is great,I overcloack it to work at level of 3000+ and after a year it fried my motherboard but the processor still kicking in my brother PC(nasty little sucker :wink: )
Last edited by Idea on Thu, 17. Jun 10, 17:40, edited 1 time in total.

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Thu, 17. Jun 10, 17:38

Hi LA,

Damn ... not good !!! and there shouldn't be 27 sectors in the Argon Prime exchange area either. Argon Prime [ 27 ] +

EDIT:
or for Omicron Lyrae either, looks like its combined both areas.

Will look into it now.

MarCon
Last edited by mark_a_condren on Thu, 17. Jun 10, 17:43, edited 1 time in total.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 17. Jun 10, 17:38

Idea wrote:Then all I can do to help is testing and ideas :( .

I don't know how to script.I tried severel times but as English isen't my native language it's prety hard to understand script terms and logic(get array from that,varibale that,if that isen't then go to.... :evil: ).I diden't had a teacher for scripting not like for moding(DeadlyDa is my teacher in that area).

Edit:Damn LA found a bug :wink:
Could still be user error! Wouldn't be the first time :P

LA

Edit: Okay maybe not.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 17. Jun 10, 17:43

mark_a_condren wrote:Hi LA,

Damn ... not good !!! and there shouldn't be 27 sectors in the Argon Prime exchange area either. Argon Prime [ 27 ] +

Will look into it now.

MarCon
The sector list issue will be me!

I'm using LV gate script to join up FDN Networks.... :oops:

LA

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Thu, 17. Jun 10, 17:49

And you joined Argon Prime area to Omicron Lyrae area didn't you. If you read my post above you will see that the sectors connected to each exchange are dynamically checked and assigned, and it caught you out.

But i have an idea how to fix it. I'll get it to check jumps a second time (it does it once already) and if over a certain limit to exclude them from that exchange.

MarCon

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 17. Jun 10, 17:53

mark_a_condren wrote:And you joined Argon Prime area to Omicron Lyrae area didn't you. If you read my post above you will see that the sectors connected to each exchange are dynamically checked and assigned, and it caught you out.

But i have an idea how to fix it. I'll get it to check jumps a second time (it does it once already) and if over a certain limit to exclude them from that exchange.

MarCon
I didn't join these sectors together as there is a four gate limit to LV's Mod. But I bet LV's gate script is causing confused about the closest Exchange due to jump distances

Same issue between Getsu Fune & Light of Heart, and again both within range (FDN range of 8 jumps) of each other due to LV's gate script.

LA

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 17. Jun 10, 17:55

Great, not a bug as such :D More like a compatibility consideration.

Your scripting MoJo is still strong.

LA

Edit: I use this to sort an array of Nodes into jump distance order:

Code: Select all

$s = size of array $arrayNode
$arraySort = array alloc: size=$s
 
$cnt = 0 
while $cnt < $s 
  $node = $arrayNode[$cnt]
  $secN = $node->get sector
  $jump = get jumps from sector $secN to sector $sec
  $arraySort[$cnt] = $jump
  inc $cnt =
end

$array.Return = sort array: data=$arrayNode sort values=$arraySort
$array.Return = reverse array $array.Return
return $array.Return
$sec being the sector of the station/dock I'm checking from.

LA

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Thu, 17. Jun 10, 18:07

The way i got it to build the Exchange area is it starts with the assigned sector with the Exchange station in it and that it. It then get the owner of that sector and works outwards 1 "Jump" at a time and gets all the sectors in that jump radious. Checks the owner race and if same as first sector adds them, then does the smae again adding 1 "Jump". keeps doing this until it does it adds 1 sector twice and finds no sectors owned by that race and then stops. So because jumps gates between them somewhere counts as 1 jump it is picking them up. Damn, hadn't even considered that when i did it.

Have to put MoJo hat on and come up with magic. :D

EDIT:
May be able to use said array sorter to help fix issue.

MarCon

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 17. Jun 10, 18:12

Should I be able to buy shares from an Hostile race?

I set the Split to Foe, let my SSDN kick the hell out of them for a while :twisted: but I could still wheel & deal with their Exchanges.

Maybe a check about relations and it your a foe you lose your stocks?

LA

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x4

Post by Idea » Thu, 17. Jun 10, 18:16

Logain Abler wrote:Should I be able to buy shares from an Hostile race?

I set the Split to Foe, let my SSDN kick the hell out of them for a while :twisted: but I could still wheel & deal with their Exchanges.

Maybe a check about relations and it your a foe you lose your stocks?

LA
Good point

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Thu, 17. Jun 10, 18:26

Agreed, good point. Just hadn't got round to adding the fiddly bits to check for relations yet. Was kinda getting main bit working first then do the addons. Will add it to the list of things to do.

@Idea,
Sorry your post re being only able to add ideas and such was kind of mowed over then.

Testing, ideas, feedback and the like are just as much help as writng code or Modding files as far as i'm concerned. Every little bit helps, no joke. I appreciate every bit anyone gives.

EDIT:
I understand what you mean with the learning to script and understand what it all about. I remember not so long ago (well damn it been nearly 12 months) asking a particular question in regards to how to get them damn 'while' loops to work. A very helpful scripter gave me an example and an explanation (helpful scripter was LA).

MarCon

User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV » Thu, 17. Jun 10, 18:43

002 $g = get global variable: name='lv.gate.store'

$element > find element in array $g > $gate
if $element =1
ignore bla bla
end


would that cover the my gate script issue for tagging.

Nice work btw ;)
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses

User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon » Thu, 17. Jun 10, 18:59

Lets see if you can sort this one out then.


2B is the max number.

So... I've spent - something on shares now. Wrap around. :rofl:
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x4

Post by Idea » Thu, 17. Jun 10, 19:11

mark_a_condren wrote: @Idea,
Sorry your post re being only able to add ideas and such was kind of mowed over then.

Testing, ideas, feedback and the like are just as much help as writng code or Modding files as far as i'm concerned. Every little bit helps, no joke. I appreciate every bit anyone gives.

EDIT:
I understand what you mean with the learning to script and understand what it all about. I remember not so long ago (well damn it been nearly 12 months) asking a particular question in regards to how to get them damn 'while' loops to work. A very helpful scripter gave me an example and an explanation (helpful scripter was LA).

MarCon
Thanks mark.I will do my best as everyone else here to help you out the way we can.

Now get back to work :P

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Thu, 17. Jun 10, 19:27

@LA

Here is a fix for your issue.

As you have changed your universe to suit what you want, as far as i'm concerned the script is doing exactly as it's supposed to. You linked the 2 areas togerther via gates for trading purposes thus linking the 2 areas economies together and the script is reporting it as such.

So from my point of view the only error on behalf of the script is that it assigned the values to the wrong station. This can however be overcome by adding 2 lines in the 'plugin.mc.st.ex.loc.wares' script.

First, sell your stocks that are reporting wrong, then change the code below.

'plugin.mc.st.ex.loc.wares'

Code: Select all

135   ||
136   ||if  find $stn in array: $exch.stn.arr
137   |||$stn.id = $stn -> get ID code
138   |||$loc.var.val = sprintf: fmt='%s%s%s', 'mc.st.ex', $stn, $stn.id, null, null
139   |||$local.owned.stocks = $stn -> get local variable: name=$loc.var.val
140   |||$owned.wares.array = $local.owned.stocks[0]
141   |||$owned.ware.amounts.array = $local.owned.stocks[1]
142   |||$owned.wares.buy.price.avg.array = $local.owned.stocks[2]
143   |||$owned.ware.costs.array = $local.owned.stocks[3]
144   |||
145   |||$exch.stn = $stn
146   ||end
147   ||
ADD

Code: Select all

135   ||if not $exch.stn
and
147   ||end
This will get it to assign it to the station you chose in the 'Local Exchanges Menu' or the closest exchange to your current location if you chose your current sector from the top of the menu.

I'll update the code for the next release accordingly.

@LV

Thanks for the info, i'll keep it in mind if this becomes a bigger issue. I might also look at including that check and make it an option to combine them or not if it encounters it, not sure yet.

Thanks for the compliment.

@EJ
I knew someone would have to spend big and hit that limit sooner or later. Might have to look at introducing a number limit and anything over that starting a new entry maybe.


EDIT:
@Idea
Thanks. Now get back to Study.

MarCon

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”