Jump to content

Recommended Posts

I have made a little utility to help with editing/organising script files.

It makes it more convinient to edit scripts, but it will not prevent you from entering invalid/game-breaking values. Basically you still need to work out what goes and what dosen't, it just means you dont have to remember what the number for x is or cut and paste etc.

back-up your files and use at your own risk! smile.gif

[EDIT: 4th June 06]

------------------------

updated for SC 1.1

SCScriptEditor1.01.zip

readme.txt

SC Script Editor v1.01

---------------------

ben CG

(see notes at end for change log)

This utility makes it more convinient to edit scripts, but be warned it will not prevent you from entering invalid/game-breaking values.

I highly reccomend copying the game campaigns and editing the copies instead of the originals.

Tips:

Double-click on a parameter to bring up the edit parameter dialog

Right-click on the scripts tree or the Parameter list to show available actions

File Menu:

- Load prompts for a campaign folder and loads all the scripts into the utility

- Save saves the modified scripts back to the same folder loaded from

- Save As prompts for a new campaign folder and saves modified scripts to there

Edit Menu:

(scripts)

- Add Script

- Add $ScriptName Add a new script to the appropriate file

- Delete Script Delete the selected script

- Move Script Up

- Move Script Down Change selected script's order in ScriptFile

- Move Script To

- Clone script Copy selected script to the end of the scriptfile

(parameters)

- Add Parameter

- Add $ParameterName Add a new parameter to this script

- Edit Parameter Bring up the Edit Dialog to edit the selected Parameter

- Delete Parameter Delete the selected Parameter

- Move Parameter Up

- Move Parameter Down Change selected paramater's order in Script

- Move Parameter To

- Copy Parameter(s) Copy selected paramater(s) to clipboard

- Paste Parameter(s) Paste paramater(s) from clipboard to current script if possible

note: You can now select more than one parameter from a script at once to enable copying/pasting of multiple parameters. For all other operations the action will only affect the first selected parameter.

change log:

-----------------------------------------------------------------

v1.01 changes

Updated code to reflect changes in SC 1.1 patch;

added amphibious research tech back (ie. un-commented 2 lines)

added steal enumeration and changed steal variable (from generic boolean value to specific enumerated value)

added variable_condition to activation2 scripts

added aligned_country_id variable to condition_position parameter in activation2 scripts

fixed bug with destination_resource in unit scripts

-----------------------------------------------------------------

v0.95 changes

Added clone script command. Copys the selected script to the end of the scriptfile (changes the name but all other parameters are copied exactly)

Added copy/paste commands for paramaters. You can now select 1 or multiple parameters and copy their values to a clipboard from which you can paste them into different scripts. The utility will prompt you to replace or add paramaters as appropriate - paramaters that are not valid for the script they are being pasted into will simply be ignored.

-----------------------------------------------------------------

v0.92 changes

new scripts now add default blank parameters as they should be written to file, ie. it should now compile them as is. :D really!

-----------------------------------------------------------------

v0.91 changes

fixed silly bug that saved blank string-only parameters with a space in them

made it so the scriptfile treeview updates when you edit a #name or #country_id parameter (changes label or icon in the treeview)

new scripts now add default blank parameters as they should be written to file, ie. it should now compile them as is.

removed unused amphibious warfare tech parameter from new research scripts

[ June 04, 2006, 08:42 AM: Message edited by: benCG ]

Link to post
Share on other sites

Wow! This is really awesome Ben. I haven't used it much yet but just looking at what you've done is amazing. The popup boxes and drop-down lists make it so much easier to make changes, and the icons are very nice!

I'm only a *little* wary about it, in that if there is a bug in the program (say I choose Garrison from the drop-down, but it's Offensive instead) it'll be tougher to figure out what's wrong when I test the scenario. But, barring any "bugs", this program will prove extremely useful.

Definitely recommended for scripters, and those new to scripting. Everything is organized and laid out in more "plain english".

Link to post
Share on other sites

Thx, you should be a good tester I think. I am lazy and irritable when I have to scroll back and forth and remember what numbers means what, and I can turn out little tools like this pretty quick in .net... I even reused some previous code of mine so it seemed obvious.

