Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 09-20-2007, 07:45 PM   #1
mervaka
A Very Sound Guy!
Fortress Forever Staff
 
mervaka's Avatar
 
Join Date: May 2005
Location: UK
Posts Rated Helpful 15 Times
[REQUEST]: Can Lua coders and Mappers pair up?

ok i'll like make this thread a Lua request board for mappers to call upon the talent of all the Lua coders out there, and likewise for Lua coders to post themselves up with A/S/L details etc
__________________
Support FF:
mervaka is offline   Reply With Quote


Old 09-20-2007, 07:47 PM   #2
mervaka
A Very Sound Guy!
Fortress Forever Staff
 
mervaka's Avatar
 
Join Date: May 2005
Location: UK
Posts Rated Helpful 15 Times
i for one know a bit on lua coding. i'm free to hook people up with Lua if i've got time
__________________
Support FF:
mervaka is offline   Reply With Quote


Old 09-20-2007, 07:52 PM   #3
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
this is actually a very good idea Merv. i am completely ignorant about LUA and have 3 maps ready to go. although Sidd has helped me out alot with 2 of them, i still need 1 for my sgwar map. if anybody cares to draw it up here are the details:

1)2 teams-red and blue

2)6 spawn points each

3)engys only

4)constantly replenishes ammo

5)1 door split in 2(top half going up, bottom half going down)

6)doors opening every 15 seconds and closing every 15 seconds(i will tweek this as needed)

7)sounds?

all i can think of now.
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 09-20-2007, 08:55 PM   #4
Donny
Community Mapper&Idiot
 
Donny's Avatar
 
Join Date: Mar 2007
Location: Finland
Posts Rated Helpful 1 Times
I dont need this lua for a while but I guess there are people faster than me wanting to have warpath style maps.
So 5 CP, each team has 4 respawns.
So when lets say Red team has CP 4, they spawn on their 4th spawn, and when they have CP 3 they spawn on their 3rd spawn, when they have CP 2 they spawn on their 2nd spawn and when they have CP 1 (the way the game starts) they spawn at their main respawn. When one team has the CP 5 the round restarts.

Also note, if Red team has CP 4, that means that they have CP 3, 2 and 1. Blue can only capture CP 4. So In order to take CP2 they must first capture 4, 3 and then they can take 2.

I think the basic idea is known to most of the people.
Donny is offline   Reply With Quote


Old 09-20-2007, 11:56 PM   #5
elchupacabra
 
elchupacabra's Avatar
 
Join Date: Mar 2007
Location: United Kingdom
Posts Rated Helpful 0 Times
I really need a piece of lua code for rmpfort2 but I am just utterly hopeless at code related things.

Basically, when red cap the blue flag I want some ambient_generics and an env_shake to trigger (also when blue cap the red flag of course).

elchupacabra is offline   Reply With Quote


Old 09-21-2007, 04:46 PM   #6
[P]Infidel
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
I love FF and want to give something back. Hopefully I can help the community get the maps it wants. I have been coding for a long time now and have experience with Lua (developing addons in WoW, and being the programmer that integrated Lua into a game engine on a team I worked on)

There's tonnes of mappers needing help from the looks of it, and I can't give you answers yet. But I wanna dig into it and learn how this all works with FF so that I can. If there is a solid mapper out there that has a good idea of what they need to have developed and they have their map finished or close to it I'd like to work together with them so that we can learn. I ask that because we want to have it playable ASAP so that we can test and work out the bugs having it up for playtesting, and there are simply too many people needing attention.

Send me a PM on the forums here if you're interested and we can check out your maps.
[P]Infidel is offline   Reply With Quote


Old 09-21-2007, 06:02 PM   #7
mervaka
A Very Sound Guy!
Fortress Forever Staff
 
mervaka's Avatar
 
Join Date: May 2005
Location: UK
Posts Rated Helpful 15 Times
Quote:
Originally Posted by [P]Infidel
I love FF and want to give something back. Hopefully I can help the community get the maps it wants. I have been coding for a long time now and have experience with Lua (developing addons in WoW, and being the programmer that integrated Lua into a game engine on a team I worked on)

