I am trying out marketing in game guru.
In the game the player buys and sells items. These items are valued according to supply and demand.
In this test I have 77 items and each item is for sale in 77 markets. ( This is just the numbers I set for the testing)
So for each item there are 77 market prices which reflect the demmand price.
The script that I am useing is set out below.
I could do this with tables but I am tryin gout this way to see if it can be done.
function tstmv_first_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 150 then
if trigger01 == 0 then
local file = io.open("scriptbank\\trade\\product.txt", "r")
for firstno = 1, 77, 1 do
accumprod = accumprod + 1
firstno = file:read("*n", "*l")
trigger01 = 1
if trigger11 == 0 then
local file = io.open("scriptbank\\trade\\demand.txt", "r")
for nxtno = 1, 77, 1 do
accumdmnd = accumdmnd + 1
nxtno = file:read("*n", "*l") -- this "l" is lowercase "L"
result = firstno/nxtno
local file = io.open("scriptbank\\trade\\marketvalue.txt", "a")
file:write(result .. "\n")
accummrktv = accummrktv + 1
if accummrktv == 5929 then
trigger11 = 1
result = 0
firstno = 0
nxtno = 0
file:close()
end
end
end
end
end
end
end
Another script handles the count for each section.
Just a simple centreon X type thing.
The problem is that the first sections counts to 7
the second section counts to 508
and the third section counts to 508.
It should count to 5929 in the third section. 77x77= 5929
Why does the first section stop counting at 7?
Why does second and third stop counting at 508?
I can't fathom this one out. Perhaps it can't be done, but then it partly works and it works if the first number is a single number and not a for loop.
Any ideas would be great.
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 560 Ti 4GB. Dell US27 2560 x 1440. AOC 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card