The 'out->' tab shows you exactly the text as it will be written to the file, so you can double-check that Garrison really is being written as #PLAN_ID= 0 for reassurance.

Link to post
Share on other sites

Ah, very nice! That's ok that it doesn't check the scripts for errors anyway, since any changes would require a new save of the campaign and thus an automatic script check.

I just finished testing and am about to go back and do some editing, so...will definitely give this a full run through now. smile.gif

One thing so far, I've added a new script and typed in a new name but the new name doesn't show up in the drop down list to the left. It still says, "new Plan Script #114". I'm noticing that any kind of renaming doesn't change the name on the left-hand side. When I save, exit and then re-load the campaign the new names DO show up however.

Also, when I made a script I left blank a lot of fields which causes errors when compiling the script. It's not a big deal, but it'd be nice if the scripts contained the default code when you create a new one (Ie, if I don't put anything in for Infantry Research, it'll still have the 0 [0] in the script). As it is now it leaves it blank, which the compile doesn't like too much. smile.gif

I just tested a scenario after using the editor and found I was getting inundated with popups. I compared the 'before' and 'after' scripts, and apparently a single space is being added by your program to the #POPUP= .

I also noticed a research tech in there called "Amphibious Warfare", but only when I created a new script...sign of things to come maybe? ;)

I have to say that so far this is a must-have program for scripters, especially once some of the current (minor) bugs are ironed out. It makes things much easier to do and saves a ton of time when searching. Great work! This program should be stickied, imo.

[ May 13, 2006, 12:29 AM: Message edited by: Timskorn ]

Link to post
Share on other sites

Just a quick tip for those using the program. All of the scripts are given a space after #POPUP= so everything that activates during a game will give you a blank pop up (a lot!).

Open up ALL of the txt files (Plan, activation, war entry, research, etc) and use the Replace feature under edit. Replace #POPUP= with #POPUP= and then Replace All.

Make sure there is no space after the = sign.

[ May 13, 2006, 09:58 AM: Message edited by: Timskorn ]

Link to post
Share on other sites

thx for the bug reports & feedback smile.gif and er, sorry about the popup bug - because I found and killed that one before... not sure how I put it back in :|

0.91 changes

------------

fixed the popup bug (no more 'one space' lines)

made it so the scriptfile treeview updates when you edit the name or country_id parameters (changes label or flag-icon in the treeview)

new scripts now add default blank parameters as they should be written to file, ie. it should now compile them as is.

removed unused amphibious warfare tech parameter from new research scripts

SCScriptEditor0.91.zip

readme.txt

---------------------------------------

as for the amphibious warfare tech parameter, I just copied it straight from the list in the txt file without paying it any mind - so at some point HC was at least considering AW tech... tongue.gif

[ May 13, 2006, 02:25 PM: Message edited by: benCG ]

Link to post
Share on other sites
Originally posted by fantomas:

It does not wok on my computer : when I lunch the program, I have juste this window error : " The application did not lunch correctly (0xc0000135). Click on "OK" for closing the application". :(

Any solution ?

I should have mentioned before that you need .NET 1.1 installed on your system in order to run the utility, dunno if thats the issue but hopefully thats all it is.

get .NET 1.1 install from m$ www

Link to post
Share on other sites

benCG:

I am having touble using the edit parameter feature. When I right click on the parameter and click on edit parameter, I get the small edit window. I can change the parameter in that window, but can't figure out how to save the change to the script. Can you tell me what I might be doing wrong, or missing?

Link to post
Share on other sites

Very nice BenCG smile.gif This was something that I always wanted to do way back when I first started implementing the whole script system but never found the time... although I don't think I could have come up with something as nice as this smile.gif

I'm thinking that perhaps I can eventually add some command-line parameters to the Editor.exe that will allow you to run a compile of the scripts from your program as well as output the proper error messages that ideally can be interpreted by your program as well... this could eventually work very nicely indeed.

I think after the first patch if you are up for it we can hopefully put something together that will make both programs that much more useful... what do you think?

Link to post
Share on other sites
  • 3 weeks later...
  • 3 weeks later...

This should be bumped. Ben, could you upload this to cmmods.com? Wouldn't want the only link for it disappearing in the forums.

This tool has really been invaluable and making editing faster and more efficient. There's really no reason not to use this program if you edit scripts.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...