Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 02-13-2008, 03:13 PM   #1
Sh4x
Retired FF Staff
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
Need LUA help for ff_fatties

I'm trying to finish ff_fatties and I'm stuck with lua and material proxies problems... if anyone could help me with this...

I found a good page about material proxies here: http://developer.valvesoftware.com/w...terial_Proxies

What I'm trying to do is display the score of both teams and a countdown timer ingame using material proxies. The score would be a two digit number. I got a peice of code that partly works in that numbers are changing based on the blue team score but one of the digit doesnt work, I dont recall if its the TENS or UNITS and if they're mixed up or whatever... anyways, I need help to sort all of this.

Code:
	"Proxies" 
     { 
		"FF_TeamScore_Blue_Proxy"
		{
			"resultVar" "$valueA"
		}	
     }
About the count down timer, I already got a variable in the lua that counts from 60 to 0 then resets everything so it's fully working. Now I'd like to show that timer ingame... I don't know if that would be possible or not.

Here's the ingame scoreboard I'm talking about. The upper digits are the timer, on the sides you got team scores.


Last edited by Sh4x; 02-13-2008 at 03:28 PM.
Sh4x is offline   Reply With Quote


Old 02-13-2008, 05:42 PM   #2
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
I'd use this: http://developer.valvesoftware.com/w...modify_control
In fact you could probably do the whole timer thing without lua, just with some timers and math_counters.
Crazycarl is offline   Reply With Quote


Old 02-13-2008, 05:56 PM   #3
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
Crazycarl's suggestion is good, cause yeah...I'm not entirely sure if we made the material proxy stuff for lua. We talked about it, but I don't know if we did it.

Because this stuff ties into gameplay, you do need to use lua in some way. Luckily, you can control regular entities (like material_modify_control) with lua.
__________________
Support FF:
Trepid
steamcommunity.com/id/trepid_jon/
trepid_jon is offline   Reply With Quote


Old 02-13-2008, 06:54 PM   #4
Sidd
Lua Team
 
Join Date: Mar 2007
Posts Rated Helpful 1 Times
You can do it fairly simply with a load of doors appropriately named and textured
Code:
UnitDoors = {"Door0", "Door1", "Door2", "Door3", "Door4", "Door5", "Door6", "Door7", "Door8", "Door9"}
TenDoors = {"Door00", "Door10", "Door20", "Door30", "Door40", "Door50", "Door60", "Door70", "Door80", "Door90"}
function DisplayScore(value)
for k, v in pairs(UnitDoors)
	if k == value % 10 then OpenDoor(v) else CloseDoor(v) end
end
for k, v in pairs(TenDoors)
	if k == (value % 100) / 10 then OpenDoor(v) else CloseDoor(v) end
end
end
Sidd is offline   Reply With Quote


Reply


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

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:03 AM.


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