01-03-2010, 03:47 PM | #1 |
How put gren into the bag?
The lua of the my map...
Code:
-- ff_sq6 lua file --- ------------------------------------------------------ -- includes ------------------------------------------------------ -- IncludeScript("base_ctf") IncludeScript("base_teamplay") IncludeScript("backpack") function startup() SetPlayerLimit(Team.kBlue, 0) SetPlayerLimit(Team.kRed, 0) SetPlayerLimit(Team.kYellow, -1) SetPlayerLimit(Team.kGreen, -1) SetTeamName( Team.kBlue, "Blue Team" ) SetTeamName( Team.kRed, "Red Team" ) local team = GetTeam(Team.kBlue) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kMedic, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) team = GetTeam(Team.kRed) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kMedic, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) end Last edited by PIT BULL; 01-07-2010 at 01:51 AM. |
|
|
01-03-2010, 04:17 PM | #2 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Code:
name_of_backpack_here = genericbackpack:new({ health = 0, armor = 0, grenades = 0, nails = 0, shells = 0, rockets = 0, cells = 0, gren1 = 0, gren2 = 0, model = "models/items/backpack/backpack.mdl", materializesound = "Item.Materialize", touchsound = "Backpack.Touch", botgoaltype = Bot.kBackPack_Ammo }) |
|
01-07-2010, 01:51 AM | #3 |
Is this name?
Code:
-- ff_sq6 lua file --- ------------------------------------------------------ -- includes ------------------------------------------------------ -- IncludeScript("base_ctf") IncludeScript("base_teamplay") -- IncludeScript("backpack") function startup() SetPlayerLimit(Team.kBlue, 0) SetPlayerLimit(Team.kRed, 0) SetPlayerLimit(Team.kYellow, -1) SetPlayerLimit(Team.kGreen, -1) SetTeamName( Team.kBlue, "Blue Team" ) SetTeamName( Team.kRed, "Red Team" ) local team = GetTeam(Team.kBlue) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kMedic, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) team = GetTeam(Team.kRed) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kMedic, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) red_bigpack = GenericBackpack:New({ health = 100, armor = 200, grenades = 0, nails = 0, shells = 50, rockets = 50, cells = 0, gren1 = 2, gren2 = 0, model = "models/items/backpack/backpack.mdl", materializesound = "Item.Materialize", touchsound = "Backpack.Touch", botgoaltype = Bot.kBackPack_Ammo }) blue_bigpack = GenericBackpack:New({ health = 100, armor = 200, grenades = 0, nails = 0, shells = 50, rockets = 50, cells = 0, gren1 = 2, gren2 = 0, model = "models/items/backpack/backpack.mdl", materializesound = "Item.Materialize", touchsound = "Backpack.Touch", botgoaltype = Bot.kBackPack_Ammo }) end Last edited by PIT BULL; 01-07-2010 at 02:00 AM. |
|
|
01-07-2010, 01:57 AM | #4 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
I believe that is correct — compile the map and see if a backpack shows up in game.
|
|
01-07-2010, 02:21 AM | #5 |
|
01-07-2010, 02:27 AM | #6 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Odd, try setting the 'grenades' variable to something like '2' or so for the backpack.
|
|
01-07-2010, 03:10 AM | #7 |
Nothing work! |
|
|
01-07-2010, 03:22 AM | #8 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
I actually believe it has to do with "GenericBackpack:New({})". I think the entity "GenericBackpack" is for non-grenade contents. Perhaps you could name it "GrenadeBackpack" and give that a try. For example:
Code:
red_bigpack = GrenadeBackpack:New({ health = 100, armor = 200, grenades = 0, nails = 0, shells = 50, rockets = 50, cells = 0, gren1 = 2, gren2 = 0, model = "models/items/backpack/backpack.mdl", materializesound = "Item.Materialize", touchsound = "Backpack.Touch", botgoaltype = Bot.kBackPack_Ammo }) |
|
01-07-2010, 03:54 AM | #9 |
Not choking. Yet.
Lua Team
Wiki Team Fortress Forever Staff Join Date: Jul 2007
Location: Scotland
Class/Position: Demo/Def - Spy/Off Gametype: Anything but yet more fucking CTF Affiliations: FF.AvD [FF AvD/ID guild] Posts Rated Helpful 0 Times
|
My guess would be that the backpack definitions shouldn't be inside the startup() function... essentially you need to move the 'end' operator above the backpack definitions.
e.g., what you posted in this post: http://forums.fortress-forever.com/s...12&postcount=3 should be: Code:
-- ff_sq6 lua file --- ------------------------------------------------------ -- includes ------------------------------------------------------ -- IncludeScript("base_ctf") IncludeScript("base_teamplay") -- IncludeScript("backpack") function startup() SetPlayerLimit(Team.kBlue, 0) SetPlayerLimit(Team.kRed, 0) SetPlayerLimit(Team.kYellow, -1) SetPlayerLimit(Team.kGreen, -1) SetTeamName( Team.kBlue, "Blue Team" ) SetTeamName( Team.kRed, "Red Team" ) local team = GetTeam(Team.kBlue) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kMedic, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) team = GetTeam(Team.kRed) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kMedic, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) end red_bigpack = GenericBackpack:New({ health = 100, armor = 200, grenades = 0, nails = 0, shells = 50, rockets = 50, cells = 0, gren1 = 2, gren2 = 0, model = "models/items/backpack/backpack.mdl", materializesound = "Item.Materialize", touchsound = "Backpack.Touch", botgoaltype = Bot.kBackPack_Ammo }) blue_bigpack = GenericBackpack:New({ health = 100, armor = 200, grenades = 0, nails = 0, shells = 50, rockets = 50, cells = 0, gren1 = 2, gren2 = 0, model = "models/items/backpack/backpack.mdl", materializesound = "Item.Materialize", touchsound = "Backpack.Touch", botgoaltype = Bot.kBackPack_Ammo })
__________________
Preferable to death. But only just...
|
|
01-07-2010, 04:01 AM | #10 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Yeah, I totally missed that. D:
|
|
01-07-2010, 04:10 AM | #11 |
Not choking. Yet.
Lua Team
Wiki Team Fortress Forever Staff Join Date: Jul 2007
Location: Scotland
Class/Position: Demo/Def - Spy/Off Gametype: Anything but yet more fucking CTF Affiliations: FF.AvD [FF AvD/ID guild] Posts Rated Helpful 0 Times
|
Well, I wasn't gonna say anything...
__________________
Preferable to death. But only just...
|
|
01-08-2010, 12:59 AM | #12 |
Done!
Code:
-- ff_sq6 lua file --- ------------------------------------------------------ -- includes ------------------------------------------------------ -- IncludeScript("base_ctf") IncludeScript("base_teamplay") -- IncludeScript("backpack") function startup() SetPlayerLimit(Team.kBlue, 0) SetPlayerLimit(Team.kRed, 0) SetPlayerLimit(Team.kYellow, -1) SetPlayerLimit(Team.kGreen, -1) SetTeamName( Team.kBlue, "Blue Team" ) SetTeamName( Team.kRed, "Red Team" ) local team = GetTeam(Team.kBlue) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kMedic, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) team = GetTeam(Team.kRed) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kMedic, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) end ff_sq6_grenpack = genericbackpack:new({ health = 100, armor = 200, grenades = 0, nails = 0, shells = 50, rockets = 50, cells = 0, gren1 = 2, gren2 = 0, respawntime = 1, model = "models/items/backpack/backpack.mdl", materializesound = "Item.Materialize", touchsound = "Backpack.Touch", botgoaltype = Bot.kBackPack_Ammo }) function ff_sq6_grenpack:dropatspawn() return false end blue_bigpack = ff_sq6_grenpack:new({ touchflags = { AllowFlags.kOnlyPlayers, AllowFlags.kBlue } }) red_bigpack = ff_sq6_grenpack:new({ touchflags = { AllowFlags.kOnlyPlayers, AllowFlags.kRed } }) Last edited by PIT BULL; 01-08-2010 at 01:01 AM. |
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|