[RELz] - Script Validator

Post » Mon Aug 09, 2010 8:14 am

I just had another look at the validator, and it seems that an update to Google Chrome, which changes the way it handles JavaScript strings, has broken the validator. For Chrome users, I recommend using Firefox until I manage to fix this.

Cipscis
User avatar
Alexxxxxx
 
Posts: 3417
Joined: Mon Jul 31, 2006 10:55 am

Post » Mon Aug 09, 2010 9:20 am

I just had another look at the validator, and it seems that an update to Google Chrome, which changes the way it handles JavaScript strings, has broken the validator. For Chrome users, I recommend using Firefox until I manage to fix this.

Cipscis


pff.

Mozilla 1.7.13 ftw!!! (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.13) Gecko/20060414).
User avatar
Sherry Speakman
 
Posts: 3487
Joined: Fri Oct 20, 2006 1:00 pm

Post » Mon Aug 09, 2010 12:52 pm

You haven't updated your web browser in over 4 years!? If I remember correctly, the only reason Mozilla is still available online is "for historical purposes only", so I don't think "FTW" is all that appropriate, lol. Then again, I guess it could be worse - you could be using IE6

Cipscis
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Sun Aug 08, 2010 10:12 pm

You haven't updated your web browser in over 4 years!? If I remember correctly, the only reason Mozilla is still available online is "for historical purposes only", so I don't think "FTW" is all that appropriate, lol. Then again, I guess it could be worse - you could be using IE6

Cipscis


offtopic browser-related stuff below

Spoiler
Has it really only been 4 years? I have archived email here in this client from December of 1999. I guess I can't keep track any more of which versions I was moving around between at the time.

I upgraded to Mozilla from Netscape sometime .. um.. I don't know.. I think some of this mail must have been imported from my old Netscape install? Mozilla was basically what replaced Netscape.

I never asked them to stop updating my browser of choice, splitting the email out of the web client and making nothing else available at the time that was like it.

I think firefox is nasty and always have. You cannot get away from extra indexes and frames and things that pop up due to hotkeys and other ridiculous things. It has a dumbed-down configuration that has the effect of hiding stuff if you happen to know exactly what you want to do. I never asked for any of that garbage.

Fortunately, Mozilla can still be downloaded! Too bad some web sites don't display properly in it (BBC news "in pictures" segments are off-limits to Mozilla, basically), and some even blow it right up. I have to fire up Internet Exploder and paste the link in if I want to see the blow-mozilla-up sites.

User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am

Post » Mon Aug 09, 2010 8:31 am

The validator should now once more be working correctly with Google Chrome, and has a couple of small UI upgrades. Sorry for the delay - I'd misdiagnosed the issue to begin with so the method I was trying to use to fix it wasn't working as I'd hoped.

Cipscis
User avatar
Schel[Anne]FTL
 
Posts: 3384
Joined: Thu Nov 16, 2006 6:53 pm

Post » Mon Aug 09, 2010 3:47 am

You haven't updated your web browser in over 4 years!? If I remember correctly, the only reason Mozilla is still available online is "for historical purposes only", so I don't think "FTW" is all that appropriate, lol. Then again, I guess it could be worse - you could be using IE6

Cipscis


I'll let you know, I've updated from IE 6 to IE 8 two weeks ago :P

Anyways, what current version of FOSE is supported?
User avatar
stacy hamilton
 
Posts: 3354
Joined: Fri Aug 25, 2006 10:03 am

Post » Mon Aug 09, 2010 7:42 am

Just a note - the highlighting doesn't work in IE, so if you want to see syntax highlighting in the validator you should use Firefox or Chrome.

The FOSE function definitions have been pulled from the http://fose.silverlock.org/fose_command_doc.html, which contains information on all functions except for a few which, if I remember correctly, were added in v1.2.

Cipscis

EDIT:

If you'd like to fill in the definitions for the functions included in FOSE v1.2 from the available documentation, let me know and I'll explain the format that it needs to be in.

Cipscis
User avatar
Calum Campbell
 
