UncleBob's annoying API questions

Pioneer is an open-ended space adventure game. Explore the galaxy, make your fortune trading between systems, or work for the various factions fighting for power, freedom or self-determination.
Homepage: http://pioneerspacesim.net/
IRC: http://pioneerspacesim.net/irc
Downloads: https://pioneerspacesim.net/page/download/
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post 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... :lol:
Brianetta
Private
Posts: 863
Joined: Sun Apr 03, 2011 6:12 pm

RE: UncleBob's annoying API questions

Post by Brianetta »

Admit it, that's inspired. You'd never suspect Rosie.
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post 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?
Brianetta
Private
Posts: 863
Joined: Sun Apr 03, 2011 6:12 pm

RE: UncleBob's annoying API questions

Post 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.
robn
Private
Posts: 1035
Joined: Mon Jan 31, 2011 10:29 pm

RE: UncleBob's annoying API questions

Post 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.]
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post 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... :lol: 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.
ollobrain
Private
Posts: 561
Joined: Tue Jan 04, 2011 9:40 am

RE: UncleBob's annoying API questions

Post by ollobrain »

hidden pirate bases AI or player owned in lawful systems ? major hubs in the middle of nowhere
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post 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?
Ziusudra
Private
Posts: 61
Joined: Tue Aug 02, 2011 10:49 pm

RE: UncleBob's annoying API questions

Post 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.
robn
Private
Posts: 1035
Joined: Mon Jan 31, 2011 10:29 pm

RE: UncleBob's annoying API questions

Post 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 ;)
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post 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...
Brianetta
Private
Posts: 863
Joined: Sun Apr 03, 2011 6:12 pm

RE: UncleBob's annoying API questions

Post 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).
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post 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.
Ziusudra
Private
Posts: 61
Joined: Tue Aug 02, 2011 10:49 pm

RE: UncleBob's annoying API questions

Post 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.
robn
Private
Posts: 1035
Joined: Mon Jan 31, 2011 10:29 pm

RE: UncleBob's annoying API questions

Post 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.
robn
Private
Posts: 1035
Joined: Mon Jan 31, 2011 10:29 pm

RE: UncleBob's annoying API questions

Post 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.
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post 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?
Brianetta
Private
Posts: 863
Joined: Sun Apr 03, 2011 6:12 pm

RE: UncleBob's annoying API questions

Post 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.
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post 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... :(
Brianetta
Private
Posts: 863
Joined: Sun Apr 03, 2011 6:12 pm

RE: UncleBob's annoying API questions

Post 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. )-:
Post Reply

Return to “Pioneer”