• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

EasyVent Editor Super Perfect v1.91 BugFix [King Needed a Band-Aid.]

Started by RavenOfRazgriz, September 05, 2011, 07:57:43 pm

RavenOfRazgriz

Sweet.  Thanks much, Lirmont.  I'll be inserting and testing this code tonight to make sure everything works as intended.  If all goes well it looks like I'll have pretty much all the functionality for the primary editing window down in version 1.8.  I've also just thought of a solution for the error message... erm... errors, so we should be good there too.

Looks like I'll be pulling this release together pretty quickly once I can sit down and put the work on it, provided I don't hit anymore hitches.

3lric

Quote from: RavenOfRazgriz on December 25, 2011, 10:44:22 am
Can you toss me a text list of the stuff in that video, Elric?  Much easier to reference when editing.

Also, I just brute-forced TEST.EVT so I can be sure all the Events I labeled as *None* on the Wiki and in EasyVent were actually empty.  The only one that was occupied was x194, which is the Game Over Event.  I'll be adjusting EasyVent Editor Super Perfect's information to reflect this in the next update as well as adjusting the reorganization in Vanilla Plus to work around this.

Yes, this means I'm finally looking over things and beginning to work on EasyVent Editor Super Perfect v1.8. 


Awesome cant wait  :mrgreen:.
And sure, no problem man, i already have a txt document with a few things regarding EasyVent in it, so i will get all the unitanim's written down as well as the differences in rotation for the different types of standing.
I will send it to you within the next day or 2
  • Modding version: PSX

RavenOfRazgriz

Sounds good.

Lirmont - The cursor insert thing you gave me (the bottom one) works perfectly, I have the command inserting where the cursor is placed instead of at the EventEnd() command.  Perfect!  I'm having one big issue with the Comment code though - when I load an Event from my source files, everything after the //INSTRUCTION SECTION END - TEXT START comment is green instead of just the comments.  Any idea why?  The code's also gets really touchy on longer textbox entries (which most events are) jumping and showing off highlights and otherwise looking unsightly, but I'm thinking up a workaround for that to restrict how often the command is run to just the absolute essential moments.

Stuff implemented for the 1.8 release so far:

Bracket () and French Brace {} counters.
Command Insert at Cursor.
Verified fixing of SpriteMove Generator.
Verified Save/Load naming logic works as intended.

Stuff I'm trying to get to work:

Green Comments.

To-do:

Update Decompiler/Compiler commands and Help Files.
Fix Error Messages so they work/output properly.

If there's anything feature-wise you feel is missing, now is the time to tell me because I'll be releasing this in a few days tops from the looks of things.

Twinees

IIRC the map numbers on your editor arent the same as the ones on the front page of FFH, which might be causing problems with ChangeMap?
  • Modding version: PSX

RavenOfRazgriz

They are the same numbers, and they wouldn't affect the ChangeMap() command aside from causing you to accidentally grab the wrong map, of which you could quickly figure out the difference in number and find the correct map.   I actually converted them to Hex for the expressed purpose of making ChangeMap() easier to use, because it accepts a Hex value, not a Decimal value.  If the ChangeMap() command is/isn't working, it has nothing to do with EasyVent Editor Super Perfect, but the command itself.

RavenOfRazgriz

About that error I had posted about earlier - I fixed it and made the feature even more robust than I was originally planning by basing my loop on Lirmont's Green Comment code.  Now it'll tell you if you're missing an Opening Parentheses, Closing Parentheses, Opening French Brace, or Closing French Brace and tell you which line the missing Parentheses or Brace is located at. 

I still need to find out why that code is giving me issues in the text section of a loaded event, though...

3lric

Unitanim stuff
In UnitAnim
01
02

Are correct standing animations tho they use a different rotation set, these would be the correcting standing poses versus 06, 07, 08 since those are for when they stand still in battle.

