Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 01-03-2010, 03:47 PM   #1
PIT BULL
 
PIT BULL's Avatar
 
Join Date: Feb 2009
Location: Brazil
Class/Position: Random Class
Gametype: Team Fortress
Affiliations: FANATICOS.ORG
Posts Rated Helpful 0 Times
Send a message via ICQ to PIT BULL Send a message via MSN to PIT BULL
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.
PIT BULL is offline   Reply With Quote


Old 01-03-2010, 04:17 PM   #2
Bridget
Banned
 
Bridget's Avatar
 
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
})
You need to define the contents of grenade backpacks in LUA. The 'Grenades' variable is for the Demoman, I believe. You set the actual grenade specifics with gren1 and gren2. Once you finish configuring that, you can go into Valve Hammer and place an info_ff_script and name it the same name as the backpack above, which is "name_of_backpack_here".
Bridget is offline   Reply With Quote


Old 01-07-2010, 01:51 AM   #3
PIT BULL
 
PIT BULL's Avatar
 
Join Date: Feb 2009
Location: Brazil
Class/Position: Random Class
Gametype: Team Fortress
Affiliations: FANATICOS.ORG
Posts Rated Helpful 0 Times
Send a message via ICQ to PIT BULL Send a message via MSN to PIT BULL
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
This way is correct? Cos don't working...

Last edited by PIT BULL; 01-07-2010 at 02:00 AM.
PIT BULL is offline   Reply With Quote


Old 01-07-2010, 01:57 AM   #4
Bridget
Banned
 
Bridget's Avatar
 
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.
Bridget is offline   Reply With Quote


Old 01-07-2010, 02:21 AM   #5
PIT BULL
 
PIT BULL's Avatar
 
Join Date: Feb 2009
Location: Brazil
Class/Position: Random Class
Gametype: Team Fortress
Affiliations: FANATICOS.ORG
Posts Rated Helpful 0 Times
Send a message via ICQ to PIT BULL Send a message via MSN to PIT BULL
Look this video. The bag is there, but dont give me grens.

http://www.xfire.com/video/1dbf17/
PIT BULL is offline   Reply With Quote


Old 01-07-2010, 02:27 AM   #6
Bridget
Banned
 
Bridget's Avatar
 
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.
Bridget is offline   Reply With Quote


Old 01-07-2010, 03:10 AM   #7
PIT BULL
 
PIT BULL's Avatar
 
Join Date: Feb 2009
Location: Brazil
Class/Position: Random Class
Gametype: Team Fortress
Affiliations: FANATICOS.ORG
Posts Rated Helpful 0 Times
Send a message via ICQ to PIT BULL Send a message via MSN to PIT BULL


Nothing work!
PIT BULL is offline   Reply With Quote


Old 01-07-2010, 03:22 AM   #8
Bridget
Banned
 
Bridget's Avatar
 
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
})
If that doesn't work, then I am out of my element. D:
Bridget is offline   Reply With Quote


Old 01-07-2010, 03:54 AM   #9
Pon
Not choking. Yet.
Lua Team
Wiki Team
Fortress Forever Staff
 
Pon's Avatar
 
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
})
Hope this helps
__________________
Support FF:

YOU GUYS REALLY SHOULD UPDATE YOUR STAFF LIST!
I haven't posted since 2010...

Preferable to death. But only just...
Pon is offline   Reply With Quote


Old 01-07-2010, 04:01 AM   #10
Bridget
Banned
 
Bridget's Avatar
 
Join Date: Sep 2008
Class/Position: Soldier
Gametype: AVD
Affiliations: TALOS
Posts Rated Helpful 5 Times
Yeah, I totally missed that. D:
Bridget is offline   Reply With Quote


Old 01-07-2010, 04:10 AM   #11
Pon
Not choking. Yet.
Lua Team
Wiki Team
Fortress Forever Staff
 
Pon's Avatar
 
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...
__________________
Support FF:

YOU GUYS REALLY SHOULD UPDATE YOUR STAFF LIST!
I haven't posted since 2010...

Preferable to death. But only just...
Pon is offline   Reply With Quote


Old 01-08-2010, 12:59 AM   #12
PIT BULL
 
PIT BULL's Avatar
 
Join Date: Feb 2009
Location: Brazil
Class/Position: Random Class
Gametype: Team Fortress
Affiliations: FANATICOS.ORG
Posts Rated Helpful 0 Times
Send a message via ICQ to PIT BULL Send a message via MSN to PIT BULL
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.
PIT BULL 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 02:12 AM.


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