Besiege Scripting Mod v.0.1.4 [spaarsModLoader v.1.4.1] [Besiege v.0.3]

#1
Greetings everyone!

A few of you might still know me, as I worked for a short time on the modloader. I've been working on this though for the last couple of weeks and I'm pretty happy with what it is right now.


This mod let's you write Scripts for Besiege in multiple languages, namely CSharp, Lua, Python, UnityScript, TrumpScript, Brain**** and Ook.


In order to do that just put the Mods folder into your Besiege_data folder on Windows/Linux or the Contents folder on Mac. You can locate the Besiege_data folder by right-clicking Besiege in Steam and select "Show local files" or by locating your manual installation. On Mac right-click on Besiege and choose "Show content".


When you start Besiege, press CTRL+L when it fully loaded. You should now see the main window of the Scripting mod, with the instructions on how to write Scripts with it.


There are two commands for this mod, namely "ScaleX" and "ScaleY". Use them as
Code:
(command) (scale factor in form of a double)

I got a github repo set up for it as well, so if you have any issues with the mod, or suggestions, feel free to write them here or on the repo.


I hope you'll have fun with the mod!

Instructions:

How to write a Script and execute it
1. Select an IDE (you can hover your mouse over any button to see a more detailed description).

2. Press Add References and input a name for your script. This is important during compilation. Additionally, you can already input more references, which your script will be using.

3. Press Add References again to get back to the source code editor. Now you can write your script. DO NOT SWITCH YOUR IDE AFTER WRITING YOUR SOURCE CODE. It would be overridden. When you're done, proceed with Point 4.

4. Press GameObject Options. A submenu should show up with Choose GameObject(s), Show Selected and Add Default.

4.1. Choose GameObject(s) Let's you select the GameObjects your Script should be attached to when you execute it. If you press it, the editor window should be invisible and a help message with further instructions should pop up in the top-left corner.

4.2. Show Selected Let's you see the selected GameObject(s). You can click on one to remove it.

4.3. Add Default Adds the Default GameObject to the List of selected GameObjects. It is the GameObject, which the ScriptingMod is attached to and is named MortimersScriptingMod

5. Execute compiles the script and attaches it to the selected GameObject(s).

5.1. Special cases for the IDEs Brain****, Ook and UnityScript. In order for them to work, you have to press Convert first. This converts your source code into C# Source Code. This happens in order for you to be able to fix any issues that came up with the convertion.

6. Stop Script displays a List of currently running Scripts. Press the left MouseButton while hovering over one to destroy it. OnDestroy will be called.

7. Load displays a List of saved Scripts. Scripts are saved when you execute them, in order to reduce data garbage on your harddrive with non-working prototypes of your Script. Click on one and the Script will be loaded into the Source Code Editor.

8. Display C# Source will let you switch between your original Source Code and the converted one. Only available for Brain****, Ook and UnityScript.

Additionally, if you want to resize the window, you can enter ScaleX [value] or ScaleY [value] into the console
Deleting a Script is done by right clicking it in the 'Load' screen

Downloads:
Github



Documentation:
Github



Latest Changes:

#v.0.1.4 Enhancements
- New Languages can now be added by using the LanguageExtension class and by naming them scriptextension.dll at the end, docs will follow
- A SettingsGUI is now available by pressing Left Alt and L which can be changed in the KeyMapper of the Modloader
- A basic version of an API is now available, docs will follow
- All Keys are now changeable in the KeyMapper of the Modloader
- The Selection, Deselection and Attachment of GameObjects is now faster and uses less computing power
- Added Settings being saved now
- Refined Project Structure
- First steps for real Wiki, planned is additionally a whole tab about GUI stuff
- See Merge


Full Changelog:
Github



Future plans:
If you are interested in it, all of the plans are written down here



License:
The mod is released under the General Public License 2.0
 
Last edited:
#3
UPDATED YAY

#v.0.1.3 Fixes and Update to Besiege v.0.3
- Fixed standard Python script errors
- Rearranged GUI a bit, still WIP
- Popup when Brain**** or Ook wants a keyboard input
- Updated to Besiege v.0.3
- Added TrumpScript
- Fixed Bug where saved Scripts are saved wrong
- Known Bug: Standard Ook script is using way too many keyboard inputs, consider writing it yourself again
- Known Bug: TrumpScript might not support every method, due to how it works with words
 
#4
Another Update, hoorayy



#v.0.1.4 Enhancements
- New Languages can now be added by using the LanguageExtension class and by naming them scriptextension.dll at the end, docs will follow
- A SettingsGUI is now available by pressing Left Alt and L which can be changed in the KeyMapper of the Modloader
- A basic version of an API is now available, docs will follow
- All Keys are now changeable in the KeyMapper of the Modloader
- The Selection, Deselection and Attachment of GameObjects is now faster and uses less computing power
- Added Settings being saved now
- Refined Project Structure
- First steps for real Wiki, planned is additionally a whole tab about GUI stuff
- See Merge
 
Top