There's tonnes of mappers needing help from the looks of it, and I can't give you answers yet. But I wanna dig into it and learn how this all works with FF so that I can. If there is a solid mapper out there that has a good idea of what they need to have developed and they have their map finished or close to it I'd like to work together with them so that we can learn. I ask that because we want to have it playable ASAP so that we can test and work out the bugs having it up for playtesting, and there are simply too many people needing attention.

Send me a PM on the forums here if you're interested and we can check out your maps.
i basically taught myself from jumping in at the deep end with modifying the base lua. map specific lua for common gametypes is really easy though, check out a standard ctf map and see!
__________________
Support FF:
mervaka is offline   Reply With Quote


Old 09-21-2007, 06:08 PM   #8
Sidd
Lua Team
 
Join Date: Mar 2007
Posts Rated Helpful 1 Times
wiki pls
Sidd is offline   Reply With Quote


Old 09-22-2007, 03:14 AM   #9
Sh4x
Retired FF Staff
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
merv, I'm pretty much done with ff_fatties, all I need is some lua code that makes the round timer display on my "speedometer" texture ala aardvark and to make dead ppl respawn behind the glass until the round is over.

If you think you can help me with that, I could maybe release ff_fatties before leaving for europe in 2 days.
Sh4x is offline   Reply With Quote


Old 09-22-2007, 03:28 AM   #10
gizmofo
The Bestest
 
gizmofo's Avatar
 
Join Date: Apr 2007
Location: Portland, OR
Posts Rated Helpful 0 Times
Send a message via AIM to gizmofo
Quote:
Originally Posted by Sh4x
merv, I'm pretty much done with ff_fatties, all I need is some lua code that makes the round timer display on my "speedometer" texture ala aardvark and to make dead ppl respawn behind the glass until the round is over.

If you think you can help me with that, I could maybe release ff_fatties before leaving for europe in 2 days.
^^
SOMEONE HELP HIM!
How long are you going to be gone?
gizmofo is offline   Reply With Quote


Old 09-22-2007, 03:41 AM   #11
Sh4x
Retired FF Staff
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
around 3-4 months
Sh4x is offline   Reply With Quote


Old 09-22-2007, 11:30 AM   #12
Steven_m64
Insane Coder
 
Join Date: Jun 2007
Posts Rated Helpful 0 Times
Send a message via ICQ to Steven_m64 Send a message via AIM to Steven_m64 Send a message via MSN to Steven_m64 Send a message via Yahoo to Steven_m64
i have been coding for a long time now and anyone who has a interesting map they would like lua help with is free to contact me via any of the IM programs in my profile for help im also in FF's irc channel on gamesurge often.
Steven_m64 is offline   Reply With Quote


Old 09-23-2007, 12:29 AM   #13
Donny
Community Mapper&Idiot
 
Donny's Avatar
 
Join Date: Mar 2007
Location: Finland
Posts Rated Helpful 1 Times
Help Sh4x!
Donny is offline   Reply With Quote


Old 09-23-2007, 02:37 AM   #14
Sh4x
Retired FF Staff
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
I sent my package to mervaka already but if Steven thinks he can do it faster, that'd be great. Cause I'm leaving in 2 days so yeah... after that it's gonna be alot more complicated to map for me, I don't even know if it's gonna be possible.
Sh4x is offline   Reply With Quote


Old 09-23-2007, 11:53 AM   #15
Sidd
Lua Team
 
Join Date: Mar 2007
Posts Rated Helpful 1 Times
Made this lua for gambit, but it probably helps sh4x too:
hwguyslua

As for a round timer, probably lots of textured func_doors being opened/closed by AddSchedule stuff is the easiest way.
Sidd is offline   Reply With Quote


