View Single Post
Old 02-16-2013, 10:45 AM   #94
homie in reboks'
 
homie in reboks''s Avatar
 
Join Date: Jun 2011
Location: USA
Class/Position: Soldier & Medic
Affiliations: ( ir :: ) iv| K^ †
Posts Rated Helpful 80 Times
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!
endzone = trigger_ff_script:new({
       points_per_score = 6,
       fortpoints_per_score = 100
       allowedmethod = redTeamOnly
})
--Access to events is typically in the following format:

function endzone:ontrigger( entity )
  --What to do when this method is called
  --return anything, if necessary
end
Modified to fit my needs, but I messed it up because when I added it to my lua it re-enabeld all 4 teams and wouldn't allow me to choose a class.

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:
--------------------------------------------------------------------------
-- Yard Lift
--------------------------------------------------------------------------
base_angle_jump = trigger_ff_script:new( {pushz=0, pushx=0, pushy=0} )

function base_angle_jump:ontouch( trigger_entity )
	if IsPlayer(trigger_entity) then
		local player = CastToPlayer(trigger_entity)
		local playerVel = player:GetVelocity()
		if self.pushz ~= 0 then playerVel.z = self.pushz end
		if self.pushx ~= 0 then playerVel.x = self.pushx end
		if self.pushy ~= 0 then playerVel.y = self.pushy end
		player:SetVelocity( playerVel )
	end
end

yardvent_red = base_angle_jump:new( {pushz=760, pushx=-0, pushy=1800} )
yardvent_blue = base_angle_jump:new( {pushz=760, pushx=-0, pushy=-1800} )
fr_vent_red2 = base_angle_jump:new( {pushy=-1600} )
fr_vent_blue2 = base_angle_jump:new( {pushy=1600} )
yardvent_red & yardvent_blue are the two specific one's Im looking to modify.

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.
__________________
homie in reboks' is offline   Reply With Quote