Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   Mapping (https://forums.fortress-forever.com/forumdisplay.php?f=13)
-   -   LUA stuff (https://forums.fortress-forever.com/showthread.php?t=12444)

sir_frags 10-17-2007 01:11 PM

LUA stuff
 
Can any one give me a lua for a hammer teleporter

Desyphur 10-17-2007 03:23 PM

Why would you want this? More info would help, then I could try to find out.

A1win 10-17-2007 04:10 PM

Code:

classteleport = trigger_teleport:new({ })
hwguyteleport = classteleport:new({ class = Player.kHwguy }

function classteleport:allowed( allowed_entity )
  if IsPlayer( allowed_entity ) then
    local player = CastToPlayer( allowed_entity )
    if player:GetClass() == self.class then
      return true
    end
    return false
  end
end


A1win 10-17-2007 10:37 PM

Code:

weirdteleport = trigger_teleport:new({ })

function weirdteleport:allowed( allowed_entity )
  if IsPlayer( allowed_entity ) then
    local player = CastToPlayer( allowed_entity )
    if player:GetClass() == Player.kScout or player:GetClass() == Player.kSniper or player:GetClass() == Player.kMedic then
      return false
    end
    return true
  end
end

No more complicated than that...

A1win 10-18-2007 12:23 AM

I've been programming small stuff since I was 12 or something. All I need to do is learn the syntax of the language and I can do the basic stuff with it. I actually know why the code does what you needed, not just what it does ;)

stino 10-19-2007 10:55 AM

a little more then only the syntax :D
all the custom ff commands and constants are required knowledge if you want to code fast and efficiently, but therefore i like to have a doc page where they explain the parameters for all the functions, becouse the errors you get ingame are quite difficult to understand: for ex: player:GetTeamId() will cast an error that the parameter required is nil, why becouse i didn't declarate the "player" var, while other languages just say that player is unknown to the interpreter.

McManCSU 10-19-2007 03:00 PM

Is there some API for the game that you can use? You mentioned something about some documentation, do you have a link?

public_slots_free 10-19-2007 03:05 PM

I would guess, that could only come from the FF team

stino 10-19-2007 03:42 PM

Quote:

Originally Posted by McManCSU
Is there some API for the game that you can use? You mentioned something about some documentation, do you have a link?

i mentioned something about some documentation ... yeah, i said documentation could be a lot more helpfull than just a plain list of functions.

A1win 10-20-2007 10:06 AM

I'm sure they're working on it... be patient :p


All times are GMT. The time now is 07:51 PM.

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