Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 03-19-2008, 09:38 AM   #1
_MJ_
Mapper
 
_MJ_'s Avatar
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
setting up avanti style maps.

I'm contemplating on converting my nightrun map to FF but this lua thing I have no clue where to start. How do i set up scoring like in avanti. Also resetting detpack spots, gates, and switching players to A or D after all CP's are captured. Thanks.
_MJ_ is offline   Reply With Quote


Old 03-19-2008, 10:50 PM   #2
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
Make your lua file and put this in:
Code:
IncludeScript("base_id");
IncludeScript("base_respawnturret");
IncludeScript("base_location");
maps\includes\base_id.lua has all the code to do the attack/defend gameplay, so open that file and have a look. Near the top there are some constants such as POINTS_PER_CAPTURE and default values for each. If you want to set your own values go into your map's lua and override them like this:
Code:
 POINTS_PER_CAPTURE =20
--attackers get 20 points for capping
NUM_PHASES = 3
--this makes only 3 cap points. You can do up to 8!
Now you just need to know what to name your entities you create in Hammer. You can find this in the lua file but it can be tough to make sense of the code. So I'll do it for you

Your starting gate should be a func_door named "start_gate"
For each phase of the map you need the following: (replace # with a number)
one info_ff_script called "cp#_flag"
a bunch of info_ff_teamspawn called "cp#_attacker" to spawn attacking team
a bunch of info_ff_teamspawn called "cp#_defender" to spawn defending team
one trigger_ff_script called "cp#_cap"

Detpack code can be found in maps\ff_palermo.lua, just borrow that code and paste it into your lua, and make the appropriate entites in your map

Everything else is taken care of, I think. When the last flag is capped (this is determined by NUM_PHASES) everything should reset. If you want any custom behavior you'll have to override some of the functions from base_id but this gives you all the basics.
__________________
Support FF:
Crazycarl 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 02:21 AM.


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