EDIT: I made a video of all the Character Unitanim (since some monsters are different) they are numbered rather then named but they should be pretty simple to figure out.
You can see it here:


Rotate
you have Rotate setup as
RotateUnit(xID,xNE,xDR,xCL,xRS,xTM)

but it should actually be

RotateUnit(xID,xNE,xDR,xCL,xRS,TIM)


Camera Stuff
Camera(+XXXXX,+YYYYY,+ZZZZZ,+ANGLE,+MAPRT,+CAMRT,+ZOOM%,+TIMER)

but it should actually be

Camera(+XXXXX,+ZZZZZ,+YYYYY,+ANGLE,+MAPRT,+CAMRT,+ZOOM%,+TIMER)

Example

Camera(+00750,-03000,+00400,+00450,+00128,+00000,+04096,+00256) Camera goes up
and
Camera(+00750,-00150,+00400,+00450,+00128,+00000,+04096,+00256) Camera comes back down


ColorField
Currently
ColorField(xID,xPR,+RED,+GRN,+BLU,+TIM)

Should be
ColorField(xID,+RED,+GRN,+BLU,+TIM)

xPR is only for UnitColor


Changemap
Currently
ChangeMap(xMP,x00)

Should be
ChangeMap(MAP,x00)


AddUnitStart / AddUnitEnd

{49}()
UnitPresent(x34,x00,x01)
AddUnitStart()
Wait(00030)
AddUnitEnd()

Ok, so i don't know what command {49}() is exactly,
but it is required for AddUnitStart() and AddUnitEnd()
to work.

The UnitPresent, just says unit 34 is loaded to memory, and the 1 says that it is not yet drawn to the map

After the AddUnitEnd() you can call any unit that was made present in the UnitPresent Command into the event
with the draw command, ignoring their present settings in the ENTD.

You can add more then one unit at a time as well, i just used one fore an example, another example would be


{49}()
UnitPresent(x01,x00,x01)
UnitPresent(x0F,x00,x01)
UnitPresent(x13,x00,x01)
UnitPresent(x15,x00,x01)
AddUnitStart()
Wait(00030)
AddUnitEnd()

BlockStart()
Draw(x01,x00)
Draw(x0F,x00)
Draw(x13,x00)
Draw(x15,x00)
BlockEnd()

Wait(00010)

BlockStart()
UnitAnim(x01,x00,x02,x00,x00)
UnitAnim(x0F,x00,x02,x00,x00)
UnitAnim(x13,x00,x02,x00,x00)
UnitAnim(x15,x00,x02,x00,x00)
BlockEnd()

This example would call the units 01, 0F, 13, and 15 all to the field and make them stand



WarpUnit
Directions should be:
North:  02
South: 00
East:   03
West:  01


In regards to the ChangeMap i intend to cover how to make it work correctly when combined with WarpUnit, in my tutorial, once it's finished

Anyway here is the list for Unit Animations, as well as the 2 different Rotation types that are dependent on which type of standing pose you are using:


  • Modding version: PSX

RavenOfRazgriz

Changelog update incoming.  Much thanks to Elric with his updated info on known commands and pointing out errors in my Help files.

Stuff Finished, Debugged, Added:

Parentheses and French Brace Checker.  (Runs automatically when you attempt to Save your Event.)
Commands Insert at Cursor Location in Event Window.  (Works for Choose a Command, Camera Generator, SpriteMove Generator.)
Camera Generator fixed.  Had to reverse the YYYYY and ZZZZZ, and it wasn't calculating Heights (Z values) correctly.
SpriteMove Generator fixed.  It also wasn't calculating Heights (Z values) correctly.
Updated Help and Command files for UnitAnim, RotateUnit, Camera, ColorUnit, ColorField.
Changed Event x194 from *None* to Game Over Event in all Dropdowns, added the Event to all sets of Source Files.  Verified all other *None* Events actually contain nothing.

Stuff I'm Struggling With:

Green Comments still coloring all text after the //INSTRUCTION PART END - TEXT START comment instead of just the comments after that part.  Error only occurs when loading an event from a file.  Pasting from a different Notepad into the editing window has the code functioning properly.  I have no idea why this is, and if I can't figure it out soon or Lirmont shed some light on this, Green Comments are going to be scrapped for the v1.8 release.

Stuff I Still Need to Implement:

{42}() becomes EarthquakeEnd()
Fix Compiler/Decompiler Error Message outputs.


EDIT: Also, Elric, if you can write down what values for ChangeMap can be used to call each map, I'll update my drop-downs and such with them.  Or add a list to the Help file.  Or something.

3lric

Quote from: RavenOfRazgriz on December 27, 2011, 01:13:18 am
EDIT: Also, Elric, if you can write down what values for ChangeMap can be used to call each map, I'll update my drop-downs and such with them.  Or add a list to the Help file.  Or something.


Done, now hopefully people can figure this out since it's really rather easy.
lol I just tested it right now with WarpUnit and i will make a video sometime tomorrow, explaining dealing with the camera when doing this as well for people who would benefit from it.
  • Modding version: PSX

lirmont

Well, if it's highlighting something it shouldn't, that means the offset is wrong (which means what I provided you was wrong). Here's a more involved solution that goes line-by-line through what's displayed to the user, checking against a string array to see if it needs to format the line or not after locking the control. The first function is an imported one for locking/unlocking the control, the second one is the highlighter, and the third one invokes the highlighter when you scroll the window. The functionality of the third one could have been better linked to the VScroll event, but I didn't notice it until after I had written it.

   
    Private Declare Auto Function SendMessage Lib "user32.dll" ( _
        ByVal hWnd As IntPtr, _
        ByVal wMsg As Int32, _
        ByVal wParam As IntPtr, _
        ByVal lParam As IntPtr _
    ) As IntPtr

    Private Const WM_SETREDRAW As Int32 = &HB   

    Dim lastUsedStartIndex = 0
    Dim lastUsedEndIndex = 0
    Dim previousText As  System.IO.StringReader = New System.IO.StringReader("")
    Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
        Dim richTextBoxBufferObject As RichTextBox = CType(sender, RichTextBox)' Pass the control by reference (for use in copying

        Dim previousOffset = richTextBoxBufferObject.SelectionStart ' Get current offset for use with reseting text at very end.
        Dim displayedStartIndex = richTextBoxBufferObject.GetCharIndexFromPosition(New Point(richTextBoxBufferObject.Location.X, richTextBoxBufferObject.Location.Y+1)) ' Get character index at location in form.
        Dim displayedEndIndex = richTextBoxBufferObject.GetCharIndexFromPosition(New Point(richTextBoxBufferObject.DisplayRectangle.Right, richTextBoxBufferObject.DisplayRectangle.Bottom-1)) ' Get character index at bottom right of RichTextBox.
        Dim lineReader As System.IO.StringReader = New System.IO.StringReader(richTextBoxBufferObject.Text) ' Prepare string reader for all text in RichTextBox
        Dim buffer(displayedStartIndex) As Char ' Prepare dummy object for use in following two methods.
        lineReader.ReadBlock(buffer, 0, displayedStartIndex) ' Skip forward to first displayed text.
        previousText.ReadBlock(buffer, 0, displayedStartIndex) ' Skip forward to first dispalyed text (in the previous buffer).

        ' Lock control by not sending it any events.
        With Me.RichTextBox1
        SendMessage( _
            .Handle, WM_SETREDRAW, New IntPtr(CInt(False)), IntPtr.Zero _
        )
            ' Do highlighting.
            Dim runningLength = displayedStartIndex
            Dim line As String = ""
            Dim previousLine As String = ""
            Dim lineCount = 0
            Do While (True)
                line = lineReader.ReadLine()
                previousLine = previousText.ReadLine()
                lineCount += 1
                If (line Is Nothing) Then
                    Exit Do
                End If
                ' If this line isn't the same as what we had stored before, format it.
                ' If this line starts earlier than the previously used start index, format it.
                ' If this line starts after the previously used end index, format it.
                If line <> previousLine OrElse runningLength < lastUsedStartIndex OrElse runningLength > lastUsedEndIndex
                    ' Otherwise, clear line to black.
                    Dim currentOffset = runningLength
                    richTextBoxBufferObject.Select(runningLength, line.Length)
                    richTextBoxBufferObject.SelectionColor = Color.Black

                    ' Update line to green.
                    If line.IndexOf("//") <> -1 Then
                        Dim offsetOfComment = richTextBoxBufferObject.Find(str:="//", start:=runningLength, [end]:=runningLength + line.Length, options:=RichTextBoxFinds.None)
                        If offsetOfComment > -1 Then
                            currentOffset = runningLength
                            richTextBoxBufferObject.Select(offsetOfComment, (runningLength + line.Length - offsetOfComment))
                            richTextBoxBufferObject.SelectionColor = Color.Green                   
                        End If
                    End If
                End If
                ' Increase running length.
                runningLength += line.Length + 1
                If runningLength >= displayedEndIndex
                    Exit Do
                End If
            Loop
            lastUsedStartIndex = displayedStartIndex
            lastUsedEndIndex = displayedEndIndex
            previousText = New System.IO.StringReader(RichTextBox1.Text)
            RichTextBox1.Select(previousOffset, 0)
        ' Unlock control by sending it events again.
        SendMessage( _
            .Handle, WM_SETREDRAW, New IntPtr(CInt(True)), IntPtr.Zero _
        )
        .Refresh()
        End With       
    End Sub
   
    Private Sub RichTextBox1_KeyUp( ByVal sender As System.Object,  ByVal e As System.Windows.Forms.KeyEventArgs) Handles  RichTextBox1.KeyUp
        If e.KeyCode = Keys.Down OrElse
           e.KeyCode = Keys.Up OrElse
           (e.KeyCode = Keys.Home Or Keys.ControlKey) OrElse
           (e.KeyCode = Keys.End Or Keys.ControlKey)  OrElse
           e.KeyCode = Keys.PageDown OrElse
           e.KeyCode = Keys.PageUp
            ' Get existing display for comparsion.
            Dim displayedStartIndex = RichTextBox1.GetCharIndexFromPosition(New Point(RichTextBox1.Location.X, RichTextBox1.Location.Y+1))
            Dim displayedEndIndex = RichTextBox1.GetCharIndexFromPosition(New Point(RichTextBox1.DisplayRectangle.Right, RichTextBox1.DisplayRectangle.Bottom-1))
            ' Compare to state prior to key event.
            If displayedStartIndex <> lastUsedStartIndex OrElse displayedEndIndex <> lastUsedEndIndex
                RichTextBox1_TextChanged(RichTextBox1, Nothing)
            End If
        End If       
    End Sub


