Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   Lua (https://forums.fortress-forever.com/forumdisplay.php?f=44)
-   -   Attn: Mappers / Lua scripters (https://forums.fortress-forever.com/showthread.php?t=12120)

L0ki 10-04-2007 10:52 PM

Attn: Mappers / Lua scripters
 
As a challenge to myself, I decided to write a small script editor for FF's Lua scripting. Right now, it's nothing too special, however I do have some features planned that should make it quite a bit easier for mappers to quickly get their maps scripted.

Current features:
  • Syntax highlighting: Highlights Lua keywords, libraries and functions, as well as FF enumerations, constants, functions and entities in different colors.
  • Simple code completion: Basically, when you type a semicolon or a period, a list will popup with valid choices for the object that prefixes it. If you type a semicolon with nothing in front of it, a list of all Lua libraries and functions, as well as all FF entities, functions, enumerations and constants will appear.
  • Function list: Allows you to quickly navigate to specific functions in long Lua files.
  • Team Setup Code Generator: Visually setup your teams and click a button to generate the appropriate code, which you can then copy and paste into your script.
You can find screenshots of the above Here.

How many people would be interested in using something like this? I am still going to continue devloping this regardless because it is a great way for me to learn something new, just curious as to how popular it would be if I released it to the public :o

AltPluzF4 10-04-2007 10:57 PM

Great, I've been wanting something like this. Currently I have syntax highlighting in UltraEdit, but it'd be nice to have functions and class objects easy to find without having to look up the LUA Commands post. :D

Looks great, keep up the good work!

Pon 10-04-2007 11:01 PM

Sounds like a useful thing to have... Get it done yesterday! :-P


Seriously, good idea. I can see this being very useful, especially for mappers who aren't used to programming/scripting in any way.

GambiT 10-04-2007 11:05 PM

im LUA ignorant and hell yea id love something like this!

A1win 10-04-2007 11:45 PM

http://notepad-plus.sourceforge.net/uk/site.htm

Why bother making another one? ;)

edit: oops this of course only has a syntax highlight feature.

stino 10-05-2007 04:50 PM

Quote:

Originally Posted by L0ki
As a challenge to myself, I decided to write a small script editor for FF's Lua scripting. Right now, it's nothing too special, however I do have some features planned that should make it quite a bit easier for mappers to quickly get their maps scripted.

Current features:
  • Syntax highlighting: Highlights Lua keywords, libraries and functions, as well as FF enumerations, constants, functions and entities in different colors.
  • Simple code completion: Basically, when you type a semicolon or a period, a list will popup with valid choices for the object that prefixes it. If you type a semicolon with nothing in front of it, a list of all Lua libraries and functions, as well as all FF entities, functions, enumerations and constants will appear.
  • Function list: Allows you to quickly navigate to specific functions in long Lua files.
  • Team Setup Code Generator: Visually setup your teams and click a button to generate the appropriate code, which you can then copy and paste into your script.
You can find screenshots of the above Here.

How many people would be interested in using something like this? I am still going to continue devloping this regardless because it is a great way for me to learn something new, just curious as to how popular it would be if I released it to the public :o

and add something to load the vmf file so you can see wich entities you use in your map :D

fisheye 10-05-2007 09:40 PM

does it help you to understand the code, or does it just make writing the code happen a little faster when you already understand it?

it does sound promising.

AltPluzF4 10-05-2007 10:08 PM

Quote:

Originally Posted by fisheye
does it help you to understand the code, or does it just make writing the code happen a little faster when you already understand it?

it does sound promising.

Well, it will help with 2 main things:
1.) Color code, so it's easier to read, thus making it easier to understand.
2.) Code completion helps limit the chance of a typo, thus making it easier to code, without little errors creeping up from a simple typo.

Now, once the FF wiki is released and documented, it will be easier for certain information to be added to the program, such as exactly what parameters a function accepts / returns. That, will help some people understand the code easier.

All in all, anyone can code C++ / LUA in notepad. Yet, having a proper editor such as Microsoft Visual C++ / L0ki's soon to be program, makes reading, understanding, and producing code much simpler for all. So, no matter how you look at it, this project is helpful.

So, simply to answer you're question, it basically does both, but it's not a miracle worker, if you have no coding knowledge at all, it won't make you a pro. Yet, as he said, he's adding some handy functions such as the Team / Class editor, which will help people code who have no knowledge at all.