Old 09-23-2007, 03:22 PM   #16
Sh4x
Retired FF Staff
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
I think a simple variable that increments every second passed to a proxy texture would be cleaner. BUT I still don't know how to do that.
Here's my actual lua:

Code:
-- ff_fatties1.lua

-----------------------------------------------------------------------------
-- includes
-----------------------------------------------------------------------------
IncludeScript("base_ctf")
IncludeScript("base_location")

-----------------------------------------------------------------------------
-- globals (lawl... unless it starts with "local" its already a global!)
-----------------------------------------------------------------------------
-- override this
POINTS_PER_CAPTURE = 2

ROUND_TIMER_START = 60
ROUND_TIMER_STOP = 0
ROUND_TIMER_CURRENT = ROUND_TIMER_START

-----------------------------------------------------------------------------
-- initial stuff
-----------------------------------------------------------------------------
function startup()
	-- set up team limits	
	SetPlayerLimit( Team.kBlue, 0 )
	SetPlayerLimit( Team.kRed, 0 )
	SetPlayerLimit( Team.kYellow, -1 )
	SetPlayerLimit( Team.kGreen, -1 )

	-- both teams limited to medics & hwguys
	for i = Team.kBlue, Team.kRed do
		local team = GetTeam( i )

		team:SetClassLimit( Player.kScout, -1 )
		team:SetClassLimit( Player.kSniper, -1 )
		team:SetClassLimit( Player.kSoldier, -1 )
		team:SetClassLimit( Player.kDemoman, -1 )
		team:SetClassLimit( Player.kPyro, -1 )
		team:SetClassLimit( Player.kSpy, -1 )
		team:SetClassLimit( Player.kEngineer, -1 )
		team:SetClassLimit( Player.kCivilian, -1 )
	end

	-- Start door schedule
	StartDoorOpenSchedule()
end

-----------------------------------------------------------------------------
-- player stuff
-----------------------------------------------------------------------------
function player_spawn( spawn_entity )
	local player = CastToPlayer( spawn_entity )

	player:AddHealth( 100 )
	player:AddArmor( 300 )

	-- Players get everything except grenades
	player:AddAmmo( Ammo.kNails, 400 )
	player:AddAmmo( Ammo.kShells, 400 )
	player:AddAmmo( Ammo.kRockets, 400 )
	player:AddAmmo( Ammo.kCells, 400 )
	player:AddAmmo( Ammo.kDetpack, 1 )
	player:RemoveAmmo( Ammo.kGren1, 4 )
	player:RemoveAmmo( Ammo.kGren2, 4 )
end

function player_killed( killed_entity )
	local player = CastToPlayer( killed_entity )

	-- Guy stays dead until round is over
	player:SetRespawnable( false )
end

-----------------------------------------------------------------------------
-- capture point overrides
-----------------------------------------------------------------------------
function red_cap:oncapture( player, item )
	-- do base class stuff (play sounds)
	-- make the call passing in self as well as the params
	basecap.oncapture( self, player, item )

	DoCaptureLogic()
end

function blue_cap:oncapture( player, item )
	-- do base class stuff (play sounds)
	-- make the call passing in self as well as the params
	basecap.oncapture( self, player, item )

	DoCaptureLogic()
end

-----------------------------------------------------------------------------
-- map stuff
-----------------------------------------------------------------------------
function DoCaptureLogic()
	ConsoleToAll( "DoCaptureLogic" )
	DoRoundResetLogic()	
end

function DoRoundResetLogic()
	ConsoleToAll( "DoRoundResetLogic" )	

	-- stop round timer schedule if its still going
	DeleteSchedule( "round_timer_schedule" )

	-- Reset round timer
	ResetRoundTimer()	

	-- close door
	CloseDoor( "forceshield" )

	-- reset door schedule
	StartDoorOpenSchedule()
	
	-- finally, respawn everybody
	RespawnEveryone()
end

function DoRoundOverLogic()
	ConsoleToAll( "DoRoundOverLogic" )

	CheckTeamAliveState( Team.kBlue )
	CheckTeamAliveState( Team.kRed )