As a note, I know how I'd do this in C#. Basically, you subclass a textbox control and take on the responsibility of drawing it yourself. There are Win32 functions that draw borders and text, so it's not as difficult as you might think. Basically, when the control would go to actually draw to the screen, you'd put the coloring in there, instead of after the fact. I tried looking up examples for how to do this in VB.NET, but I couldn't come up with a working example of that for you.

RavenOfRazgriz

Stuff Finished, Debugged, Added:

Parentheses and French Brace Checker.  (Runs automatically when you attempt to Save your Event.)
Commands Insert at Cursor Location in Event Window.  (Works for Choose a Command, Camera Generator, SpriteMove Generator.)
Camera Generator fixed.  Had to reverse the YYYYY and ZZZZZ, and it wasn't calculating Heights (Z values) correctly.
SpriteMove Generator fixed.  It also wasn't calculating Heights (Z values) correctly.
Updated Help and Command files for FUCKING EVERYTHING (see below)
Changed Event x194 from *None* to Game Over Event in all Dropdowns, added the Event to all sets of Source Files.  Verified all other *None* Events actually contain nothing.
Updated a bunch of commands in the Compiler.  Earthquake() -> EarthquakeStart(), {42}() -> EarthquakeEnd(), {49}() -> AddUnitPrep()  In addition, some "known" commands I'd added formatting to in EasyVent but forgot to update the Compiler with are also fixed.  This includes DismissUnit(), MovementAnim(), and AddUnit().
Renumbered all Maps on the dropdown list to correctly reflect the numbers they use when calling the ChangeMap() command.
Updated various dropdowns in other ways as needed.

