I need a simple solution if possible. I can find commands, but I get confused easily if there is too much involved.
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Moderators: Moderators for English X Forum, Scripting / Modding Moderators, Moderators for the X3:FL Forums
Thanks for those guides / links. They are a big help.
Code: Select all
$x = get max sectors in x direction
while $x
dec $x =
$y = get max sectors in y direction
while $y
dec $y =
$sector = get sector from universe index: x=$x, y=$y
skip if $sector -> exists
continue
... (rest of script)
end
end
I think I can wrap my brain on that.Cycrow wrote: ↑Sun, 5. Nov 23, 12:00A better way would be to use 2 whiles
Code: Select all
$x = get max sectors in x direction while $x dec $x = $y = get max sectors in y direction while $y dec $y = $sector = get sector from universe index: x=$x, y=$y skip if $sector -> exists continue ... (rest of script) end end
The amount bounces back and forth between 12 and 7. After reading the handbook it can have up to 5? Which is oddly the amount that vanishes. So maybe when 5 vanishes again I'll try it again.X2-Illuminatus wrote: ↑Sun, 5. Nov 23, 11:15The code looks correct. So yes, that suggests, that there are no Discovery Points currently assigned to any sector.
I definitely don't plan to give up. It might suck the first couple of screw ups you make.... but when you get it right, that's about the most exciting part. And sometimes a screw up can show you something else unintended, make you think and go hmmmm, then redo and suddenly.... "shock" and so that's how that works.N8M4R3 wrote: ↑Mon, 6. Nov 23, 00:22This reminds me of when I first started scripting. I don't know how many times it didn't work and how many times the game began to freeze but it was many, many timesBut with every try, change and retry it comes clearer and clearer to you what you do and suddenly it also won't freeze anymore. Just don't give up
![]()
Code: Select all
$X = 0
$Y = 0
$X2 = get max sectors in x direction
$Y2 = get max sectors in y direction
$ssector = get sector from universe index: x=$X, y=$Y
if $ssector-> exists
$MessageStart = 'I have begun working on your request! ' + $ssector + ' is where we will start'
write to player logbook $MessageStart
else
$MessageStart2 = 'Lets begin the work!'
write to player logbook $MessageStart2
end
while $Y < $Y2 + 1
$ssector = get sector from universe index: x=$X, y=$Y
if $ssector-> exists
* This asks for discovery points.
$spoints = $ssector-> get discovery points
if $spoints >= 1
$Message = 'Here is your sector containing some random points - ' + $ssector
write to player logbook $Message
end
end
if $X == $X2 + 1
$X = 0
inc $Y
else
inc $X
end
end
if $Y == $Y2 + 1
$MessageEnd = 'Your request has been completed! Have a wonderful day!'
write to player logbook $MessageEnd
end
return null