02-13-2008, 03:13 PM | #1 |
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" } } 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. |
|
02-13-2008, 05:42 PM | #2 |
D&A Member
Wiki Team Fortress Forever Staff 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. |
|
02-13-2008, 05:56 PM | #3 |
Fortress Forever Staff
|
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. |
|
02-13-2008, 06:54 PM | #4 |
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 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|