Posts: 3574
Joined: Tue Jul 10, 2007 7:55 am

Post » Sun Aug 08, 2010 10:17 pm

Cipscis,

I like the new format of the script validator! Very nice. :)

One small thing though - when cutting/pasting from Firefox back into a response here or into a word processor, it is now adding an extra line feed between Every Single line in the script, which makes it impossible for me to use as a default. Is this something that I'm doing by chance?

Cheers,

Miax
User avatar
x a million...
 
Posts: 3464
Joined: Tue Jun 13, 2006 2:59 pm

Post » Mon Aug 09, 2010 6:13 am

Thanks for pointing that out Miax. I was still inserting an empty list of errors and warnings for lines that had no errors or warnings, and Firefox was interpreting it as an extra line break. It should be working properly now.

Cipscis
User avatar
Blackdrak
 
Posts: 3451
Joined: Thu May 17, 2007 11:40 pm

Post » Mon Aug 09, 2010 3:56 am

I just realised that the dictionary being used by the dev validator was outdated. I've updated it now and, as such, all documented functions in the dictionary should now link to their documentation on the GECK Wiki or FOSE documentation.

Cipscis
User avatar
Inol Wakhid
 
Posts: 3403
Joined: Wed Jun 27, 2007 5:47 am

Post » Sun Aug 08, 2010 10:15 pm

Thanks for pointing that out Miax. I was still inserting an empty list of errors and warnings for lines that had no errors or warnings, and Firefox was interpreting it as an extra line break. It should be working properly now.
Just fixed my fix. There was a bug in which warnings for a certain line wouldn't show unless that line had at least one error.

Cipscis

EDIT:

Another update: An error will now appear if a function is called with explicit reference syntax on a locally defined non-reference variable. For example:
int iVarBegin GameMode	iVar.DisableEnd

Cipscis
User avatar
Alberto Aguilera
 
Posts: 3472
Joined: Wed Aug 29, 2007 12:42 am

Post » Mon Aug 09, 2010 8:15 am

Just fixed a minor bug: negative values used directly as function parameters will no longer trigger the "parameter is of an unrecognised form" error.

Cipscis
User avatar
Neko Jenny
 
Posts: 3409
Joined: Thu Jun 22, 2006 4:29 am

Post » Mon Aug 09, 2010 1:18 am

Just fixed a minor bug: negative values used directly as function parameters will no longer trigger the "parameter is of an unrecognised form" error.

Cipscis


Your validator doesn't seem to recognize ScriptEffectUpdate as a script block.
User avatar
.X chantelle .x Smith
 
Posts: 3399
Joined: Thu Jun 15, 2006 6:25 pm

Post » Mon Aug 09, 2010 9:49 am

The http://cipscis.com/dev/validator/validator.html does. I haven't updated http://www.cipscis.com/fallout/utilities/validator.aspx in over 6 months, and don't plan on doing so any more in the future, even for minor bug fixes.

I really just need to finish making a decent UI for the current validator so I can replace the old one with it...

Cipscis

EDIT:

Minor update - blocktypes will now link to their documentation on the wiki.

Cipscis
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Mon Aug 09, 2010 6:12 am

Ok, I've now replaced the old validator with the latest version. The old version of the validator is no longer available now, and you can find the latest version here - http://www.cipscis.com/fallout/utilities/validator.aspx

Cipscis
User avatar
Kat Ives
 
Posts: 3408
Joined: Tue Aug 28, 2007 2:11 pm

Post » Mon Aug 09, 2010 4:30 am

Another update - the validator will now give a warning if you try to use a local variable before you have assigned a value to it via a "set" command. I realise that this is often intentional, as variables are always initialised to 0 and the variable may be assigned a value later in the script or externally, but it's still something that could be easily overlooked during debugging so I thought it would be better to report it.

It's particularly important when a reference function is being called on an uninitialised reference, as this will cause the script to halt.

Cipscis
User avatar
WYatt REed
 
Posts: 3409
Joined: Mon Jun 18, 2007 3:06 pm

