Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

[Sugarcube 2] - Using an external editor

edited February 2017 in Help! with 2.0
As I've mentioned before, I am very green as far as JavaScript is concerned, so the code I'm using is something I found on StackOverflow. Essentially, I'd like to be able to edit my passages in Notepad++ and then link to those files within the passages. Is this possible how I'm attempting it (or in any other way)?
<<silently>>
<<script>>
$(document).ready(function() { 
    $('#pageContent').load('test.html');
}
<</script>>
<</silently>>
<div id="pageContent"></div>

Comments

  • edited February 2017
    The only way I know to use an external editor is to work with the Twee2 compilator or some equivalent tool. I found it relatively nice.
  • I use notepad++ for big passages with a lot of code. I set up a custom language for the macros I use most often in SugarCube. Then I just copy-paste whatever I have done in notepad++ back over to the equivalent Twine passage once I'm done editing.

    This is it, if you'd like to use it. It's meant to be used with the Mono Industrial theme so you might have to change the colors to suit your needs.
    TQ0CGL8.png

    Here's the download for the xml.
    SugarCube UDL.xml
  • I use notepad++ for big passages with a lot of code. I set up a custom language for the macros I use most often in SugarCube. Then I just copy-paste whatever I have done in notepad++ back over to the equivalent Twine passage once I'm done editing.

    This is it, if you'd like to use it. It's meant to be used with the Mono Industrial theme so you might have to change the colors to suit your needs.

    I installed that XML file awhile back (if it's the same as this one, that is). I just switched to Mono Industrial per your suggestion but all my text has a white background. Did I fudge something when I was defining the language or did I make some other error?

    SugarCubeText.png

  • I think notepad++ has trouble with exporting see through backgrounds. You can go into the language, to edit it and right click on the secondary color for all the styles except comments to fix it.

    You can also change it up for yourself if you need to style different tags and such. Just take a look at the delimiters and it's pretty self explanatory.
  • Ah, and I forgot to mention. It is not the same one as the one in that post. I made my own, so it will be different for many things.
  • I rather like the formatting in general. It's a fair bit easier on the eyes, but the syntax highlighting seems a little off, or inconsistent, on my end. Still, cheers.
  • ... but the syntax highlighting seems a little off, or inconsistent, on my end.
    Try using the <</macro-name>> syntax of end-macro tags instead of the <<endmacro-name>> syntax.
    Use
    <<if $var is "value">>.....<</if>>
    
    Instead of
    <<if $var is "value">>.....<<endif>>
    
  • greyelf wrote: »
    Try using the <</macro-name>> syntax of end-macro tags instead of the <<endmacro-name>> syntax.

    That's a fair point and I honestly forgot I had even been doing that.
Sign In or Register to comment.