Can't wait for it L0ki :D

hlstriker 10-06-2007 03:50 AM

Yeah this would be great. I've been using the AMXX Studio for my lua files (which you can setup to do what you're in development of), but a studio specifically for FF lua would be so much better.

Please keep developing this :)!

L0ki 10-06-2007 07:51 PM

Quote:

Originally Posted by stino
and add something to load the vmf file so you can see wich entities you use in your map :D

I was actually working on a feature to compare entity info in your script with the BSP file and have it working quite well. Adding an option to compare to a VMF file shouldn't be hard at all. Can you post an example VMF with matching lua script that I can use to test it out?

AltPluzF4 10-06-2007 09:09 PM

Quote:

Originally Posted by L0ki
I was actually working on a feature to compare entity info in your script with the BSP file and have it working quite well. Adding an option to compare to a VMF file shouldn't be hard at all. Can you post an example VMF with matching lua script that I can use to test it out?

The VMF is in a simple format. For entities it basically lists them as such:
Code:

entity
{
        "id" "88"
        "classname" "trigger_ff_script"
        "spawnflags" "1"
        "origin" "404 136 -95.5"
        "targetname" "spawn_special"
        solid
        {
                "id" "82"
                side
                {
                        "id" "132"
                        "plane" "(339 206 -95) (469 206 -95) (469 66 -95)"
                        "material" "TOOLS/TOOLSNODRAW"
                        "uaxis" "[1 0 0 -4] 0.25"
                        "vaxis" "[0 -1 0 0] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
                        "smoothing_groups" "0"
                }
                side
                {
                        "id" "131"
                        "plane" "(339 66 -96) (469 66 -96) (469 206 -96)"
                        "material" "TOOLS/TOOLSNODRAW"
                        "uaxis" "[1 0 0 -4] 0.25"
                        "vaxis" "[0 -1 0 0] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
                        "smoothing_groups" "0"
                }
                side
                {
                        "id" "130"
                        "plane" "(339 206 -95) (339 66 -95) (339 66 -96)"
                        "material" "TOOLS/TOOLSNODRAW"
                        "uaxis" "[0 1 0 0] 0.25"
                        "vaxis" "[0 0 -1 -32] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
                        "smoothing_groups" "0"
                }
                side
                {
                        "id" "129"
                        "plane" "(469 206 -96) (469 66 -96) (469 66 -95)"
                        "material" "TOOLS/TOOLSNODRAW"
                        "uaxis" "[0 1 0 0] 0.25"
                        "vaxis" "[0 0 -1 -32] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
                        "smoothing_groups" "0"
                }
                side
                {
                        "id" "128"
                        "plane" "(469 206 -95) (339 206 -95) (339 206 -96)"
                        "material" "TOOLS/TOOLSNODRAW"
                        "uaxis" "[1 0 0 -4] 0.25"
                        "vaxis" "[0 0 -1 -32] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
                        "smoothing_groups" "0"
                }
                side
                {
                        "id" "127"
                        "plane" "(469 66 -96) (339 66 -96) (339 66 -95)"
                        "material" "TOOLS/TOOLSNODRAW"
                        "uaxis" "[1 0 0 -4] 0.25"
                        "vaxis" "[0 0 -1 -32] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
                        "smoothing_groups" "0"
                }
                editor
                {
                        "color" "220 30 220"
                        "visgroupshown" "1"
                        "visgroupautoshown" "1"
                }
        }
        editor
        {
                "color" "220 30 220"
                "visgroupshown" "1"
                "visgroupautoshown" "1"
                "logicalpos" "[0 6500]"
        }
}

You really only need to parse the file to find "entity" then after it, get the classname and targetname.

I have a simple test map uploaded, that was used as an example for setting "state specific" spawn points. Should be enough for you to use.

http://rapidshare.com/files/59661658/spawn_test.zip

mervaka 10-07-2007 01:52 AM

i dont mean to sound rude by pissing on your fireworks, but i've been using the free version of editpad pro. it rocks so much cock! (for now)

