Author Topic: Diamond BC - Projectiles  (Read 1844 times)

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Diamond BC - Projectiles
« on: April 11, 2009, 05:41:35 PM »
I had a, in my oppinion anyway, cool idea, why not make BC tougher? Tougher to scripting errors and other forms of torture (purely from the perspective of BC, I mean, its only purpose is to run BC, and we are all making it so very difficult!).

How hard you ask?
As hard as a diamond.

One of the most common causes of crashes are missing projectile files. So, with that, here is the first module of a series of N modules (I haven't yet thought of all possible cases, so it could be 1, it could also be 10 or more).

Projectiles

Mind you, it is still in Beta for now. I (and hopefully you as well) will test it out more properly. And release it on BCFiles in the near future.
I've attached (along with the file) a picture that shows that it actually works.

What the script does, is it replaces projectile references (in the hardpoint) when those are loaded if it can't find (that is, import) said module, or if that module doesn't contain all 5 required functions (Create, GetName, GetPowerCost, GetLaunchSound and GetLaunchSpeed), with one that is guaranteed to exist, itself (yes the module that protects your BC from faulty projectile references is another torpedo). It looks just like a Photon, has the same speed and damage, and even the same sound and cost. The one thing in that it differs is its name, which is "ProjectileSubstitute".

So, if you see that name, go to the console, and ask the author of the mod to send you the projectiles mentioned! (See screenshot)

The file itself goes in scripts/Custom/Autoload/
It will also protect you from missing pulse weapon references.
Mind you, while it uses similar constructs for handling missing projectiles like my More Than 4 Torpedo types, it doesn't allow more than 4 torpedo types, and I'm still working on properly redoing that mod into a FoundationTech plugin.
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 tiqhud

  • BCFiles File Poster
  • Posts: 1763
  • Cookies: 1067
  • San Francisco Shipyards (HPer) file manuiplater
Re: Diamond BC - Projectiles
« Reply #1 on: April 11, 2009, 07:12:19 PM »
This will come in VERY handy ,  so your trying to make BC noob-proof, Very good :D
TiqHud
you sir, are unable to strike, the port or starboard parts of hull , of a bovine storage facility.
Canon , what people argue exists, that doesn't really  exist.
It is all the little details, that cause headaches.
"Never judge wealth with Money"
'Intelligence has Nothing to do with Politics'
it is Late, Do you know where your Towel is?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Diamond BC - Projectiles
« Reply #2 on: April 11, 2009, 07:23:11 PM »
Thanks. Yes, noob proof, but actually more "lazy modder" proof and the real, hidden, reason is to make the job of that poor Technical Support "person" (I doubt he is really a person, just between you and me ;)) a bit easier.

And yes, to make BC less crash prone.
Ok, I admit, that is the real reason.


Also, I've written a bit more extensively about this mod and the background for it on my weblog:
http://my.opera.com/MLeo/blog/2009/04/11/diamond-bridge-commander-projectiles
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 El

  • Master Hardpointer
  • Retired Administrator
  • Posts: 653
  • Cookies: 123
  • Former Vice Admin
Re: Diamond BC - Projectiles
« Reply #3 on: April 12, 2009, 07:00:48 AM »
....the real, hidden, reason is to make the job of that poor Technical Support "person" a bit easier.

i.e. You, :lol:

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Diamond BC - Projectiles
« Reply #4 on: April 12, 2009, 09:35:03 AM »
I am wondering, could everyone just install it and run BC with it (fullscreen and windowed mode, and of course with and without -TestMode)?
I think I got it, but it can't hurt to be sure.

....the real, hidden, reason is to make the job of that poor Technical Support "person" a bit easier.

i.e. You, :lol:
I forgot about that for a second. Whoops. :P


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 SMBW

  • Noob
  • Posts: 35
  • Cookies: 107
Re: Diamond BC - Projectiles
« Reply #5 on: April 12, 2009, 01:08:06 PM »
Hey MLeo!
I think I'm experiencing a problem with your DiamondBC_Projectiles.py.
It works fine on one of my modded installs (only Foundation, UMM, Submenu, NanoFX installed) but I get either crashes to desktop or console errors on my KM install (clean KM 1.0 + consolelogger.py and DiamondBC_Projectiles.py) whenever I put the script into the autoload folder - when I remove it again everything works fine. I hope that helps - for more details just ask...
Don't part with your illusions. When they are gone you may still exist, but you have ceased to live.  - -  Mark Twain