Stuff I'm Struggling With:

Green Comments.  I've tested Lirmont's new code, and it's less jumpy and laggy by far, but it's not coloring everything after each // green.  It gets some of them, but it seems to get them at random, and I'd have no clue where to begin on debugging it right now.  It seems the location of my cursor has to do with what does and doesn't get colored, though.

Stuff I Still Need to Implement:

Fix Compiler/Decompiler Error Message outputs.  This is half-done, I have the method I want to do and some of the code I need, I just haven't done it yet since I found it maybe 20 minutes ago and am going to bed now.

I think we can expect a full release of EVSP 1.8 tomorrow, whether it has the green comments or not.  If Lirmont has no ideas of what's up, I'll try and thumb through the code on stepthrough myself and see what's wrong, but I'm incompetent so god knows if I'll find it.  For now, it's bed for me though.  As usual, if you think of a feature that should exist in EVSP, now is the time to tell me so I can try to add it for the v1.8 release.



As for FUCKING EVERYTHING on fixing those Help files - I thumbed through CONFIG.INI, comparing all of my rubrics such as Focus(xID,x00,xID,x00,x00), fixing all the ones that were messed up.  I then thumbed through a second time, clarifying a lot of the help files, data lists, etc.  I then went through a third time and fixed the formatting, removing unnecessary new lines, etc. to minimize the amount of Help files that require scrolling to read and to just generally make everything look both pretty and consistent, two things that are important for something help-oriented.  This was very un-fun and very time-consuming, let me tell you.

lirmont

You'll have to fine-tune the location it looks at for each control you use it on. I didn't test the control nested inside of anything or even away from the upper-left corner of the form (or with padding or with margins). Look that function up on MSDN, figure out what's different about your program, and go from there (that's where I'd start).

RavenOfRazgriz

December 29, 2011, 03:21:59 am #92 Last Edit: December 29, 2011, 04:23:35 pm by RavenOfRazgriz







Download EasyVent Editor Super Perfect v1.8 Here!  (MediaFire Mirror)

What Made It In This Version:

Updated ALL THE HELP FILES.
Command Insert At Cursor.
ROBUST AS HELL ERROR CHECKING. (Big Update of this Release.)
Camera Generator Fixes.
SpriteMove Generator Fixes.
Game Over Event Update.
Compiler Updates.

What Didn't Make It In:

Green Comments - I just didn't have time to debug them yet and didn't want to delay the update anymore.  Expect this in v1.81 if it happens, or v1.9 at latest.

What Robust as Hell Error Checking Means:




I think I need no words.

Eternal

Yay, you made an idiotproof version for me. I'm so happy! ;_;
  • Modding version: PSX & WotL
"You, no less human than we? Ha! Now there's a beastly thought. You've been less than we from the moment your baseborn father fell upon your mother in whatever gutter saw you sired! You've been chattel since you came into the world drenched in common blood!"
  • Discord username: eternal248#1817

Joseph Strife

Gaffgarion: It's in the contract!
Ramza: Does your contract says: "When you find a former squire, that now is a Holy knight that has kidnapped a princess, in a bridge by a waterfall fighting a brigade you are supposed to kill everybody that helps him!"
Gaffgarion: ... Sure!
Ramza: ... Let me see your contract...
Gaffgarion: ... No...


