Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 10-04-2007, 10:52 PM   #1
L0ki
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
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
L0ki is offline   Reply With Quote


Old 10-04-2007, 10:57 PM   #2
AltPluzF4
Newb
 
AltPluzF4's Avatar
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Send a message via ICQ to AltPluzF4 Send a message via AIM to AltPluzF4 Send a message via MSN to AltPluzF4 Send a message via Yahoo to AltPluzF4
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.

Looks great, keep up the good work!
AltPluzF4 is offline   Reply With Quote


Old 10-04-2007, 11:01 PM   #3
Pon
Not choking. Yet.
Lua Team
Wiki Team
Fortress Forever Staff
 
Pon's Avatar
 
Join Date: Jul 2007
Location: Scotland
Class/Position: Demo/Def - Spy/Off
Gametype: Anything but yet more fucking CTF
Affiliations: FF.AvD [FF AvD/ID guild]
Posts Rated Helpful 0 Times
Sounds like a useful thing to have... Get it done yesterday!


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

YOU GUYS REALLY SHOULD UPDATE YOUR STAFF LIST!
I haven't posted since 2010...

Preferable to death. But only just...
Pon is offline   Reply With Quote


Old 10-04-2007, 11:05 PM   #4
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
im LUA ignorant and hell yea id love something like this!
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 10-04-2007, 11:45 PM   #5
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
http://notepad-plus.sourceforge.net/uk/site.htm

Why bother making another one?

edit: oops this of course only has a syntax highlight feature.
A1win is offline   Reply With Quote


Old 10-05-2007, 04:50 PM   #6
stino
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
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
and add something to load the vmf file so you can see wich entities you use in your map
stino is offline   Reply With Quote


Old 10-05-2007, 09:40 PM   #7
fisheye
 
Join Date: Apr 2007
Posts Rated Helpful 0 Times
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.
fisheye is offline   Reply With Quote


Old 10-05-2007, 10:08 PM   #8
AltPluzF4
Newb
 
AltPluzF4's Avatar
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Send a message via ICQ to AltPluzF4 Send a message via AIM to AltPluzF4 Send a message via MSN to AltPluzF4 Send a message via Yahoo to AltPluzF4
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
AltPluzF4 is offline   Reply With Quote


Old 10-06-2007, 03:50 AM   #9
hlstriker
QUAD ROCKET
Server Owner
Fortress Forever Staff
 
hlstriker's Avatar
 
Join Date: Jul 2007
Class/Position: Soldier
Gametype: Rocket Jumping
Affiliations: -g1 ]qS[ -eC- :e0: [ESAD]
Posts Rated Helpful 11 Times
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 !
hlstriker is offline   Reply With Quote


Old 10-06-2007, 07:51 PM   #10
L0ki
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Quote:
Originally Posted by stino
and add something to load the vmf file so you can see wich entities you use in your map
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?
L0ki is offline   Reply With Quote


Old 10-06-2007, 09:09 PM   #11
AltPluzF4
Newb
 
AltPluzF4's Avatar
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Send a message via ICQ to AltPluzF4 Send a message via AIM to AltPluzF4 Send a message via MSN to AltPluzF4 Send a message via Yahoo to AltPluzF4
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
AltPluzF4 is offline   Reply With Quote


Old 10-07-2007, 01:52 AM   #12
mervaka
A Very Sound Guy!
Fortress Forever Staff
 
mervaka's Avatar
 
Join Date: May 2005
Location: UK
Posts Rated Helpful 15 Times
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!
__________________
Support FF:
mervaka is offline   Reply With Quote


Old 10-07-2007, 05:44 PM   #13
stino
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
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?
stino is offline   Reply With Quote


Old 10-07-2007, 06:03 PM   #14
AltPluzF4
Newb
 
AltPluzF4's Avatar
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Send a message via ICQ to AltPluzF4 Send a message via AIM to AltPluzF4 Send a message via MSN to AltPluzF4 Send a message via Yahoo to AltPluzF4
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"
}
AltPluzF4 is offline   Reply With Quote


Old 10-07-2007, 06:18 PM   #15
L0ki
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
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
L0ki is offline   Reply With Quote


Old 12-07-2007, 11:04 AM   #16
GeoKill----->
Community Member
Server Owner
Beta Tester
Forum Moderator
 
GeoKill----->'s Avatar
 
Join Date: Mar 2007
Location: Hawthorne, California
Class/Position: Soldier/Spy/Scout
Gametype: AvD
Affiliations: :e0:Eternal Order Leader
Posts Rated Helpful 12 Times
So has there been more work on this?
__________________

:e0: Will live on Forever
Support FF:
GeoKill-----> is offline   Reply With Quote


Old 12-16-2007, 05:03 PM   #17
Ihmhi
[AE] 0112 Ihmhi *SJB
Wiki Team
Fortress Forever Staff
 
Ihmhi's Avatar
 
Join Date: Mar 2007
Location: Newark, NJ, United States
Class/Position: A little bit o' everythin'
Gametype: Also a little bit o' everythin'
Affiliations: [AE] Asseater, *SJB Straight Jacket Brigade
Posts Rated Helpful 3 Times
Send a message via AIM to Ihmhi Send a message via MSN to Ihmhi Send a message via Yahoo to Ihmhi
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.
__________________
Support FF:
Anime: The Thread: Reloaded
The one and only anime thread on these here forums.

Select the pistol, and then, select your horse.
Ihmhi is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:16 AM.


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