Post » Mon Aug 09, 2010 10:27 am

Ok, I've now replaced the old validator with the latest version. The old version of the validator is no longer available now, and you can find the latest version here - http://www.cipscis.com/fallout/utilities/validator.aspx

Cipscis


Wow.. This is an Awesome improvement!

I love the fact that it puts the warnings/errors right in-line with the code, this just got so much more valuable than before.

I plugged in a few of my elevator scripts just kicks to see what it would find, and it came back telling me that I couldn't do a:

		if DogmeatRef.HasBeenHired == 1


I had No idea. :) lol!

Good stuff man, Thanks for the update!! :foodndrink:

Miax
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Mon Aug 09, 2010 4:46 am

Oh, it looks like the validator assumes remote variables are undocumented reference functions. I'll get on to fixing that now.

Cipscis
User avatar
Princess Johnson
 
Posts: 3435
Joined: Wed Feb 07, 2007 5:44 pm

Post » Mon Aug 09, 2010 9:52 am

Ok, I think I've got it working properly now. Do you get the output you expected? The validator should now differentiate between reference functions called explicitly and remote variables by treating anything recognised as a function, called on a variable, or with parameters as a reference function, and anything else with the right syntax as a remote variable.

Cipscis
User avatar
sally R
 
Posts: 3503
Joined: Mon Sep 25, 2006 10:34 pm

Post » Mon Aug 09, 2010 6:29 am

Just tried it again, looks good! Did you reduce the darkness of the background/highlight of the errors and warnings that you put in-line? It could just be my monitor at work, but it seems lighter now - it was more readable (catches the eye better) when the background was a little darker so that it stands-out more when scrolling through a big script. It Definitely gives the output I would expect, the new version rocks! :goodjob:
User avatar
Lil'.KiiDD
 
Posts: 3566
Joined: Mon Nov 26, 2007 11:41 am

Post » Sun Aug 08, 2010 10:06 pm

Cool, thanks. I've managed to introduce a new problem in that it has issues telling the difference between local and remote variables of the same name, but that's a rare case and unlikely to cause any major issues. I'll fix it when I get around to it.

The colours that I'm using for the errors and warnings now are the same as the ones that I was using on a white background while developing this version. Now that they're being used with a darker background, the contrast is a bit different so they could certainly be darker. I'll darken them a bit when I next update the back end.

Cipscis
User avatar
TASTY TRACY
 
Posts: 3282
Joined: Thu Jun 22, 2006 7:11 pm

Post » Mon Aug 09, 2010 5:27 am

Sorry if I'm just being obtuse, but I can't figure out this new interface. I see the new layout, but I'm not understanding what to do with it. I pasted my script into the top box, but now what?
User avatar
Dean
 
Posts: 3438
Joined: Fri Jul 27, 2007 4:58 pm

Post » Mon Aug 09, 2010 10:56 am

The output should appear automatically in the bottom box when you paste your script in the top box. I don't know how to detect the "paste" event in JavaScript though, or even if it's possible to detect it, so at the moment the validation is triggered when you tap a key. Try typing something into the box or using the arrow keys to change the position of the caret, that should do the trick.

Cipscis
User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm

Post » Mon Aug 09, 2010 2:12 pm

Okay, I see how it's supposed to work. It's still not accepting my paste, neither ctrl+V nor right click-paste. I can type the code in just fine however.

And it works if I copy and paste the information from the bottom box into the top box...let me think about the ramifications there.

Are you just using something like a "maskchange" command picking up on the keystrokes?
User avatar
Jarrett Willis
 
Posts: 3409
Joined: Thu Jul 19, 2007 6:01 pm

Post » Mon Aug 09, 2010 4:16 am

No, I'm just using an http://www.w3schools.com/jsref/event_onkeyup.asp JavaScript event.

What browser are you using? If you can paste the script from the bottom window into the top window without issue, are you sure that you actually had the script in the clipboard when you went to paste it the first time?

Cipscis
User avatar
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

PreviousNext

Return to Fallout 3