RavenOfRazgriz

Quote from: Eternal248 on December 29, 2011, 09:15:20 am
Yay, you made an idiotproof version for me. I'm so happy! ;_;

Quote from: Joseph Strife on December 29, 2011, 10:51:04 am
For us Et, Epic Raven! :)


It's epic when I see you lot cranking things out now, I'm trying to make this thing hold your hands as much as I can.

I have a couple ideas for improving the error-checking a bit more and one or two other things, it's just a matter of figuring out how to do a couple of the things I want to.  Taking a bit of a break before starting that up, though.

RavenOfRazgriz

December 29, 2011, 01:41:08 pm #96 Last Edit: December 29, 2011, 04:24:02 pm by RavenOfRazgriz
I updated all the download links.  I forgot to edit the names of two Notepad files in the previous v1.8 download.  In the Command List folder, 41 Earthquake.txt should be EarthquakeStart.txt, and in the Command List/Command List Folder, Earthquake.txt should be EarthquakeStart.txt.

If you've already downloaded, you can either download again or rename the above Notepads yourself, either will work.  Anyone downloading after seeing this message, the problem's already fixed, no need for you to worry about it.

Download EasyVent Editor Super Perfect v1.8 With Proper Notepad Files Here!  (MediaFire Mirror)

MysticKnightFF5

You should include a demotivator button. It yells something about how much of a failure you are when you hit it.

3lric

  • Modding version: PSX

RavenOfRazgriz

Thanks, Elric.

I'm putting together a to-do list for v1.9.  No clue when I'll actually make it, though.  If you have any thoughts or feedback on the ideas here, do give them to me, I'd like to hammer them out before trying to code them.

1.  Further Improved Error Handling. Basically, this means it'll check each of the arguments for your commands individually, and then tell you whether their length is correct.  So, if you put +0000 instead of +00000 for a +TIMER argument, you'll get an error to the effect of "+TIMER argument in Camera command on Line 12 is invalid."  Right now, there's some basic logic for this, but it's a basic thing that only checks to see if the length of your entire command is the correct length or not.

2.  Debug that fucking Green Comment code.  It's probably not worth the effort, but I want it working now if only because I'm fucking stubborn.

3.  Redo the Help files that load when you open the Camera Generator and SpriteMove Generator.  Currently, they load the Camera() and SpriteMove() Help files, but they should really be loading their own help files describing how to use the Generators.  I've had multiple people tell me it's confusing to figure out how the Generators work because the Help file describes pixels but they're not meant to input pixels into the Generators.

4.  Right Click Menu on basically everything.  What should this contain?  I've got Copy, Paste, Select All as obvious choices, but is there anything needed beyond that?

5.  Some form of auto-filling commands when you type them into the editing window.  Probably have it force you to type to the extent of something like DisplayMessage( then fill in the entire command with my rubric for you, and change the Help window on the right to the Help window of that command.  Thoughts on this, and/or thoughts on a better implementation of this?

6.  Better Event-naming.  Specifically, when you Save your event, it'll ask you to input a name.  Then, it'll pull your Offset from your Event, convert it to both an Event Script and a Decimal value, and save it in the EVT_SCR_DEC format output by Xifanie's Event Decompiler and used in all my source file folders, one without the name you chose for multi-compiling purposes, and one with your name concatenated on the end so you can easily identify it.  Then, I'll add some sort of open window logic for when opening events from a non-write protected Directory that you can use to choose and open your file.  I should've had proper file saving/opening logic in the very first release, but I'm retarded.

7.  Update dem commands.  Kokojo's going to be posting a list of ones he knows tomorrow, and I need to update the Help files for EffectStart(), EffectEnd(), and Effect().  Again, call out to anyone who knows any Unknown commands or has more info about existing commands.  More info is better info.

8. Your suggestion here?



No seriously, I need some feedback on all this shit, and suggestions if anything is missing on here.