Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 12-10-2007, 06:03 AM   #1
Nezumi
Retired FF Staff
 
Nezumi's Avatar
 
Join Date: Mar 2007
Location: The Peoples Republic of Harmfull Free Radicals.
Class/Position: Soldier, O
Gametype: Doubble Mode
Affiliations: Cassiotone Nation
Posts Rated Helpful 1 Times
Modifying the CZ2 lua

Tiger is using almost an exact copy of the CZ2 script, obviously, but there's one change I'm not sure how to make.

Tiger uses point_spotlights on the cap points instead of the env_beam/env_laser/whatever that cz2 uses. point_spotlights have a color input, but it doesn't work! So what I have set up now is a white point_spotlight shining into the sky at each cap point, and a blue and red one at each cap point that turn on and off depending on who controls it.

The blue and red spotlights turn on and off exactly as they should. The problem is getting the white spotlights to turn on and off at the right time. It's easy to turn all 5 back on when a fullcap happens, and turn each one off whenever someone caps a point, but what I'm not sure how to do is to turn off all the teamcolored spotlights and turnon all the neutral colored spotlights at points that were uncapped when a command center is blown.

So, for example, blue owns points 1 2 and 3, but then their command center gets detted by a red demo. Then the white 'neutral' point_spotlights would need to be turned on, and the blue spotlights turned off at those points.

(the spotlights are named cp1_spotlight, cp1_spotlight_red, cp1_spotlight_blue, cp2_spotlight, cp2_spotlight_red, cp2_spotlight_blue, etc.)

Can anyone help me out?
__________________
TG: pretty much you have no idea how much i fuckin own at this game.
TG: i bested no less than three flaming tornados and broke a huge wizard.
Nezumi is offline   Reply With Quote


Old 12-15-2007, 04:54 AM   #2
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
I'm looking in ff_cz2.lua and there's code in there that should already do it. Look under the section called

-- command centers

There's a trigger for a detpack and all, and when it gets triggered, it loops through an array called command_points. It checks the team that controls each point against the team that owns the command center. If they are the same, it calls the function ChangeControllingTeam on the command point

Each cp takes care of it's own shit; and it knows what entities to target by making a string out of its number and the color of the team that owns it (it gets this stuff from the a table called team_info). The only thing you should have to change is just below the line
function base_cp_trigger:ChangeControllingTeam( new_controlling_team )

Find the OutputEvent stuff and change it to work on spotlights instead of lights/beams. I hesitate to give you instructions because I don't know what you've changed so far. Because you say you've got it halfway working.

I think you're going to want to change the name of your white lights to "cp1_spotlight_neutral" because that seems to be the way cz2 does it.

Last edited by Crazycarl; 12-15-2007 at 05:00 AM.
Crazycarl is offline   Reply With Quote


Old 12-19-2007, 01:12 AM   #3
Nezumi
Retired FF Staff
 
Nezumi's Avatar
 
Join Date: Mar 2007
Location: The Peoples Republic of Harmfull Free Radicals.
Class/Position: Soldier, O
Gametype: Doubble Mode
Affiliations: Cassiotone Nation
Posts Rated Helpful 1 Times
Haha, now that you mention it, I think I see in the lua where that output is fired. I think all I had to do was, as you say, change the neutral spotlight's name have a _neutral on it and it would work without having to change the LUA.

Rofl, I'm gonna be pissed if that's all I had to do.

Edit: Well fuck me, it worked. Tiger might be out day after tomorow. Depends on how much I can get done at a friends house tonight!
__________________
TG: pretty much you have no idea how much i fuckin own at this game.
TG: i bested no less than three flaming tornados and broke a huge wizard.

Last edited by Nezumi; 12-19-2007 at 01:42 AM.
Nezumi is offline   Reply With Quote


Old 01-29-2008, 12:35 AM   #4
trepid_jon
Ray Ray Johnson
Fortress Forever Staff
 
trepid_jon's Avatar
 
Join Date: Feb 2005
Location: Dallas, TX
Class/Position: D Civilian
Gametype: Rocket Jousting
Affiliations: EAFD
Posts Rated Helpful 78 Times
Send a message via ICQ to trepid_jon Send a message via AIM to trepid_jon
Nice, Nezumi.

Cool to see people figuring out the crazy cz2 lua. Some wild shit going on inside it...
__________________
Support FF:
Trepid
steamcommunity.com/id/trepid_jon/
trepid_jon is offline   Reply With Quote


Old 02-28-2008, 04:33 PM   #5
greenday5494
Holy shit, thats kerrigan!
D&A Member
 
greenday5494's Avatar
 
Join Date: Sep 2007
Class/Position: D, whatever the team needs, usually engy
Gametype: AvD
Affiliations: None
Posts Rated Helpful 1 Times
didnt you make it? lol
greenday5494 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 10:40 PM.


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