PDA

View Full Version : Doors.


Credge
03-22-2008, 08:35 PM
This is absolutely annoying me and I'm just about ready to quit.

I can create a door just fine. I can get it to "budge" in the right direction I want to move, but it won't move more than a few inches. Even further, I can't make it so only my team can use the door.

So, really, I can't create a door just fine. Something as simple, and as required, as a door should require code that looks like this:

blue_tri_door2 = trigger_ff_script:new({ team = Team.kBlue })

function blue_tri_door2:allowed( touch_entity )
if IsPlayer( touch_entity ) then
local player = CastToPlayer( touch_entity )
return player:GetTeamId() == self.team
end

return EVENT_DISALLOWED
end

function blue_tri_door2:ontrigger( touch_entity )
if IsPlayer( touch_entity ) then
OutputEvent("blue_door_2", "Open")
end
end


Taken from blis_2fort. I mean, I can't even begin to dissect what I'm supposed to do here in order to make a similar door.

Is that even needed? I've seen that monkey doesn't even have stuff in its lua for doors.

:|

Dr.Satan
03-22-2008, 09:04 PM
are you using a trigger with your door to get it to activate? You need to make the trigger and then in the lua have it only activate when a certain team touches it.

I'll dig up a tut on door when i have a min to.

Credge
03-22-2008, 09:15 PM
are you using a trigger with your door to get it to activate? You need to make the trigger and then in the lua have it only activate when a certain team touches it.

I'll dig up a tut on door when i have a min to.

I got it to work thanks to apone and his infinite patience and awesomeness. Still dig up that tut for me though please, I'm sure I'll need it again =P.

Dr.Satan
03-24-2008, 05:25 AM
yeah I'll look for it when I'm at work tomorrow. ;)

Jester
03-24-2008, 08:23 AM
http://www.sgware.be/?p=tutorials&f=view&id=17
This one? You'll have to replace the class code with team.

Dr.Satan
03-24-2008, 03:23 PM
Nice jester...also a few more, don't take everything from them cause they may not apply to what your doing, but there is some helpful stuff:

http://www.snarkpit.net/editing.php?page=tutorials&id=133
http://www.snarkpit.net/editing.php?page=tutorials&id=154

also check Editlife (http://www.editlife.net/tutorial.php) for anything helpful.