I got it all working except the clip refill. It says:
Attempted to create unknown entity type func_regenerate! Can't init func_regenerate The damage script works though. |
Not sure where that error is coming from, but it's not the Lua (Lua errors/messages are all prefixed with [SCRIPT]). I just tested the resupply script I posted and it seems to work for me.
Could you post your whole Lua? |
Code:
----------------------------------------------------------------------------- |
Here's a working version:
Changes I made: - Removed team:SetClassLimit(Player.kSniper, SNIPER_LIMIT) lines in startup() as SNIPER_LIMIT wasn't defined and therefore broke things (error in console was [SCRIPT] Error calling startup (no overload of 'Team:SetClassLimit' matched the arguments (Team, number, nil) candidates are: Team:SetClassLimit(number, number)) - Fixed indenting because it bothered me - Removed the four SetPlayerLimit() calls outside of startup because they shouldn't exist - Included base_teamplay as its just a good idea in general unless you really know what you're doing |
Yes sir that worked. Thank you very much squeek.
|
No problem.
|
Would it be possible for a lua to spawn a player with a diminishing buff that you usually get from the medic. And then when ever you get a kill, reload your clips and resup you to that buff?
|
Not sure what you mean by "usually get from the medic," but it sounds possible.
|
Quote:
|
Not actually sure if Lua can give players health above 100%. If it doesn't, it'd be easy to add that functionality.
|
Quote:
|
Quote:
Seeing as how it's partly about manuvering the terrain, the buff helps take away some of the penalty of your first couple rocket jumps. http://steamcommunity.com/sharedfile...s/?id=94592638 Plan is to to have multiple rooms like that for people to choose from. And I'm gonna need help with the lua, because I'm dumb. |
Ok I'd like to request a lua if anyone is willing to help. It may be a little bit hefty. It comes down to three main things.
It's going to be a DM map with multiple arenas. So I'd like a lua that makes it so when you die in a certain area, you spawn in one of the spawn points in that area. Let me know what I need to do on the mapping end to acheive this. (naming spawn points, making a trigger, w/e is needed) This next part is what we were talking about earlier in the thread. So if it's possible I'd like every time a player spawns, for them to spawn at 125% 150% health, what ever the medic buffs limit is. I want it to act exactly like the buff a medic can apply to his team. Spawn at the buff cap, and have it slowly diminish. The map features lots of terrain to fight for, on, around. This buff makes it much more viable to rocket jump on all this stuff. And the last part is a resup/clip refill on kill. I'd like it so that any time a player kills someone, their clips are refilled, and health restored. I'd also like it so that it restores their health to the buff they spawned at. This keeps the pace going, and eliminates any need to take a break to go grab bags and reload. So is this possible, and what do I need to do on the mapping end? |
Hi.
I'm trying to remake 55 from TFC. There's two main things I need help with lua wise. 1. I need two sets of capture points. A normal one on the bats and a second set in a pit worth 20 points. I tried to use this from the FF wiki: Code:
-- This is my first base trigger! 2. In 55, there are two yard vents on each base that use a trigger to push you into the opposite team's battlements. The yard vents work just fine, but I need them to differentiate between classes. As it stands, each class is pushed the same distance. I need heavier classes to be pushed at a decreased rate so as to be true to the TFC version and combat heavy Offense usage. Here's the vent part of the lua: Code:
-------------------------------------------------------------------------- I didn't even know where to begin with the lua here, but Squeek mentioned it was possible. Also, I'm bad and dumb. So, I might have silly followup questions. Thanks in advanced. |
Code:
-- save all the functions in a table The cap point stuff had to be done in a dumb way because the base Lua's were written in a dumb way. It wouldn't be hard to add proper support for points set per cap point. I'll edit base_teamplay for the next patch. |
Squeek, you never cease to amaze.
|
Engy spanner func_button help?
I am trying to create a button that when ANY engineer hits it a certain number of times it creates a few outputs. Only needs to activate once. I borrowed ff_security_b1 code and tried to change it and also tried to just create what I needed.... I didnt receive lua errors but the func_button I named engy_spanner_button didnt fire... I didn't receive any console lua errors either. Please help this noob, maps almost done.
heres the code: ---------------------------- --first attempt modified slightly from ff_security_b1 ---------------------------- NUM_HITS_TO_REPAIR = 10 FORT_POINTS_PER_REPAIR = 100 function gen_onrepair( team ) -- outputs, add any thing you want to happen when the generator is repaired here -- teamstring is either "red" or "blue" OutputEvent( "beam2", "TurnOn" ) OutputEvent( "tele_2_trigger", "Enable" ) BroadCastMessage("Beam 2 has been activated") end function gen_onclank( player ) -- add any thing you want to happen when the generator is hit by a wrench (while its detted) here BroadCastMessage("whats going on here?") end generators = { [Team.kUnassigned] = { status=0, repair_status=0 } } base_gen = func_button:new({ team = Team.kUnassigned }) function base_gen:ondamage() if IsPlayer( GetPlayerByID(info_attacker) ) then local player = CastToPlayer( GetPlayerByID(info_attacker) ) if info_classname == "ff_weapon_spanner" then generators[self.team].repair_status = generators[self.team].repair_status + 1 if generators[self.team].repair_status >= NUM_HITS_TO_REPAIR then player:AddFortPoints( FORT_POINTS_PER_REPAIR, "Repairing the Crane" ) gen_onrepair( self.team ) generators[self.team].status = 0 else gen_onclank( player ) end end end end ---------------------------------------------------------- -- my attempt to create a engy spanner button ----------------------------------------------------------- base_gen = func_button:new({ team = Team.kUnassigned }) function base_gen:ondamage() if IsPlayer( GetPlayerByID(info_attacker) ) then local player = CastToPlayer( GetPlayerByID(info_attacker) ) if info_classname == "ff_weapon_spanner" then generators.repair_status = generators.repair_status + 1 if generators.repair_status >= NUM_HITS_TO_REPAIR then player:AddFortPoints( FORT_POINTS_PER_REPAIR, "Repairing the Crane" ) OutputEvent( "beam2", "TurnOn" ) OutputEvent( "tele_2_trigger", "Enable" ) BroadCastMessage("Beam 2 has been activated") else gen_onclank( player ) end end end end engy_spanner_button = base_gen:new({ team = Team.kUnassigned }) |
try this for base_gen : ondamage (and generators)
Code:
|
ok so Dexter's code from above works, but if I have this code in the lua as well the func_button named engy_spanner_button and gen_onclank doesn't work. Everything else in my lua is fine, I tested it, but this code here makes the func_button not operate when both are in the same lua.....
Code:
FORT_POINTS_PER_DET = 100 |
i stuck your code in code tags so the smileys stop messing it up, taking a look now
|
All times are GMT. The time now is 02:22 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.