Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   Mapping (https://forums.fortress-forever.com/forumdisplay.php?f=13)
-   -   [REQ] Resupply brush tutorial (https://forums.fortress-forever.com/showthread.php?t=18644)

MonoXideAtWork 01-06-2009 01:12 PM

[REQ] Resupply brush tutorial
 
can someone point me to a tut, or offer some advice on resupply brushes such as those in ff_aardvark. Thanks!

Bridget 01-06-2009 04:16 PM

I'm assume you mean the glass pads in the respawn that resupply you? If so, this is done via lua. (create a text file in the same directory as your map in the FortressForever mod folder under steamapps and name it x.lua, where x is the name of your map — the same name as the .bsp it was saved under.)

Create a brush over the glass pad (which is created in hammer; standard brush work.). Select your brush. Open the texture application tool, hit browse, type 'trigger' into the texture search box. Select the orange texture with 'trigger' written on it. You can alter the size of the brush depending on the respawn zone or height depending upon if you want players to have to land on it or give them the ability to jump through it (such as the vertical-respawns on startec.) Open the properties for this brush (double click it or right click in a grid window and select properties) and set it as a trigger_ff_script (hit apply to set it) and name it either blue_resup or red_resup depending on team that can use it. [NOTE: If you can't set it to trigger_ff_script via properties, hit ctrl-t with it selected to do so.]

Code:

function resup:ontouch( touch_entity )
        if IsPlayer( touch_entity ) then
                local player = CastToPlayer( touch_entity )
                if player:GetTeamId() == self.team then
                        player:AddHealth( 400 )
                        player:AddArmor( 400 )
                        player:AddAmmo( Ammo.kNails, 400 )
                        player:AddAmmo( Ammo.kShells, 400 )
                        player:AddAmmo( Ammo.kRockets, 400 )
                        player:AddAmmo( Ammo.kCells, 400 )
                end
        end
end

blue_resup = resup:new({ team = Team.kBlue })
red_resup = resup:new({ team = Team.kRed })
resup = trigger_ff_script:new({ team = Team.kUnassigned })

Paste that into the .lua file and save. It should work from there. You can use the lua to edit what you want to add to the player or even remove from the player. Note, this was copied directly from the aardvark lua, because I don't remember the functions off the top of my head.

MonoXideAtWork 01-06-2009 04:36 PM

fabulous. thanks!

Crazycarl 01-06-2009 05:18 PM

Nice tutorial, Bridget. I'm linking this in the "All Your Mapping Needs" thread.


All times are GMT. The time now is 03:40 AM.

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