Author Topic: i forgot how to do this...  (Read 848 times)

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
i forgot how to do this...
« on: May 10, 2018, 04:07:12 PM »
im creating a new build from scratch mod by mod, all my previous builds were always KM-based...  this new one ive been beginning is non-KM...
i remember this problem years ago but i cant remember how (simple no doubt) the fix is?    :hithead:

Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: i forgot how to do this...
« Reply #1 on: May 10, 2018, 04:36:51 PM »
The file has no init def, meaning (i think) that it can't run because it's unable to initiate. The fix would be to open the script and see why it has no init def, perhaps that file is linked to another script which is not present with imports to another init def. That's all I really know, wish I could be more help.

Offline JB2005

  • Scripter, Lawyer, Soldier, Spy
  • Posts: 197
  • Cookies: 58
    • Captain's Orders Blog
Re: i forgot how to do this...
« Reply #2 on: May 10, 2018, 04:41:21 PM »
This comes up when you have a script in the QBAutostart Folder which doesn't have a

Code: [Select]
def init():
function.

If the script works fine without it, go down to the bottom, add the following and it should stop generating the error message:

Code: [Select]
def init():

# We don't need no de...finitions - hey, teacher, leave this script alone!

return0

It's a feature of QBAutostart. It trawls the folder, looking for scripts to run when quickbattle opens and it does this by running the init function. If a script doesn't have this function it throws a hissy and chastises the scripter for clogging up its folder!

The function that creates the message box is in the 'LoadEngineeringExtension' File in the Autoload Folder. I presume it was originally designed for scripts which pre-dated QBAutostart, because it looks for the Mod Author and other details (which most scripts it finds nowadays wouldn't have!)
http://captainsordersdevelopmentblog.blogspot.com/2011/12/preview-no-1.html- Captains Orders Development Blog - Last Updated 10/12/2011

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: i forgot how to do this...
« Reply #3 on: May 10, 2018, 08:38:46 PM »
also, which one of Sneaker98's scripts takes out Inaccurate Phasers"?
i know ive done it before but cant remember exactly...
old age and all...


edit:
nvm, found it...
http://www.bc-central.net/forums/index.php/topic,3282.0.html


i miss you MLeo!!!!!

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: i forgot how to do this...
« Reply #4 on: May 10, 2018, 09:57:28 PM »
also, which one of Sneaker98's scripts takes out Inaccurate Phasers"?
i know ive done it before but cant remember exactly...
old age and all...


edit:
nvm, found it...
http://www.bc-central.net/forums/index.php/topic,3282.0.html


i miss you MLeo!!!!!
The stock sensor ranges (approximately 2000 for most ships) give atrocious accuracy if you have inaccurate phasers installed.  I usually up it anywhere between 6000-10,000 and it's much more manageable and actually gives some reason to play with sensor power settings in QB.

Offline Defiant

  • Posts: 398
  • Cookies: 1105
    • BC: Kobayashi Maru
Re: i forgot how to do this...
« Reply #5 on: May 11, 2018, 02:41:25 AM »
Earlier versions of QBautostart just loaded all plugins by importing all files in Cutom/QBautostart/. Things like Button creation was just done in the global space of the files. However this created problems, e.g. in Multiplayer when a player was killed and needed to rejoin the match. Multiple Button creations or worse crashes were the result. That was the point where I added the handlers like init(), NewPlayerShip() or restart(). But that of course only works if all scripts are updated to use the new handlers, which why this check was added.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: i forgot how to do this...
« Reply #6 on: May 11, 2018, 02:40:14 PM »
Earlier versions of QBautostart just loaded all plugins by importing all files in Cutom/QBautostart/. Things like Button creation was just done in the global space of the files. However this created problems, e.g. in Multiplayer when a player was killed and needed to rejoin the match. Multiple Button creations or worse crashes were the result. That was the point where I added the handlers like init(), NewPlayerShip() or restart(). But that of course only works if all scripts are updated to use the new handlers, which why this check was added.
aaah i see...  now i understand...

If the script works fine without it, go down to the bottom, add the following and it should stop generating the error message:

Code: [Select]
def init():

# We don't need no de...finitions - hey, teacher, leave this script alone!

return0
right right - i totally forgot about that...
everything is a-ok now  :)