Page 3 of 4
RE: UncleBob's annoying API questions
Posted: Tue Dec 13, 2011 3:18 am
by UncleBob
Quote:
In this snippet of yours, you use female as an argument to NameGen.FullName; trouble is, this is all within a table def, so the definition of female that you've used isn't in scope.
Aaargh!The brackets! mind the brackets! Lest you forget that you're initializing an object and not assigning variables in a function! Now I'll repeat that a hundred times, and maybe I'll even remember it :?aaaand the official Information Broker for the Sol system, the spider in the web, the fly on your wall, the ears you can't see, is: Rosie Carpenter. Seriously, Rosie?? sometimes I hate procedural generators and their complete lack of dramatic flair...

RE: UncleBob's annoying API questions
Posted: Tue Dec 13, 2011 4:14 am
by Brianetta
Admit it, that's inspired. You'd never suspect Rosie.
RE: UncleBob's annoying API questions
Posted: Wed Dec 28, 2011 10:10 am
by UncleBob
Just a question to make sure: When I save a character, do the additional attributes I added to the table get saved with it?And another question, what values can I expect from a systems lawlessnes? 0 to 1?
RE: UncleBob's annoying API questions
Posted: Wed Dec 28, 2011 6:51 pm
by Brianetta
UncleBob wrote:
Just a question to make sure: When I save a character, do the additional attributes I added to the table get saved with it?
Yes.
Quote:
And another question, what values can I expect from a systems lawlessnes? 0 to 1?
Erm... it's a "fixed," whatever that actually is. Expect a fairly large range of numbers.
RE: UncleBob's annoying API questions
Posted: Thu Dec 29, 2011 1:40 am
by robn
Quote:
Quote:
And another question, what values can I expect from a systems lawlessnes? 0 to 1?
Erm... it's a "fixed," whatever that actually is. Expect a fairly large range of numbers.
Actually its a fractional number in the range 0-1, where (theoretically) 1 is raging hordes and 0 is a serene garden. Right now only pirate spawns really care about it. Its another of those political things that will change in time.[Edit 7 Jan: I got 0 and 1 the wrong way around.]
RE: UncleBob's annoying API questions
Posted: Thu Dec 29, 2011 2:50 am
by UncleBob
Quote:
Yes.
Great!
Quote:
Actually its a fractional number in the range 0-1, where (theoretically) 0 is raging hordes and 1 is a serene garden.
A serene garden where you get a deadly injection if you ruin a bed of flowers at the wrong time, I assume...

So a high value in lawlessness actually means more lawfull...

thanks for pointing that out.I'll use it for making my InfoBrokers potentially less lawful in lawless systems, and also for making quaries hide out in more lawless systems.
RE: UncleBob's annoying API questions
Posted: Fri Jan 06, 2012 6:16 am
by ollobrain
hidden pirate bases AI or player owned in lawful systems ? major hubs in the middle of nowhere
RE: UncleBob's annoying API questions
Posted: Fri Jan 06, 2012 1:39 pm
by UncleBob
Quote:
hidden pirate bases AI or player owned in lawful systems ? major hubs in the middle of nowhere
I can't quite catch your meaning. My only concern currently is to make information sellers more prone to selling ilegal information in lawless systems, as well as making hunted fugitives flee to more lawless systems. And later on probably give a better chance of getting an illegal bounty contract in a lawless system, but I have to get the basics first before extending too much...Anyways, I played around a bit, and noticed that Sol has a lawlessness value of 0.13. Which is a lot lower than I expected, is it really still that bad on and around earth in the 33rd century?
RE: UncleBob's annoying API questions
Posted: Fri Jan 06, 2012 2:56 pm
by Ziusudra
Hmm, the trade ships and pirates modules have always used the lawlessness value as though 1 is maximum lawlessness and 0 is minimum. See TradeShips:239 and Pirates:15. For trade ships a higher value reduces the number of trade ships. For pirates a higher value increases the odds of spawning a pirate.See also Polit.cpp:135 where a high lawlessness value reduces the fine amount.Looking at Polit.cpp:52-78, a value of 1 is maximum lawlessness and 0 is minimum. NO_CENTRAL_GOVERNANCE has a base value of 1, VIOLENT_ANARCHY has a base value of 0.9, and EARTH_FEDERATION_DEMOCRACY has a base value of 0.15.So, it's the opposite of what robn said: 1 is raging hordes and 0 is a serene garden. A high lawlessness value really does mean more lawless.
RE: UncleBob's annoying API questions
Posted: Fri Jan 06, 2012 3:40 pm
by robn
Ziusudra wrote:
So, it's the opposite of what robn said: 1 is raging hordes and 0 is a serene garden. A high lawlessness value really does mean more lawless.
The joy of double negatives. lawlessness was always a stupid name for it. I borrowed it as-is from tomm's code, so blame him