nice editor though, but i dont like your highlighting colour scheme :(

this code completion stuff will be a godsend though. just make sure stuff doesnt pop up in the wrong contexts!

stino 10-07-2007 05:44 PM

Quote:

Originally Posted by L0ki
I was actually working on a feature to compare entity info in your script with the BSP file and have it working quite well. Adding an option to compare to a VMF file shouldn't be hard at all. Can you post an example VMF with matching lua script that I can use to test it out?

isn't the entity block inside a vmf equal to the entity block inside a bsp?

AltPluzF4 10-07-2007 06:03 PM

Quote:

Originally Posted by stino
isn't the entity block inside a vmf equal to the entity block inside a bsp?

Slight difference... If you notice my previous post, this is the same entity block, from the bsp.

Code:

{
"model" "*1"
"targetname" "spawn_special"
"origin" "404 136 -95.5"
"spawnflags" "1"
"classname" "trigger_ff_script"
}


L0ki 10-07-2007 06:18 PM

VMF entity blocks can have nested sub blocks, whereas the same BSP entity does not.

Thanks for the example, think i've got it working now. I have it so that it pulls entity names and classenames from the VMF file, now I just have to get it to compare them to whats in the script file. Any way someone could send me a more complex VMF file so I can test the code against more complex examples? I want to make sure there is nothing that would cause the code to bug out and make your computer explode :o

GeoKill-----> 12-07-2007 11:04 AM

So has there been more work on this?

Ihmhi 12-16-2007 05:03 PM

This looks like it is already ramping up to be a powerful tool.

I have not tried it yet (so excuse me if any of the following are already in), but I would like to see three things in it:

Debug

A command/button that will check if your code will work in the game. It really sucks to load up your map and get the FToD (Four Teams of Doom).

Load Prefabs

The ability to load prefabbed Lua files for gameplay types. Prefabs should go in a folder so other users can make them (example: a fully working flagrun prefab). Start up Lua editor, load the prefab, and modify as necessary. If no modifications are needed, then just copy/paste the Lua into your maps directory and rename it!

Lua Generator

Basically something with radio buttons, check buttons, and text fields where it can generate a working Lua for you. Example follows:

Code:


( )  (.) = Radio Buttons
[ ]  [x] = Checkbox
[                ]  [green_button      ] = text field

Code:


TEAMS

[ ] Red
[ ] Blue
[x] Yellow
[x] Green



CLASSES

RED              BLUE              YELLOW            GREEN

[ ] CIVILIAN      [ ] CIVILIAN      [ ] CIVILIAN      [ ] CIVILIAN
[ ] SCOUT        [ ] SCOUT        [x] SCOUT        [x] SCOUT 
[ ] SNIPER        [ ] SNIPER        [x] SNIPER        [x] SNIPER 
[ ] SOLDIER      [ ] SOLDIER      [x] SOLDIER      [x] SOLDIER
[ ] DEMOMAN      [ ] DEMOMAN      [x] DEMOMAN      [x] DEMOMAN
[ ] MEDIC        [ ] MEDIC        [x] MEDIC        [x] MEDIC 
[ ] HWGUY        [ ] HWGUY        [x] HWGUY        [x] HWGUY 
[ ] PYRO          [ ] PYRO          [x] PYRO          [x] PYRO   
[ ] SPY          [ ] SPY          [x] SPY          [x] SPY   
[ ] ENGINEER      [ ] ENGINEER      [x] ENGINEER      [x] ENGINEER



GAMEPLAY TYPE

( ) CAPTURE THE FLAG
( ) REVERSE CAPTURE THE FLAG
( ) COMMAND POINT
(.) SHUTDOWN
( ) INVADE & DEFEND
( ) ATTACK & DEFEND
( ) PUSH
( ) KING OF THE HILL
( ) DEATHMATCH
( ) TEAM DEATHMATCH



TRIGGERS FOR SHUTDOWN (appears dynamically)

GREEN SHUTDOWN TRIGGER    [green_lazerz      ]
GREEN SHUTDOWN BUTTON    [green_button      ]
YELLOW SHUTDOWN TRIGGER  [yellow_lazerz    ]
YELLOW SHUTDOWN BUTTON    [yellow_button    ]

Click "Create Lua!" and it would create a working Lua for CTF-style gameplay with Green and Yellow teams and Civilian disabled. Of course, I would like to see the real thing more complex than this.


All times are GMT. The time now is 08:03 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.