end

function CheckTeamAliveState( team )
	ConsoleToAll( "CheckTeamAliveState" )
	
	-- Need to test if one player on either team is still
	-- alive and if so, award that team a point
	
	local c = Collection()

	if (team == Team.kBlue) then
		c:GetByFilter({ CF.kPlayers, CF.kTeamBlue })
	else
		c:GetByFilter({ CF.kPlayers, CF.kTeamRed })
	end

	ConsoleToAll( "Count: " .. c:Count() )

	if (c:Count() > 0) then
		local bAlive = false

		for temp in c.items do
			local player = CastToPlayer( temp )
			if player:IsAlive() then
				bAlive = true
			end
		end

		if bAlive then
			local team = GetTeam( Team.kRed )
			team:AddScore( 1 )
		end
	end
end

function StartDoorOpenSchedule()
	ConsoleToAll( "starting door_open_schedule" )
	AddSchedule( "door_open_schedule", 3, door_open_schedule )
end

function ResetRoundTimer()
	ROUND_TIMER_CURRENT = ROUND_TIMER_START
end

function RespawnEveryone()
	ApplyToAll({ AT.kRemovePacks, AT.kRemoveProjectiles, AT.kRespawnPlayers, AT.kRemoveBuildables, AT.kRemoveRagdolls, AT.kStopPrimedGrens, AT.kReloadClips, AT.kAllowRespawn, AT.kReturnDroppedItems })
end

-----------------------------------------------------------------------------
-- map stuff - schedules
-----------------------------------------------------------------------------
function door_open_schedule()
	ConsoleToAll( "door_schedule" )

	ConsoleToAll( "opening forceshield" )
	OpenDoor( "forceshield" )	

	ConsoleToAll( "starting round timer schedule" )
	AddScheduleRepeating( "round_timer_schedule", 1, round_timer_schedule )
end

function round_timer_schedule()
	ConsoleToAll( "round_timer_schedule" )

	-- Adjust round timer
	ROUND_TIMER_CURRENT = ROUND_TIMER_CURRENT - 1

	ConsoleToAll( "Timer: " .. ROUND_TIMER_CURRENT )

	if (ROUND_TIMER_CURRENT < 1) then
		DoRoundOverLogic()
		DoRoundResetLogic()
	end	
end
Sh4x is offline   Reply With Quote


Old 09-23-2007, 06:09 PM   #17
Doughnut-4|4-
 
Join Date: May 2007
Posts Rated Helpful 0 Times
This sticky is greatly welcomed. I vow to help when I am able if anyone asks for me, but my knowledge is limited. Just a few points to help people starting out, and please correct me if I'm wrong:

1) LUA is only needed for Fortress related entities and most specifically Team related entities. This includes: Flags, Caps, Spawns, Bags, and Team activations such as Door entries. Things like time triggers can be set independently without utilizing LUA scripts generally speaking if they aren't related to Team Events.

2) There is a folder, I think inside the FortressForever/maps folder which has an archive of various LUA scripts organized by type. Copy and paste from these if you can comprehend which ones you require.
Doughnut-4|4- is offline   Reply With Quote


Old 09-23-2007, 06:15 PM   #18
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
i still need a LUA for my sg_war map!!!!
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 09-23-2007, 06:39 PM   #19
nodnarb
 
Join Date: Mar 2007
Posts Rated Helpful 5 Times
Quote:
Originally Posted by Sidd
Made this lua for gambit, but it probably helps sh4x too:
hwguyslua

As for a round timer, probably lots of textured func_doors being opened/closed by AddSchedule stuff is the easiest way.
heh
nodnarb is offline   Reply With Quote


Old 09-23-2007, 11:06 PM   #20
barronofhellion
 
barronofhellion's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 0 Times
Quote:
Originally Posted by mervaka
i for one know a bit on lua coding. i'm free to hook people up with Lua if i've got time
i love u long time
barronofhellion 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 12:42 AM.


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