Bridge Commander Central

BC Forums => BC Scripting => Topic started by: baz1701 on May 20, 2009, 06:21:50 AM

Title: Editing ship plugins in Notepad
Post by: baz1701 on May 20, 2009, 06:21:50 AM
When I edit any of my ships HP's or PY's in notepad everything works fine with the exception of the py in the custom ship folder.

I have to make this py via the plugin software and the ship then works. If I try editing that script, everytime I restart the game I get a black screen and the BC mouse pointer! Remove the script and all is well again.

I want to add stuff to my py, am I doing something wrong?
Title: Re: Editing ship plugins in Notepad
Post by: Kirk on May 20, 2009, 06:45:30 AM
Try using an editor like Notepad++
Title: Re: Editing ship plugins in Notepad
Post by: baz1701 on May 20, 2009, 08:09:47 AM
thanks, I have added the script to the ship. and the ship works in game. I can not try the mod until I get home as my laptop does not have KM installed on it.
Title: Re: Editing ship plugins in Notepad
Post by: JimmyB76 on May 20, 2009, 09:49:21 AM
why not use BCUT for ship plugins?
Title: Re: Editing ship plugins in Notepad
Post by: Kirk on May 20, 2009, 09:54:11 AM
I don't think BCUT does everything, yet. For example, I don't think it does the Auto Bridge Switch plugin.
Title: Re: Editing ship plugins in Notepad
Post by: JimmyB76 on May 20, 2009, 11:46:20 AM
indeed - you should bring that up to sovvy, maybe he can include it :)
Title: Re: Editing ship plugins in Notepad
Post by: strekship on May 21, 2009, 08:33:45 PM
I think Python is sensitive to indents. If so, notepad might be messing up the indents and spaces.
Title: Re: Editing ship plugins in Notepad
Post by: MLeo on May 21, 2009, 08:43:52 PM
Sensitive is probably not the right word, it uses whitespace to define scopes, and it therefore needs consistent whitespace to be able to distinguish scopes.

Notepad, usually, doesn't mess with whitespace (it's to simple for that), what it does do has to do with two characters, newline and cariage return. Some of the more advanced editors only use newline, and Python doesn't mind (it just sees newline and cr as new lines), but notepad requires for an "Enter" first a newline and then a cr (it's a Windows convention, Mac, for example, uses cr and then newline, unix it was just newline and practically every operating system has it's own conventions regarding these two characters). This means that if you open a python file with just newlines, and then save it, there is a big chance it will ignore the newlines (everything on one line), Python doesn't like that.
Title: Re: Editing ship plugins in Notepad
Post by: USS Frontier on May 22, 2009, 01:02:16 PM
Honestly, pratically all scripts I make/edit in BC I do it with WordPad, and a few others with Notepad.
Dunno why, just prefer using WordPad than NotePad to type and all... tho Notepad shows the line number which Wordpad doesn't lol

I never had any such problems...