Sorry for my bad English!

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Diamond BC - Projectiles
« Reply #6 on: April 12, 2009, 03:32:02 PM »
Hey MLeo!
I think I'm experiencing a problem with your DiamondBC_Projectiles.py.
It works fine on one of my modded installs (only Foundation, UMM, Submenu, NanoFX installed) but I get either crashes to desktop or console errors on my KM install (clean KM 1.0 + consolelogger.py and DiamondBC_Projectiles.py) whenever I put the script into the autoload folder - when I remove it again everything works fine. I hope that helps - for more details just ask...
I second that.
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Diamond BC - Projectiles
« Reply #7 on: April 12, 2009, 05:35:02 PM »
Oooh... I don't think I've managed a stackoverflow in quite some time!
Thanks for finding it, should get a new version soon.

Like, round about, now... ish. :P

Found another, similar error as well.
I knew I had to refactored it, the repetitions were (actually are, considering the error!) killing me.
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 SMBW

  • Noob
  • Posts: 35
  • Cookies: 107
Re: Diamond BC - Projectiles
« Reply #8 on: April 12, 2009, 06:22:34 PM »
tested it on three installs - seems to work fine for me. But there are no projectiles missing in these installs so I can't say for sure. But I need to say thx. I've just learned the difference between "var = my_function()" and "var = my_function" from reading your script. I didn't know that one can use the second version... This might be useful... so thx for that? :)

And of course: Nice work with your Diamond BC ? Projectiles.
Don't part with your illusions. When they are gone you may still exist, but you have ceased to live.  - -  Mark Twain

Sorry for my bad English!

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Diamond BC - Projectiles
« Reply #9 on: April 13, 2009, 11:39:03 AM »
So, did anyone else find anything?

tested it on three installs - seems to work fine for me. But there are no projectiles missing in these installs so I can't say for sure. But I need to say thx. I've just learned the difference between "var = my_function()" and "var = my_function" from reading your script. I didn't know that one can use the second version... This might be useful... so thx for that  :)
One is assignment from a variable, the other is assignment from a function application.
Let me put it differently, both are assigning the result of an expression, sure, one of them is the evaluation of a "variable", and the other is evaluation of "a function application of a variable".
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 NeoKaede

  • Posts: 201
  • Cookies: 4
  • We're watching you... scum.
Re: Diamond BC - Projectiles
« Reply #10 on: April 15, 2009, 09:18:54 AM »
Tougher to scripting errors and other forms of torture

This made me laugh :lol:

Good idea for mod. I'll try it.

Offline KrrKs

  • Posts: 461
  • Cookies: 25
Re: Diamond BC - Projectiles
« Reply #11 on: April 19, 2009, 09:17:00 AM »
Great Idea MLeo! But I found an Interference with Scripts trying to launch a Projectile via MissionsLib's FireTorpedoFromPoint or what it was (like the ChainReaction Pulsar does).
I must look were I put the Console Logger, than i can give you a propper printout.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Diamond BC - Projectiles
« Reply #12 on: April 19, 2009, 09:22:48 AM »
Since you mentioned MissionLib, I can take a look there.
But an trace log would be nice.

If you have my ConsoleLogger installed (in say Autoload) then it will appear in scripts/Custom, ending with _output.log (just rename it to _output.txt to upload) starting with the current date and time.
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 KrrKs

  • Posts: 461
  • Cookies: 25
Re: Diamond BC - Projectiles
« Reply #13 on: April 19, 2009, 09:47:55 AM »
What I found on my HD is a logger from USS Frontier. I didn't know you made one. Anyway, Here is the log

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Diamond BC - Projectiles
« Reply #14 on: April 19, 2009, 09:54:29 AM »
Please try this one.
I'm unfortunatly not at my usual comp, luckily it was (mostlikely) an easy fix.
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 KrrKs

  • Posts: 461
  • Cookies: 25
Re: Diamond BC - Projectiles
« Reply #15 on: April 19, 2009, 10:01:22 AM »
Anything working now. Thanks, that was quick! :) Have a cookie

Offline USS Frontier

  • Posts: 176
  • Cookies: 562
Re: Diamond BC - Projectiles
« Reply #16 on: April 19, 2009, 08:17:18 PM »
Use MLeo's ConsoleLogger, its newer and better lmao
Even I use it too :P Tho I also have mine installed, just because I never bothered deleting it xD
"Revenge is a dish best served cold"
                    -Old Klingon Proverb
GravityFX Download
Galaxy Charts Download

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Diamond BC - Projectiles
« Reply #17 on: April 20, 2009, 05:40:05 AM »
So, I now just need to pack it up with a nice readme. Maybe a release tonight?

Unless someone finds a problem that is.
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: Diamond BC - Projectiles
« Reply #18 on: April 20, 2009, 02:34:15 PM »
And I've released it here:
http://bc-central.net/forums/index.php/topic,5599.0.html

I've also submitted it to BCFiles and I'll update the linked post when it gets posted.
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.