RE: UncleBob's annoying API questions
Posted: Sat Jan 07, 2012 5:22 am
by UncleBob
Ah, so the parameter naming makes sense after all. Thanks for clearing that up!I am a bit surprised to see a lower lawlessness in scarcely populated adjacent systems, in this case. Oh well, I guess smaller communities with tight seuritie would have less crime...
RE: UncleBob's annoying API questions
Posted: Sat Jan 07, 2012 8:16 am
by Brianetta
Smaller communities have less crime, period. Compare the inner city to any small village in the country. Crime becomes sustainable as a career option only when there's more opportunity (such as more potential victims).
RE: UncleBob's annoying API questions
Posted: Sat Jan 07, 2012 10:29 am
by UncleBob
Quote:
NO_CENTRAL_GOVERNANCE has a base value of 1
hmmm... 12 Ophuchi has NO_CENTRAL_GOVERNANCE, but still gets a lawlessness of 0.04... Even with a few modifiers, that seems to be weird if it has a base value of 1.
RE: UncleBob's annoying API questions
Posted: Sat Jan 07, 2012 12:37 pm
by Ziusudra
maxLawlessness would be a more accurate name than baseLawlessness. On Polit.cpp:225 a system's lawlessness is a random number between 0 and base.It might make sense for that human_infestedness to be used to determine a minimum lawlessness.
RE: UncleBob's annoying API questions
Posted: Sat Jan 07, 2012 5:10 pm
by robn
Brianetta wrote:
Smaller communities have less crime, period. Compare the inner city to any small village in the country. Crime becomes sustainable as a career option only when there's more opportunity (such as more potential victims).
And/or less chance of being caught (more places to hide). Risk vs reward, as always.
RE: UncleBob's annoying API questions
Posted: Sat Jan 07, 2012 5:13 pm
by robn
Ziusudra wrote:
maxLawlessness would be a more accurate name than baseLawlessness. On Polit.cpp:225 a system's lawlessness is a random number between 0 and base.It might make sense for that human_infestedness to be used to determine a minimum lawlessness.
At this time you shouldn't put much stock in anything related to politics, crime, economy or trade. Those are the "big four" that are intertwined in complex ways and haven't really been touched yet. They will change. You should still try things out and think about how it might work (we need insight in this area). Just don't get too hung up on any particular detail.
RE: UncleBob's annoying API questions
Posted: Sun Jan 08, 2012 12:52 pm
by UncleBob
I'm taking my code appart, putting the Infobrokers into their seperate LUA file, because otherwise things get a bit crowded. It'll also be easier to use InfoBrokers with other mission types should it become necessary in the future.Anyways, that leaves me with the problem that I can't get direct access to the players mission list. There's Player:GetMission(), but how do I iterate through them without knowing how many there are? Does the function return nil when it's out of bound?
RE: UncleBob's annoying API questions
Posted: Sun Jan 08, 2012 2:52 pm
by Brianetta
UncleBob wrote:
Anyways, that leaves me with the problem that I can't get direct access to the players mission list. There's Player:GetMission(), but how do I iterate through them without knowing how many there are? Does the function return nil when it's out of bound?
You cannot. If you don't track your missions yourself, you're pretty much stuffed. I cover the mission list from almost exactly half way down this wiki page.
RE: UncleBob's annoying API questions
Posted: Sun Jan 08, 2012 3:13 pm
by UncleBob
So there is no way for a LUA module to interact with missions created by another? Well, I guess I have to merge my InfoBrokers back into the same LUA file again, then...

RE: UncleBob's annoying API questions
Posted: Sun Jan 08, 2012 3:29 pm
by Brianetta
UncleBob wrote:
So there is no way for a LUA module to interact with missions created by another? Well, I guess I have to merge my InfoBrokers back into the same LUA file again, then...

There's one way... abuse the global scope. )-: