• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

Need a mercenary company?

Code is freely available on GitHub. Some of the files are large, for text files, as they have a thousand or two names in them. :)

Leitz
 
I've started playing with MongoDB and needed some JSON formatted input. Added 'create_mercenary_unit_json.php' that gives a lot of data. Like, 10,000 troops and hundreds of NCOs and officers.

As always, code available on GitHub.
 
The mercenary.js file showed up once. But didn't grow (stopped appending). Sometimes it doesn't generate at all. Windows 7 Pro 64-bit. PHP 5.3.13.

Nevermind. It looks like create_mercenary_unit_json.php is what makes the file. I was thinking that the main program added each signup to the js.
 
Last edited:
Slowly working on making this use OOP and design patterns. Mostly so I can learn OOP and design patterns. ")
 
My brain can't figure out OOP no matter what books I read on the subject. Sounds neat for some programs, but my brain is wired differently. It's too abstract for my style of programming. Some programmers do everything in classes whether it needs to be a class or not. So that makes it even harder for me to desk-check the stuff.
 
Hey pardner! I can assure you any OOP I'm doing is pretty basic stuff. I've moved the OOP effort to https://github.com/makhidkarun/NPC_Generator because if I can get the OOP right, it becomes a lot easier to expand the code base.

Wren't you doing stuff in Python? That's a cool language *and* OOP through and through. :)
 
Hey pardner! I can assure you any OOP I'm doing is pretty basic stuff. I've moved the OOP effort to https://github.com/makhidkarun/NPC_Generator because if I can get the OOP right, it becomes a lot easier to expand the code base.

Wren't you doing stuff in Python? That's a cool language *and* OOP through and through. :)

Python can be used to program any which way or style. I like that it is interpreted. No compiling ever. And it's fast for me to program in, while keeping code bug-free as I go.

I recently had time to figure out the py2exe "wrapper", so now my code can be distributed without the user needing to install Python.

I look forward to seeing your OOP stuff. Don't know if I'll understand it exactly though. But that is just me.
 
I had exactly the same problem 'getting' OOP. I did my CS degree back in the 80s and never learned OOP academically, and mostly wrote shell scripts and Perl through the 90s as a sysadmin.

Then I decided to buckle down and learn OOP. I started with C# - way too heavy duty for me. Then I discovered Python. I took to it fast but still didn't understand how OOP apps are structured. Where do you put the data? How does an app pass data between objects?

It literally took me years of playing about to get my head around it. I think what helped me get it was just looking at some very basic OOP structured examples. Tutorials are fine, but there's no substitute for looking at and playing with actual well-written code.

The thing is, for many apps, in fact for the majority of my scripts at work, I rarely create new classes at all. They're mostly just collections of module level functions. When faced with nut, use hammer; self-assembly kit for electrically powered OmniNut Crackotron Pro not required.

Then there's StarBase, which is an OOP-to-the-max 10,000 line monster. But then it has to be. It's a big solution to a big problem. That's why I tried to make sure the world generation plugin scripts are as simple and have as elementary an interface to the main app as possible. I want anyone with even the most rudimentary coding skills to be able to do useful things with StarBase and take advantage of all the work that's gone into it's internals.

I second that shout out to Py2exe as well. It's a fantastic project. It's what makes it possible for me to distribute SB as an executable, but still load the Python plugin scripts at runtime. You can program StarBase using python, without installing Python. It's like magic!

Simon Hibbs
 
Last edited:
Back
Top