Download ETScript 4 beta!


(Diego) #21

One other thing, You have the preferences set up to use the etmain/maps directory. However, I don’t usually work in the etmain directory. With the exception of my .bsp and .map files, I keep all of my scripts, textures, sounds, etc in a data directory outside of ET. This makes it easier for me to keep my stuff separate from stock resources. I always test the map by building a pk3 file and copying that back into my etmain directory.

So what I’m getting at, is can you set it up so that the preferences will allow us to choose a script directory other than the etmain/maps dir? Maybe just give a nag saying “this is not your etmain/maps dir, is this ok?” and let me choose the directory I want?


(Flippy) #22

I could do that. But if you don’t choose your etmain/maps directory that means my application will not be able to read the BSP file and import all entities. Also, it will save an XML file that stores bookmarks in the same folder, I don’t know if that is a problem?


(Diego) #23

When editing the Syntax colors, The apply button does not work. So I have to close the menu to get the changes to take effect and then reopen it again if I’m not happy with the result.


(Flippy) #24

Actually none of the options are set immediately when pressing Apply. That’s mainly because it used to be different: usually you had to close and re-open the entire script in order to see any changes to the options (because they are only loaded when the script opens). Just before release I decided that was not very good and I made it work so that the options come into effect once the options window closes. I guess I forgot about the Apply button hehe… Right now all it does is save the settings, but you’ll have to close the window in order to see the changes.
There’s an easy fix for that and will be implemented in the next version.

Thanks!


(Diego) #25

Looks like I was on to the problem at the same time as you. This is how I have it formatted now. But why does this one have the green highlighting in the outline?

Ah, thanks for the tip on the menu buttons. I had gotten to that point, but I had misinterpreted the “rearrange commands” button to mean that it will just re-order the existing ones not add new ones.


(Diego) #26

Ah ok. How about 2 prefrences, 1 for your etmain/maps directory to read the bsp, 1 for your script directory?

Obviously the easiest solution is for me to change my mapping habits. But it would be nice to be flexible.


(Flippy) #27

The green and yellow lines have nothing to do with outlining. I have called them Line Modification Indicators (although I’m not sure what they’re usually called :tongue:). You can also find an option to disable them if you want.

All lines with a yellow bar in front are lines that have been edited after you last saved the script.
All lines with a green bar in front are lines that have been edited, and then saved.

So yellow lines are indications to where you made changes. Green lines are indications to which changes have already been saved.

This way you can scroll through your script very quickly and see in which places you made modifications.

And about the preferences, that’s an idea. I could also allow the user to manually select the BSP file. There is for example also a problem with the default last-man-standing files, as they have separate script files, ending in “_lms”. Because the BSP’s are called differently ETScript won’t find them.


(Diego) #28

Ah, That’s cool.


(S14Y3R) #29

If we disable the line modification indicators will the ‘file/revert to backup’ -compare changes still work?

Doesn’t seem to disable using tools/options/text editor/checkbox, wanted to test above.
If it’ll mess with the reverting view, remove that button :stuck_out_tongue:

compare changes works great, that’ll come in very handy.


(Flippy) #30

You’re right, the option for the line modification indicators doesn’t work. I’ll look into that.

Also, it has nothing to do with the Revert to backup feature.

Finally I have seen the same error over and over when I try to view the changes of oasis.script…? Can anyone reproduce that? It doesn’t crash (you get the option to continue) but it still errors.


(Diego) #31

Is it possible to have the “find objects” work with collapsed classes? Perhaps uncollapse the class when it finds the text I was searching for?


(Flippy) #32

What do you mean by ‘find objects’? If you mean just Find & Replace, there is an option “Search in hidden text” that will allow you to search in collapsed nodes. If anything is found there the node is expanded.


(Diego) #33

Yeah, that’s what I meant.

For ease of use, I decided to migrate my scripts back to my etmain/maps folder so that changes to the bsp would be reflected in etscript. But that isnt’ working. Changes to entities are not being updated. Also, Whenever I load my script, I get an error saying the script was modified outside of etscript. But I haven’t been doing anything to the script from another editor.

EDIT:

Ok, I see what is causing the problem. When I build my pk3 file and copy it back into my etmain directory, ETscript is apparently looking at the script in the pk3 file instead of the one in my maps directory. Any way around this? I tried removing my pk3 files, and that does get rid of the error, but then ET does not see my maps. I thought it would read them from the etmain/maps directory without being in a .pk3 file, but apparently not.


(Flippy) #34

I don’t really understand…?

