Author Topic: I'm looking for help with programing  (Read 1344 times)

PhaserFox

  • Guest
I'm looking for help with programing
« on: November 07, 2007, 08:12:15 PM »
i'm not entirely new to modding stbc, but i could use pointers to help improve my modding ability. i was also wondering if anyone really knew how C compared to..Python, i think is what you guys mod in. also, links for modding tools would help very much. thanks. (I can code, well edit code pretty well, but graphics are beyond me)

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: I'm looking for help with programing
« Reply #1 on: November 08, 2007, 01:29:01 PM »
Well, C doesn't really compare to Python, Python is a language on it's own.

But you can program like C in it, since it has free functions.
One of the core ideas you have to grasp is the fact that nothing is sacred.

Code: [Select]
class dummy:
  pass
d = dummy()
del dummy
# dummy doesn't exist anymore!
print d
print d.__class__
dummyReborn = d.__class__
d2 = dummyReborn()
print d2
That's how nothing is sacred. ;)


Other than that, follow a couple of Python tutorials.
But only follow the standard library and language, most api's aren't exactly usefull in BC. Also, quite a lot standard py files (uncompiled python files, see the SDK for the all the stock Python files in uncompiled form) aren't included, but you can include them by yourself in your mods.

Also, the Python version is 1.5.2.

Basicly, the only api's you need to learn for BC are App.py (the interface with BC) and the Foundation, after that, it's just what you need to use.

I can advise to always run in -TestMode and in Windowed Mode (see Graphics options after you start in -TestMode). In -TestMode you can access the Console (basicly a Python interpretter, except that you need to type print for everything you want to get a reply from).

Even more info, you can only read/write from files in scripts/Custom/ this is a security thing.



And last 3 pieces of advise, try (failure isn't bad, just try), snoop around in scripts (stock BC and mods) and ask specific questions when they arrise.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: I'm looking for help with programing
« Reply #2 on: November 09, 2007, 10:22:42 AM »
You seem to have removed your second post, but to elaborate (handy thing, e-mail ;)):
Quote
so if the version is 1.5.2, is it going to cause problems if i just download the most recent version from the site?

No, it won't cause problems for BC, since Python 1.5.2 is embedded into it.

But if you want to test stuff outside of BC, or want to use some of the tools written in Python in the SDK, then it's advisable to use 1.5.2. Please note, that anything beyond 2.6 will be even more different from Python at 1.5.2 with a lot of things changed, added, and even a few language features removed (removed from Python 3 onwards).

I myself have Python 1.5.2, Python 2.4 and Python 2.6 side by side installed.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

PhaserFox

  • Guest
Re: I'm looking for help with programing
« Reply #3 on: November 09, 2007, 10:28:12 AM »
would it work if i like, made a template from an already made hardpoint, and use that in the scripter window. i mean, i've edited most of my ship's hardpoints, but i've never made a script from scratch

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: I'm looking for help with programing
« Reply #4 on: November 09, 2007, 10:31:23 AM »
The general consensus around scripters is that hardpointing isn't exactly scripting. It's more filling in numbers (mostly through MPE).

Aside from that, you can't edit hardpoints through an external python interpretter.
For one, it's a python file itself.
Secondly, Hardpoints are dependant on App.py, which in turn is dependant on the module Appc, which is embedded in BC (rather, it's created on startup in memory only, it's the link between Python and the C++ code of BC).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

PhaserFox

  • Guest
Re: I'm looking for help with programing
« Reply #5 on: November 09, 2007, 10:40:26 AM »
didnt understand half that, but i'll take your word for it ^^;. i really need to clean up my game though, i forgot how much of a mess i left it. random crashes everywhere, that and a bunch of missing mod voice files. thanks for the help