Writing Random Sector Discovery Points
Moderators: Moderators for English X Forum, Scripting / Modding Moderators, Moderators for the X3:FL Forums
-
- Posts: 544
- Joined: Wed, 27. Dec 17, 05:47
Writing Random Sector Discovery Points
Is there a way to write (script) the sectors that have random discovery points attached to the log book?
I need a simple solution if possible. I can find commands, but I get confused easily if there is too much involved.
I need a simple solution if possible. I can find commands, but I get confused easily if there is too much involved.
Last edited by N8M4R3 on Sun, 29. Oct 23, 20:02, edited 1 time in total.
Reason: *Toppic Moved* Script & Modding relevant questions should be asked in the corresponding forum
Reason: *Toppic Moved* Script & Modding relevant questions should be asked in the corresponding forum
Peace is a state of mind!
War is absolute!
~ Phantos ~
War is absolute!
~ Phantos ~
-
- Posts: 544
- Joined: Wed, 27. Dec 17, 05:47
Re: Writing Random Sector Discovery Points
Can anyone tell me how to at least get the sector's with the random discovery points?
I can figure out the rest.
The reason is I use the "all seeing eye" script to find the spawned pandora's crates. That is easy. But the number of active ones seems to fluctuate between 12 at once to 7 at once. Most of the time it will stay at 7 at once. And only replace those 7. But every once in a while when I go all over the place, it will shoot back up to 12. I've had seta run for 2 hours before and never had the number of spawns exceed 7.
Do the scrips that generate these goodies lock up (like start idling like the special command software) over time? Or do the randomly generated sector points take the place of a randomly generated pandora crates?
Any help is welcome and appreciated.
I can figure out the rest.
The reason is I use the "all seeing eye" script to find the spawned pandora's crates. That is easy. But the number of active ones seems to fluctuate between 12 at once to 7 at once. Most of the time it will stay at 7 at once. And only replace those 7. But every once in a while when I go all over the place, it will shoot back up to 12. I've had seta run for 2 hours before and never had the number of spawns exceed 7.
Do the scrips that generate these goodies lock up (like start idling like the special command software) over time? Or do the randomly generated sector points take the place of a randomly generated pandora crates?
Any help is welcome and appreciated.
Peace is a state of mind!
War is absolute!
~ Phantos ~
War is absolute!
~ Phantos ~
-
- Moderator (Script&Mod)
- Posts: 22254
- Joined: Sun, 14. Nov 04, 23:26
Re: Writing Random Sector Discovery Points
Theres a script command available to set and get the discovery points of a object. Just use this on the sector.
so you just need to get all sectors and check how many points each one has
so you just need to get all sectors and check how many points each one has
-
- Posts: 544
- Joined: Wed, 27. Dec 17, 05:47
Re: Writing Random Sector Discovery Points
Thanks for those guides / links. They are a big help.
Here is my first attempt. It doesn't return anything into the log. Does that mean no random points are being assigned? It does cause a slight stutter when you open the log after running it.
I wrote it from studying other scripts, hoping I got it right for the most part. Any and all critiques or suggestions welcome. I'm struggling a bit with how to get each sector.
https://drive.google.com/file/d/1atkhec ... drive_link
(Changed link as previous one has been removed and replaced with a working version.)
This is a fun process
Last edited by BrigandPhantos77 on Tue, 7. Nov 23, 10:57, edited 2 times in total.
Peace is a state of mind!
War is absolute!
~ Phantos ~
War is absolute!
~ Phantos ~
-
- Moderator (Deutsch)
- Posts: 24969
- Joined: Sun, 2. Apr 06, 16:38
Re: Writing Random Sector Discovery Points
The code looks correct. So yes, that suggests, that there are no Discovery Points currently assigned to any sector.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
-
- Moderator (Script&Mod)
- Posts: 22254
- Joined: Sun, 14. Nov 04, 23:26
Re: Writing Random Sector Discovery Points
A 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
-
- Posts: 544
- Joined: Wed, 27. Dec 17, 05:47
Re: Writing Random Sector Discovery Points
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
Thanks!
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.
Thanks guys! This points me in the right direction and I can try bigger and bigger things going forward. "Baby steps though for me. "
Peace is a state of mind!
War is absolute!
~ Phantos ~
War is absolute!
~ Phantos ~
-
- Posts: 544
- Joined: Wed, 27. Dec 17, 05:47
Re: Writing Random Sector Discovery Points
Froze the game 12 times now trying to test. lol....
I'll keep trying though. I'll get it right eventually.
Peace is a state of mind!
War is absolute!
~ Phantos ~
War is absolute!
~ Phantos ~
-
- Moderator (Script&Mod)
- Posts: 418
- Joined: Fri, 24. Nov 06, 15:48
Re: Writing Random Sector Discovery Points
This 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 times But 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
Neue Erweiterung für X3 verfügbar: Farnham's Legacy | +Optional: weitere Verbesserungen im inoffiziellen Patch v1.3.17 *** Modified***
Diese Woche im Angebot: HUD-GUI-Mix (FL) | Text-DB 0001-L049 (FL) | Textkorrekturen & Verbesserungen (FL)
Weitere Veröffentlichungen hier: N8workX
Nützliches Tool für nicht mehr vorhandene Downloads: web.archive.org
Externes Archiv für MOD/SCR Ressourcen: xdownloads.co.uk | code.google.com/archive/p/x3tcscripts/
Diese Woche im Angebot: HUD-GUI-Mix (FL) | Text-DB 0001-L049 (FL) | Textkorrekturen & Verbesserungen (FL)
Weitere Veröffentlichungen hier: N8workX
Nützliches Tool für nicht mehr vorhandene Downloads: web.archive.org
Externes Archiv für MOD/SCR Ressourcen: xdownloads.co.uk | code.google.com/archive/p/x3tcscripts/
-
- Posts: 544
- Joined: Wed, 27. Dec 17, 05:47
Re: Writing Random Sector Discovery Points
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 times But 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
Peace is a state of mind!
War is absolute!
~ Phantos ~
War is absolute!
~ Phantos ~
-
- Posts: 544
- Joined: Wed, 27. Dec 17, 05:47
Re: Writing Random Sector Discovery Points
I finagled, finessed, sweat talked, argued with, and even yelled at the dang thing. It even froze my game a few times. Guess I shouldn't yell at it.
In the end, here is what I came up with.
It's in spoilers so you can minimize it. From what I can tell it works completely now. Only thing is, at the end it won't grab the last sector name and just ends with null. So statement 2 executes instead of the first.
Here is a link> https://drive.google.com/file/d/1atkhec ... sp=sharing
Feel free to use as you see fit in anything you want. This has been a bit of a learning curve for me. I plan to do more in the future as I get more comfortable with this.
Additional edit*** Broke it again trying to mess with and tweak some more.
In the end, here is what I came up with.
Spoiler
Show
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
Here is a link> https://drive.google.com/file/d/1atkhec ... sp=sharing
Feel free to use as you see fit in anything you want. This has been a bit of a learning curve for me. I plan to do more in the future as I get more comfortable with this.
Additional edit*** Broke it again trying to mess with and tweak some more.
Peace is a state of mind!
War is absolute!
~ Phantos ~
War is absolute!
~ Phantos ~