Changes in entities? How do you change entities?
The entities are only loaded when you first load your script. If you then change the map (bsp file) by building it again, you will need to reopen the script file to see those changes.

Do you get that error (it’s not really an error) when you open your script when ETScript is already open, or do you get that when you open ETScript, and it opens the last script automatically? Because if it’s the last, that is a bug.

When you save a script file, it not only saves the text to the script file, but it also saves a “filename_xml.xml” file in the same directory. This also stores the text, as well as the options for the editor, and the bookmarks etc.
When you select a script to open it, ETScript will first check if the XML file of that script exists. If it doesn’t, then it simply opens the script. If it does, then it opens the XML file (and loads the bookmarks etc). However, it is of course possible that you would edit your script outside of ETScript (notepad, etc) and if I would then let ETScript load the XML file, your changes would be gone. So I first check if the contents of the XML file and the actual script are the same. If they are not, I display this “error” to inform you that something has happened to cause the two files to become out of sync. If you choose to load the script file, you’re changes will be preserved, but bookmarks will be lost. If you choose the XML file, your bookmarks will be preserved but your changes will be gone…

Finally, ETScript does nothing with your PK3 files. It cannot read any script from the pk3 file.
You simply select a script, and that is the script it opens. It then looks for the BSP file (outside of a pk3 file) with the same name, and imports its entities.


(Diego) #35

Entity Changes in the BSP not being updated in etscript:

In this example, my script and bsp are in sync at the start, so ignore that part of my last post for now.

I added another func_explosive called “boxtest” in my map. I then added that same entity to my script. I then compiled the BSP file, closed and reopened etscript. In this image, you can see in the filters that my “boxtest” entity is there. However, the “boxtest” class in the script is not highlighted “pink” like my other
entities are.

Maybe this is just a bug in the highlighter code. But the last time this happend, I was renaming entities in my .map/.bsp file. I had to delete the .xml file and create a new one for etscript to perform the correct highlighting and recognize the changes to the entities.


(Diego) #36

Now, as far as my script file getting modified outside of etscript, I have no idea why it is giving me that error. I have not opened my scripts in anything but etscript since I migrated them to my etmain/maps folder and started with a fresh .xml file.

I was concerned about it reading the one in the pk3 file because in one instance, etscript was working fine, and then as soon as I added my pk3 to the /etmain directory it started giving me the error. But I was getting that error when etscript opened the script file for me upon startup, or if I opened the script file myself.

Right now, I have apparently gotten the script back in sync with the xml file. I’ll try to get you more information on it next time it happens.


(Flippy) #37

I see. Can you look in the Entity List to check that it is in there? I think I might know what the problem is: the XML file also stores the highlighted keywords (including entities). So when you load a file, it loads the old entity keywords. I think a simple fix is just to reload the entities into the syntax highlighter.

If you can confirm that the entities are indeed in the Entity List then that would be great.

EDIT
About the error. As I said, it happens usually when you start ETScript. When you start it, it will automatically open the scripts you had open when you closed it. When it tries to open the script this way, it does not check for the XML file properly and it can throw the error for no reason.

If you are getting the error also when using File - Open and selecting the script, then there is no other explanation than that your script and XML files are out of sync. I dunno how that happened then…?


(Diego) #38

That screenshot that I posted shows the boxtest entity in the entity list window but at the same time is not highlighting the enitity in the script correctly.

By the way, this tool has been really great so far in helping me clean up my script.


(Flippy) #39

Oops, I must be blind hehe… Ok, then I’m pretty sure what the problem is and there’s an easy fix.

Cool :slight_smile:


(Flippy) #40

I’m fixing some of the bugs as we speak.

I already fixed the options bugs (Apply button + line modification info) and the AutoBackup Manager bug.

I’m having a little more trouble with the outlining bug though, that might take a little while…

Also, I’ve not been able to reproduce the contextmenu bug, which I find a bit disturbing lol?! I saw it once, and so did other people, but never after that…

While working on the ‘etmain\maps’ directory ‘bug’ I had a new idea. I have decided to keep the directory option as it is, but I am adding a new option: the script directory. The script directory will default to the same as the etmain\maps directory (because that is what most people use I think) but you can change it to anything you want. The only thing it will really be used for is for displaying the Open/Save File dialogs in that directory initially.

Right now, the etmain\maps directory is also used in the File Browser taskpane. I decided that I’m going to change that quite a bit. It will still hold the maps directory by default, but it will now also hold the scripts directory you selected, AND you get the option to add additional folders. So you can simply select a folder, and all the script files (only script files) in that folder (including sub-folders) will be added to the File Browser treeview.