Announcement

Collapse
No announcement yet.

Radiant Virtuoso Q1 Gamepack ver 2.many

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Radiant Virtuoso Q1 Gamepack ver 2.many

    There is a minor amount of configuring to do.

    Dump pak0.pak and pak1.pak (you must have both) in pathTo/GameDevelop/Game/Virtuoso. That is all

    customization stuff:


    case: I do not want to use proQuake493

    solution (you must do both steps):
    1) Go to pathTo/GameDevelop/Game/ - delete all engine files and dump your desired engine files in its place
    note: do not delete the Virtuoso folder

    2) open pathTo/GameDevelop/netradiant32/virtuoso_q1/default_build_menu.xml - change this line:
    <var name="Engine">glpro493.exe</var> to reflect the name of the engine executable you want to use
    note: The line is very close to the top of the document

    case: I want to use more than 2 processors (threads) to compile

    solution:
    1) open pathTo/GameDevelop/netradiant32/virtuoso_q1/default_build_menu.xml - change this line:
    <var name="tc">2</var> to reflect the amount of threads you want to use

    case: I do not want to dump pak0&1 into the Virtuoso folder

    solution (you must do both steps):

    1) Dump the ID1 folder in pathTo/GameDevelop/Game/ - you must have at least pak0
    2) open pathTo/GameDevelop/Game/Virtuoso/run.bat and change:
    %1 -Virtuoso -game %2 +map %~n3
    to
    %1 -game %2 +map %~n3

    case: I do not use a windows machine

    solution: Get one. Whereas this game pack will almost work on other OS's, the almost part is enough to not use it at all.

    ------

    What does this package include?

    Years of collecting, including and refining things.

    It is an almost completely stand alone compilation for Quake One game development. It includes NetRadiant, preconfigured to build and run maps using any compiler. The only exception to that statement is you may have to supply a different engine. For instance you can compile with hmap2 all day but, if you aren't using the darkplaces engine, you wont have any results. You could also use the Map2 compilers but they will not work with ProQuake (the supplied engine). Actually, ProQuake is nowhere near as bling bling as almost all of the compilers. It just so happens to be the one I am currently using so, that's what you get too.

    Within Game/Virtuoso/develop you will find a complete QC dev environment. This is also preconfigured to put a compiled cs/svQC where it belongs. Simply executing develop.bat will start the editor with a welcome screen of instructions and a cs/svQC project panel complete with the entire file tree for both sources. You can delete the np++ tree in the project panel, I use it to tweak the mess out of np++ and I just never removed it myself (right click/ remove from project (NOT DELETE))

    The GameDevelop/assets folder contains pakscape and texmex. I thought about adding more stuff but decided against it in lieu of keeping the overall package small. YOu can dump this package anywhere and it will immediately work (with the exception of you having to add your own paks). However, you can't move it from wherever you put it (after first start) and expect it to still work. If you do want to move it, navigate to pathTo/GameDevelop/netradiant32/settings and delete the entire 1.5.0 folder. You can then move it BUT you will have to manually open your maps again for the first time as no reference to them will remain.

    There are a bunch of other things. I would suggest to simply explore. My logitech dual action profile and the necessary radiant shortcut list is supplied, documents for all compilers are supplied, grid and flat color wad and external replacement textures for those wads are supplied. There really is a retarded amount of stuff. There is even hidden stuff. It's not hidden to be an easter egg or anything. It's hidden because you will probably never use it. For instance starting a game with a rogue or hipnotic -basedir can be found in the build menu (Im not even sure this is a thing but I wrote it anyway), it is just commented out. There is also backup copies of things like the build menu and original shortcut list. Most of this stuff can be found in pathTo/GameDevelop/netradiant32/virtuoso_q1 subdirectories.

    The develop folder has other goodies as well, like the qc manual, and...hmmm maybe that's it./ Really it's just a big ass thing full of stuff and none of the stuff it includes is a mystery to use or understand. If you know how to basically do various quake modding, this is no different. It's just organized and compiled in a way that you don't have to set a bunch of crap up or worry about where the files you are creating are going to go/end up. They will go wherever they are supposed to unless you tell it otherwise.

    Virtuoso Complete Q1 map/qc Pack
    http://www.nextgenquake.com

  • #2
    I had this idea kicking around for a while that it would be sweet to be able to test your map from the build menu using any engine. I mean in such a way that every engine (the most currently recognized) is already supplied. The trick to this was getting all the engines to share the same id1 folder (so there is no duplications). This proved to be a challenge but I figured it out.

    There is a catch. You must have pak0 & pak1 in the id1 directory. The below image illustrates my directory structure as well as the batch script I made to load the chosen engine. The main command in test.bat is actually what the command will be in the radiant build menu. I just wrote test.bat so I wouldn't have to be bothered with the radiant end while figuring this out.



    I didn't forget directQ, it's the next engine Imma add. If anyone knows of any other engines which I should add, please feel free to share. I also dumped the Virtuoso structure of "game ownership" and reverted back to the id way. It is still called virtuoso game in the radiant start screen. There is actually also a virtuoso q3 build which will have connections to relevant engines in the build menu (ie DP and FTE (maybe DirectQ if it supports q3 maps)). I don't think I'm going to stop with the "every engine" addition. I'm going to add more things until there is virtually no stone unturned. I know that I can't truly include everything but I can get pretty close.
    Last edited by MadGypsy; 08-01-2014, 07:06 PM.
    http://www.nextgenquake.com

    Comment


    • #3
      I changed the main script. I realized that there may be a lot more switches that a user might want to use and those switches might be dependent on the engine so, I broke it down into individual run map solutions. The radiant run map result is no different this simply allows for more control on a per engine basis. The current switches are just copy/paste stuff, I need to look at these engines and see what's what with their switches.

      Code:
      @echo off
      
      ::set some user options
      set height=720
      set width=1200
      set conheight=480
      set conwidth=768
      set gamename=ModGame
      
      ::set path to the directory which this bat resides in
      set path=%~dp0
      
      ::change CWD to current directory
      cd /d %path%
      
      ECHO.
      
      ::make sure there is any data at all
      if "%1" EQU "" goto ENG_ERR
      
      ::make sure there is a map name
      if "%2" EQU "" (goTo MAP_ERR) else set map=%~n2
      
      ECHO Label: %1
      ECHO -basedir %path%
      ECHO -game %gamename%
      ECHO +map: %map%
      
      ::determine which engine was chosen
      if "%1" EQU "darkplaces" goto DP
      if "%1" EQU "darkplaces_develop" goto DP_DEV
      if "%1" EQU "fitzquake" goto FQ
      if "%1" EQU "proquake" goto PQ
      if "%1" EQU "qbismsuper8" goto QBS8
      if "%1" EQU "fteqw" goto FTE
      if "%1" EQU "qrack" goto QR
      
      ::unrecognized label
      :UNR_ERR
      ECHO their is no engine path associated with this label: %1
      goto END
      
      ::there are no commands
      :ENG_ERR
      ECHO you didn't specify anything
      goto END
      
      ::no map name was specified
      :MAP_ERR
      ECHO you didn't specify a map
      goto END
      
      :DP
      set engine=%path%darkplaces\darkplaces.exe
      ECHO Engine Path: %engine%
      %engine% -basedir %path% -game %gamename% +map %map% -width %width% -height %height% -conwidth %conwidth% -conheight %conheight% -window
      goto END
      
      :DP_DEV
      set engine=%path%darkplaces\darkplaces.exe
      ECHO Engine Path: %engine%
      %engine% -basedir %path% -game %gamename% +map %map% -width %width% -height %height% -conwidth %conwidth% -conheight %conheight% -window -developer
      goto END
      
      :FQ
      set engine=%path%fitzquake\fitzquake085.exe
      ECHO Engine Path: %engine%
      %engine% -basedir %path% -game %gamename% +map %map% -width %width% -height %height% -conwidth %conwidth% -conheight %conheight% -window -bpp 32
      goto END
      
      :PQ
      set engine=%path%proquake\glpro493.exe
      ECHO Engine Path: %engine%
      %engine% -basedir %path% -game %gamename% +map %map% -width %width% -height %height% -conwidth %conwidth% -conheight %conheight% -window -bpp 32
      goto END
      
      :FTE
      set engine=%path%fteqw\fteqw.exe
      ECHO Engine Path: %engine%
      %engine% -basedir %path% -game %gamename% +map %map% -width %width% -height %height% -conwidth %conwidth% -conheight %conheight% -window
      goto END
      
      :QBS8
      set engine=%path%qbismsuper8\qbismS8.exe
      ECHO Engine Path: %engine%
      %engine% -nocdaudio -basedir %path% -game %gamename% +map %map%
      goto END
      
      :QR
      set engine=%path%qrack\glQrack.exe
      ECHO Engine Path: %engine%
      %engine% -basedir %path% -game %gamename% +map %map% -width %width% -height %height% -conwidth %conwidth% -conheight %conheight% -window -bpp 32
      goto END
      
      :END
      PAUSE
      
      EXIT
      Last edited by MadGypsy; 08-01-2014, 10:29 PM.
      http://www.nextgenquake.com

      Comment


      • #4
        Originally posted by MadGypsy View Post
        I didn't forget directQ,


        I get the feeling, that to put it in a analogy, to anyone who says or believes "Rome wasn't built in a day" , that by the time you're finished , it should read forever after ~ "Rome CAN be built in a day"
        Want to get into playing Quake again? Click here for the Multiplayer-Startup kit! laissez bon temps rouler!

        Comment


        • #5
          @Mindz

          Wow, that is very nice of you to say. I just have one goal - make a map/QC sdk with powerful working options. I have already captured many of these options but the next one is a biggie.

          I've said it before and I'll say it again. I want to build a build menu that knows everything. Not a Radiant build menu. A completely external interface. You would start by choosing a compiler from a drop down menu. Every switch that is available to that compiler will be listed with checkboxes. Switches that require a value will include an inputbox with the expected value type "watermarked" into the field. Summin like:

          Code:
          [ ] -sunlight [num] -sunmangle [num] [num]
          [ ] -soft
          etc
          it would be nice if hovering input fields brought up a tool tip with a sentence or 2 of documentation. For instance hovering the second input field for sunmangle would have a tool tip that says something like

          "values from 90(up) and -90(down) are acceptable. -75 is recommended"
          *that might not really be the recommended value. I forget what it is offhand

          All compiler output would be displayed on the build menu screen in a frame. Creating a task set would be possible. In other words you wouldn't have to choose light, set it up and then immediately compile. You could set all your compilers and simply number them to create an order of usage. The ability to save various compiler configurations is a must.

          The menu would also utilize my "any engine" technology for running the map but I would bring it a step further. Mixing up engines is not config.cfg friendly in many cases. Darkplaces writes configs that completely break Qbism (other engines and issues with this exist). There would have to be a cfg saved in each engine folder. Before the engine is loaded it's config overwrites whatever config is currently in the game directory. That simple.

          The bottom line is. I already made the Radiant build menu work for Q1 mapping so, there is nowhere else to go with that. The next step is to write an entire Build/Run system, and link it to the radiant build menu

          BUILD
          ....|_ customize (useless with this but unremovable)
          ....|_ Virtuoso Build Suite 0.7.2


          When and if I ever get such a thing completed. The final touch will be to put a face on fteqcc and make a comparable build menu for my QC develop stuff, as well as upgrade the look and feel of NP++.

          At that point we will have a completed Q1/Q34Q1 development environment with comprehensive build tools, tons of documentation, "every" engine and more than a handful of extras, all completely set up (in a default way) and ready to just go. In the case of my build menus it will even educate you as you use it (hover/tooltips). I don't know how to make it any more simple for the user.

          When(If) I ever get to that point I will completely retire from all of this.

          @engines - I have

          ProQuake, Darkplaces, FTE, FitzQuake, Qrack, Quakespasm, DirectQ, QbismSuper8

          Qbism does not like my setup at all and may simply be removed from the SDK. I intend to check out ZQuake, FuhQuake, ?EZQuake?... and maybe that's it. I put question marks around EZQuake cause that engine is made primarily to get in an online game easily. I'm not sure it qualifies as an engine you would make a game for or check the performance of your game in. I think it also requires a complete install (can't remember). I can't integrate elements that need an install into the core SDK. Portability is the backbone of my SDKs "drop and go-ness"
          Last edited by MadGypsy; 08-02-2014, 04:56 PM.
          http://www.nextgenquake.com

          Comment


          • #6
            Bingo, I have a VBScript/HTA combo that will accept switches and run programs with switches. The only switch I need to get from radiant is the map name so my script only allows for one incoming switch but outgoing explodes an entire array of switches into the commandline. Right now that array is static but, once I build some kind of compiler form, the array will be fed by the choices that were selected.

            Code:
            <SCRIPT Language="VBScript">
            
            Sub Window_onLoad
            	Dim params
            	Dim arrLine
            	Dim vars
            	
            	vars = Array("one","more","test")
            	
                    arrLine = Split(objTestHTA.commandLine, chr(34))
            	params = arrLine(3)
                    Msgbox params
            	
            	Dim commandline
            	commandline="transfer.bat " & params & " " & Join(vars," ")
            	
            	Set objWshShell = CreateObject("Wscript.Shell")
            	objWshShell.run commandline, 1
            End Sub
            
            </SCRIPT>
            So, there ya go, the entire in/out system for the menu is basically done, now I just need to fill in a whole friggin lot of middle. The concept is actually pretty simple. HTML/CSS will be used to make the interface. VBScript will do little more than the code above. The only thing I need to add is the ability to create an array of data based on selected check boxes. Javascript will control things like tooltips and any other complex visual interaction. My only weak point here is the VBScript and that part is almost done. Well, maybe I need to use VBScript to save files too BUT I'm tempted to skip the html/css and even javascript and simply embed a flash player. If I go that route I can use flash for file saving. Actually, I think I'm going to go see if Flash's ExternalInterface can talk to VBScript, if so, I would prefer it over a javascript preventDefault form submission system.

            edit: ExternalInterface supports VBScript...good, now I can make an even better build menu and I'm going to use my Object Parser (parsing delimiters result) to create/parse saved build configs and a compiler switch database. Kinda like a list of structs
            Last edited by MadGypsy; 08-02-2014, 07:32 PM.
            http://www.nextgenquake.com

            Comment


            • #7
              The Things I have Accomplished So Far:

              1) Radiant build menu can open my hta build menu and pass the mapname to it
              2) When my hta build menu opens, a flash file inside of it is waiting to be clicked. It's just a blank display right now.
              3) When the flash display is clicked it sends a string to vbscript in the hta file
              4) The vbscript converts the string to a commandline and passes it on to a batch file which passes it on to the compiler

              @4 - I pass the commandline to a bat before passing it to the compiler because this is a cheap way for me to get compile results. When the bat file opens it runs the commandline and now that shell is open for compilers to report to.

              I officially have the ins and outs completed.

              Next I need to focus primarily on a flash gui that will keep concatenating a string with selected options, and that will be the string that gets passed to the VBScript.

              Not a bad run for one night. Tomorrow I'm going to tackle one compiler. Map1 BSP. I need to write an Object file that describes all of it's switches, then convert that to an ABC file (adobe byte code). Then the gist will be to have flash read the byte file and invent a form on the fly based on the information. Once I get that far I'll start working on collecting the selected information into a string.

              So much of what I just said is already done. My parsing delimiters experiments gave me all the code for writing/reading Objects and their byte representative. The hard part is going over a compiler and turning all the possible switches into a meaningful object. Checking if something is selected and providing some custom string based on that selection is going to be a joke, in flash. A loop, a question and a return chunk of data that was described in the object and appended to by the user.

              note that the commandline variable in init() is incorrect right now. It will need to be changed when I have enough done to actually try this on a compiler. However, the version of transfer.bat posted here is the final version. If you took these two in context of one another with the code here it wouldn't seem to work. The code below is just concepts that if modified for real world cases would work perfectly.

              VirtuosoBuildSuite.hta
              Code:
              <html>
              <head>
              <title>Virtuoso Build Suite</title>
              
              <HTA:APPLICATION 
                   ID="VBS"
                   APPLICATIONNAME="Virtuoso Build Suite"
                   SINGLEINSTANCE="yes"
              >
              
              <SCRIPT Language="VBScript">
              
              Dim params
              
              Sub Window_onLoad
              	Dim arrLine
              	
              	arrLine = Split(VBS.commandLine, chr(34))
              	params = arrLine(3)
              End Sub
              
              
              function init(arr())
              	Dim commandline
              	commandline="transfer.bat " & params & " " & Join(Split(arr, chr(44)), " ")
              	
              	Set objWshShell = CreateObject("Wscript.Shell")
              	objWshShell.run commandline, 1
              end function
              
              </SCRIPT>
              </head>
              
              
              <body>
              	<object type="application/x-shockwave-flash" 
              			data="VirtuosoBuildSuite.swf" 
              			width="800" height="600">
              		<param name="movie" value="VirtuosoBuildSuite.swf" />
              		<param name="quality" value="high"/>
              	</object>
              </body>
              </html>
              transfer.bat (opens a shell and passes all arguments to the defined compiler)
              Code:
              @echo off
              cd /d %~dp0
              set params=%*
              compilers/%params%
              set params=
              PAUSE
              Main.as (waits to be clicked, writes "stageClicked" to a textfield when clicked and executes init() in the hta file with "foo bar baz" as the argument)
              Code:
              package 
              {
              	import flash.display.Sprite;
              	import flash.events.Event;
              	import flash.events.MouseEvent;
              	import flash.text.TextField;
              	import flash.external.ExternalInterface;
              	
              	
              	/**
              	 * ...
              	 * @author Gypsy
              	 */
              	public class Main extends Sprite 
              	{
              		private var txt:TextField = new TextField();
              		public function Main():void 
              		{
              			if (stage) init();
              			else addEventListener(Event.ADDED_TO_STAGE, init);
              		}
              		
              		private function init(e:Event = null):void 
              		{
              			removeEventListener(Event.ADDED_TO_STAGE, init);
              			// entry point
              			
              			with (txt)
              			{
              				x = 10;
              				y = 10;
              				width = 400;
              				height = 30;
              			}
              			addChild(txt);
              			stage.addEventListener(MouseEvent.MOUSE_DOWN,handler)
              		}
              		
              		private function handler(me:MouseEvent):void
              		{	txt.text = "stageClicked";
              			ExternalInterface.call("init", "foo bar baz"]);
              		}
              	}
              }
              The funny thing is, I'm no bat professor and I know jack shit about VBScript but somehow I got all of this to work in just a few hours. Essentially, I don't even know what I'm doing. I just know what I want to happen and I know how to use Google. Except now I know what I'm doing cause 99.999% of the rest of this is flash. Welcome to Force It In Your Direction 101.
              Last edited by MadGypsy; 08-02-2014, 11:12 PM.
              http://www.nextgenquake.com

              Comment


              • #8
                This is totally bitchin. An actual drop-down menu dialogue box with all your compilation options is the coolest thing you could do for Radiant. Nice work man.
                'Replacement Player Models' Project

                Comment


                • #9
                  Yep, I agree and this time I'm really going to do it. I've tried this before with one half or another of how I'm finally doing it and I could never get it to work. Last time I tried to use a flash projector and the time before that I tried to use HTA/VBScript. The flash projector way was not possible. I don't know why but I couldn't figure out the HTA/VBScript way the first time.

                  This time I got mad and determined to figure out how to access a damn bat from an HTA and sure enough I figured it out. It then struck me (while I was writing one of these posts) that I could simply embed flash in the HTA and 100% skip having to write a bunch of HTML and Javascript to create the interface. In short The HTA is just a wrapper for the flash which allows me to pass the flash output to a bat/exe/whatever I want. That end is complete....like completely complete. Now there are no mysteries left and absolutely no reason why I can't finally create this.

                  You are just a hair wrong about something though and it's actually my fault. Yes this can be plugged into the radiant build menu (really just linked in the menu) but this is actually a standalone application and could just as easily be used to compile any Q1 Map made in any Q1 Map editor. I just need to create a condition.

                  if not "%1" == "" RUN AS IF FROM RADIANT BUILD MENU
                  else INCLUDE INPUT BOX FOR MAP PATH

                  See what I'm saying? Either the map path will be injected and that would mean the build menu was plugged into some map editor OR the path wont be injected meaning someone started my HTA directly, in which case an input box will need to be displayed so they can type (maybe browse to) the map path.

                  You can thank Golden_Boy for the recent determination to complete this project. The stuff he was saying about my build menu in radiant was really annoying me and it made me determined to bury his opinion with something unquestionably awesome...friendly, but with aggression (ie I'm not mad at GB but I'm gonna completely kick his methods ass). Just give me some time and I GUARANTEE you my method will dominate. I have shut down all other projects til this is complete and I have today and the next 2 days to do nothing but work on this. What's that like 40 hours of solid work ahead, and all of it in flash...psssh Imma get really damn far.

                  Yesterday I worked on creating a directory structure for my app and finalizing the scripts that I already had to be THE scripts. It's all real clean and professional now and technically I could compile maps with it as is. I would just have to hard code the commandline I want to use into my flash app. That's how much this already works. All of the next steps are removing the necessity to hard code the command line. No guess work remains.
                  Last edited by MadGypsy; 08-04-2014, 12:52 PM.
                  http://www.nextgenquake.com

                  Comment


                  • #10
                    You are just a hair wrong about something though and it's actually my fault. Yes this can be plugged into the radiant build menu (really just linked in the menu) but this is actually a standalone application and could just as easily be used to compile any Q1 Map made in any Q1 Map editor. I just need to create a condition.
                    Even better. That will win support with the WorldCraft and Trenchbroom crowd, among others. It's pretty awesome you're tackling this, streamlining this shit will keep the mapping crowd strong. I'm lookin forward to see what you got in the next 40 hours lol
                    'Replacement Player Models' Project

                    Comment


                    • #11
                      I wont be finished this week. Even when I complete this build menu I have more stuff to do. In the past I have released the Virtuoso gamepack at various points of completion and never treated it like a W.I.P. This is because I never included software of my own and primarily what I was releasing was something anyone could make if they just sat down and made it. Primarily the virtuoso gamepack is little more than a compilation of a lot of work by other people.

                      I've renamed the gamepack, started working on actual software of my own and I have ideas on how to put a new face/feel on a lot of the tools/options. This release will be definitive and I intend to make it a front page thing as opposed to "here's my latest set-up for making maps"

                      Unlike my other gamepacks and aside from the new build menu, this SDK will allow you to test maps in "any" engine (included), provides a more robust QC build menu, and even includes Q3 map build/run possibilities. My goal is to make it where if you are using anything other than my SDK you must just like to waste time.

                      There is only one catch. This is a windows only solution. I'm fine with that. I'm building this using a win 8.1 machine so this will definitely work on any current win machine. I also still have my xp machine so I'll probably test this on that and see if I can get it to work across the board but linux and mac people basically get left out. There is nothing I can do about that. HTA uses iexplore.exe and other windows only executables to function. There are also some batch files and I don't know where batch and bash cease to be the same. I'm also packaging this with .exe compilers and I don't know what the linux or mac versions of those would be nor do I have a linux or mac machine to test any of that on.

                      There is a glimmer of hope though. I intend to release my entire source (in master form) so anyone that has a linux or mac and the knowledge to modify my source will have the ability to port it to another OS. The flash part shouldn't change between OS's so they would just have to figure out an HTA equivalent and reword some batch files.
                      http://www.nextgenquake.com

                      Comment


                      • #12
                        I decided that snagging just the 3rd parameter of the command line (cause of how it is split) was a janky solution. This also made me think about what the wrapper is actually doing and what it needs to do.

                        The VBScript was making a lot of specific decisions and passing them on to flash. I changed it so the VBScript makes no specific decisions and passes all data to flash. This allowed me to write a command line parser in flash which allows for any possible switches/params. I also completely stripped the HTA shell of all graphical everything and used flash's ExternalInterface capabilities to spin my own shell GUI.

                        The results are basically a flash shell that can accept command line arguments (any) as well as execute external programs. The next step is to have that shell load another swf inside of it. The reason for this is, my shell is universal. It could be used to fake an exe like shell for any flash file. That being said, my one project is now basically 2. I have the flash shell project (done) and then I have this menu project which could be embedded within the shell project.

                        I can't figure out how to minimize but I have a close button and a bar to pull the whole shell wherever you want on the screen. I even have it working off of an ini which will load the shell at the x,y,width,height which the shell was at the last close. The shell UI elements are imported from an external swf (kinda like a .dll) so, this means that customizing the shell requires little more than making an swf with some properly named elements of your visual choice.

                        That's pretty much where I am - a completely fake .exe like shell for flash with switch and remote exec capability. I'm about to go buy some food and eat it, but when I'm done I'm going to finally start on the menu part of this project.

                        My VBScript skills are getting much better as well. I'm spending less time reading and more time doing, and I haven't made any errors in a good while. Really VBScript isn't that hard when you understand the difference from running it in a browser vs an HTA shell. The trippy part of VBScript is it's nutty syntax rules. Here's an example

                        Code:
                        Sub Something
                        	' this is a comment, believe it or not
                        	' notice that mySub is being called with no parenthesis this is because you can't use them in a sub unless you are assigning a value or explicitly use call
                        	' the colon just means end of statement but is only used if you put more than one statement on a single line... o.O
                        	dim number : number = myFunc (10, 20 ,30)
                        	mySub number
                        End Sub
                        
                        ' Only use functions when you intend to return something otherwise use sub
                        Function myFunc(a, b, c)
                        	' a random if statement for example purposes
                        	If a > 5 Or b > a Or Not c < b Then
                        		' this is how you return something
                        		myFunc = a+b+c
                        	Else
                        		myFunc = a-b-c
                        	End If
                        End Function
                        
                        Sub mySub(a)
                        	MsgBox a
                        End Sub
                        and here is my actual VBScript if anyone was interested. EI denotes ExternalInterface (ie. a function/sub called from flash)
                        Code:
                        	Dim intX
                        	Dim intY
                        	Dim intWidth
                        	Dim intHeight
                        
                        	' fires on load or refresh			
                        	Sub Window_onLoad
                        		' get the file ready off screen
                        		window.offscreenBuffering = True
                        				
                        		cfg = Ini(1,"lib/shell.ini","")
                        		arrINI = Split(cfg, ",")
                        				
                        		For i = 0 To UBound(arrINI)
                        			value = arrINI(i)
                        			Select Case i
                        				Case 0
                        					intX = value
                        				Case 1
                        					intY = value
                        				Case 2
                        					intWidth = value
                        				Case 3
                        					intHeight = value
                        			End Select
                        		Next
                        				
                        		window.moveTo intX, intY
                        		window.resizeTo intWidth, intHeight
                        	End Sub
                        			
                        	' fires before window closes
                        	Sub Window_onBeforeUnLoad
                        		If CInt(intX) <> CInt(window.screenLeft) Or CInt(intY) <> CInt(window.screenTop) Then
                        			intX = window.screenLeft
                        			intY = window.screenTop
                        				
                        			data = intX & "," & intY & "," & intWidth & "," & intHeight
                        			Ini 2, "lib/shell.ini", data
                        		End If
                        	End Sub
                        
                        	' read/write ini			
                        	Function Ini(openType, path, data)
                        		Const ForReading = 1
                        		Const ForWriting = 2
                        				
                        		Set objFSO = CreateObject("Scripting.FileSystemObject")
                        		Set objFile = objFSO.OpenTextFile(path, openType)
                        				
                        		Select Case openType
                        			Case ForReading
                        				Ini = objFile.ReadAll
                        			Case ForWriting
                        				If data <> "" Then
                        					objFile.Write data
                        				End If
                        		End Select
                        				
                        		objFile.Close
                        	End Function
                        			
                        	' EI: returns the entire command line
                        	Function Full_CL()
                        		Full_CL = HKCM.commandLine
                        	End Function
                        
                        	' EI: grab window screen coordinates				
                        	Function WindowPosition
                        		WindowPosition = window.screenLeft & "," & window.screenTop
                        	End Function
                        
                        	' EI: set window screen coordinates				
                        	Sub SetWindow (x, y)
                        		window.moveTo x, y
                        	End Sub
                        			
                        	' EI: loads the commandline into a shell
                        	Sub InitShell(cmds)
                        		If Not cmds = "" Then
                        			commandline="shell.bat " & Replace(cmds , "," , " ")
                        			Set objWshShell = CreateObject("Wscript.Shell")
                        			objWshShell.run commandline, 1
                        		End If
                        	End Sub
                        			
                        	' EI: close the entire window
                        	Sub CloseWindow
                        		self.close
                        	End Sub	
                        			
                        	' EI: report warnings and errors
                        	Sub ReportError(report)
                        		MsgBox report
                        	End Sub
                        Last edited by MadGypsy; 08-05-2014, 04:28 PM.
                        http://www.nextgenquake.com

                        Comment


                        • #13
                          What a jumbled mess. Honestly, who comes up with the syntax for some of these languages? Good job figuring that shit out though.

                          Rookie question: what's the benefit of using languages such as VBScript over C++ ? Functionality in certain scenarios?
                          'Replacement Player Models' Project

                          Comment


                          • #14
                            I used Virtuoso 1 today thanks M.G.

                            Comment


                            • #15
                              @ what's the benefit of using languages such as VBScript over C++ ?

                              There's no benefit unless you don't know C(flavor) and don't want to take the time to learn it . I'm an AS3 programmer (primarily). Using VBScript and an HTA is merely a means to an end. Flash can't accept switches or execute external programs - with the use of VBScript and an HTA, now it can.

                              Code:
                              HTA - responds to VBScript
                              {
                              	VBScript - outgoing command line execution, HTA controls, reads incoming command line
                              	AS3 - chats with VBScript as well as handles everything that is not already listed
                              }
                              That's summin summin like the flowchart for my program.

                              I spent more time on my fake shell and separated it from the menu project. I know I said it was done (and it was) but as long as I'm making a fake shell I want to get as close as possible to a normal one. I also wanted the fake shell to be a flashDevelop project of its own. I don't want the shell to be dependent on my menu app cause I have more uses for the fake shell so, I had to take the time to separate the 2 and come up with a usage/system structure for the shell that wasn't ugly and clunky.

                              Basically you would use it summin like this

                              starter.bat
                              Code:
                              @echo off
                              TITLE Flash Shell
                              cd /d %~dp0App/FlashShell/
                              start FS_wrapper.hta -app "..\App.swf"
                              but in the case of my build menu I would use it like this

                              BuildMenu.bat
                              Code:
                              @echo off
                              TITLE Build Shell
                              cd /d %~dp0BuildMenu/FlashShell/
                              start FS_wrapper.hta -app "..\build_menu.swf" -mapfile %1
                              Where %1 get's overwritten with a path to a .map file from radiant. The shell itself will parse any and all switches/values but the app that gets loaded into the shell is responsible for doing something with them. That is, except for the -app switch. That switch tells the shell what swf file to embed in itself.

                              Oh right, the shell also writes a log of any and all warnings for the session. For instance if you don't include any switches that would be a warning and would be written to the log. However if ExternalInterface.available = false that gets thrown as an error (that I catch) and report to the screen much like a javascript alert. The reason why no switches = warning is because I'm trying to harness StdOut, and when I do, no switches will force the shell into cmd shell mode where it will operate just like a cmd shell.

                              My basic idea on that is to have a totally custom cmd shell. For instance things like paths could be recognized and displayed in a different color. Same goes for commands, like cd, start, echo, etc. Not to mention that I could take my StdOut technology and use it to display the StdOut from the compilers in a custom textarea as opposed to a bat
                              Last edited by MadGypsy; 08-06-2014, 03:03 AM.
                              http://www.nextgenquake.com

                              Comment

                              Working...
                              X