Fortress Forever

Go Back   Fortress Forever > Editing > Mapping

Reply
 
Thread Tools Display Modes
Old 09-25-2007, 02:13 AM   #1
Doompiggy
Banned
 
Doompiggy's Avatar
 
Join Date: Sep 2007
Location: Internet
Posts Rated Helpful 0 Times
Airshot map?

Ok, so I wanna make an airshot map like some in TFC, I want the people to be invincible on the ground, but take damage in the air.

What do I need to do for them to not take damage on the ground?
Doompiggy is offline   Reply With Quote


Old 09-25-2007, 02:50 AM   #2
Weezy69
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
that would be fun i remember only playin and discovering this mod on quake1 like 6 months ago
Weezy69 is offline   Reply With Quote


Old 09-25-2007, 03:32 AM   #3
trepid_jesse
Fortress Forever Staff
 
trepid_jesse's Avatar
 
Join Date: Jan 2005
Location: Texas
Posts Rated Helpful 0 Times
I think this was one of the example we came up with when dicking around with Lua.

I assume the vector shit is still exposed to Lua, but I don't really know if it is anymore. So, what you could do is put an info_ff_script on the ground, which will define the ground level. Then, you could check when a player has a z distance > 0 from that entity. If they aren't, then don't apply damage. Of course, that would depend on where the player is measured, which is probably from the origin of the player model, which I dunno where the fuck that is, and so you would just offset the check that distance.

Then agian, this is just me babbling, and if you aren't familiar with the Lua this makes zero sense.

Where you going? NOWHERE!
__________________
Support FF:

Trepid, what?
trepid_jesse is offline   Reply With Quote


Old 09-25-2007, 03:35 AM   #4
DillonBarba
Where is my mind?
 
DillonBarba's Avatar
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Send a message via AIM to DillonBarba
Quote:
Originally Posted by trepid_jesse
Where you going? NOWHERE!

boondock saints quote?
DillonBarba is offline   Reply With Quote


Old 09-25-2007, 03:36 AM   #5
trepid_jesse
Fortress Forever Staff
 
trepid_jesse's Avatar
 
Join Date: Jan 2005
Location: Texas
Posts Rated Helpful 0 Times
FUNNY! FUNNY!
__________________
Support FF:

Trepid, what?
trepid_jesse is offline   Reply With Quote


Old 09-25-2007, 03:39 AM   #6
public_slots_free
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
there is an IsOnGround function. Maybe that will work for you.
public_slots_free is offline   Reply With Quote


Old 09-25-2007, 04:28 AM   #7
AltPluzF4
Newb
 
AltPluzF4's Avatar
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Send a message via ICQ to AltPluzF4 Send a message via AIM to AltPluzF4 Send a message via MSN to AltPluzF4 Send a message via Yahoo to AltPluzF4
Quote:
Originally Posted by public_slots_free
there is an IsOnGround function. Maybe that will work for you.
Exactly! This is very easily done:

Code:
function player_ondamage(player_entity, damageinfo)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        if player:IsOnGround() then
            player:AddHealth(400)
            player:AddArmor(400)
            AddSchedule("addhp_" .. player:GetName(), 0.01, GiveHealth, player)
        end
    end
end

function GiveHealth(player_entity)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        player:AddHealth(400)
        player:AddArmor(400)
    end
end
***EDIT***
Just realised that it would be hard to kill like that... The player always starts with max health when leaving the ground.
Here's a revised version, that just "restores" your health to what it was IF you get damaged while on the ground. If you are damaged in the air, then you don't get healed.

Code:
function player_ondamage(player_entity, damageinfo)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        if player:IsOnGround() then
            AddSchedule("addhp_" .. player:GetName(), 0.01, RestoreHealth, player, player:GetHealth(), player:GetArmor())
        end
    end
end

function RestoreHealth(player_entity, prevHealth, prevArmor)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        player:AddHealth(prevHealth-player:GetHealth())
        player:AddArmor(prevArmor-player:GetArmor())
    end
end

Last edited by AltPluzF4; 09-25-2007 at 04:45 AM.
AltPluzF4 is offline   Reply With Quote


Old 09-25-2007, 06:08 AM   #8
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 AltPluzF4
Exactly! This is very easily done:

Code:
function player_ondamage(player_entity, damageinfo)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        if player:IsOnGround() then
            player:AddHealth(400)
            player:AddArmor(400)
            AddSchedule("addhp_" .. player:GetName(), 0.01, GiveHealth, player)
        end
    end
end

function GiveHealth(player_entity)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        player:AddHealth(400)
        player:AddArmor(400)
    end
end
***EDIT***
Just realised that it would be hard to kill like that... The player always starts with max health when leaving the ground.
Here's a revised version, that just "restores" your health to what it was IF you get damaged while on the ground. If you are damaged in the air, then you don't get healed.

Code:
function player_ondamage(player_entity, damageinfo)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        if player:IsOnGround() then
            AddSchedule("addhp_" .. player:GetName(), 0.01, RestoreHealth, player, player:GetHealth(), player:GetArmor())
        end
    end
end

function RestoreHealth(player_entity, prevHealth, prevArmor)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        player:AddHealth(prevHealth-player:GetHealth())
        player:AddArmor(prevArmor-player:GetArmor())
    end
end
Wow.. I'm in no way associated with mapping, but thanks for going through the coding for him.. Seems like you even tested it out..
gizmofo is offline   Reply With Quote


Old 09-25-2007, 07:25 AM   #9
AltPluzF4
Newb
 
AltPluzF4's Avatar
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Send a message via ICQ to AltPluzF4 Send a message via AIM to AltPluzF4 Send a message via MSN to AltPluzF4 Send a message via Yahoo to AltPluzF4
Quote:
Originally Posted by gizmofo
Wow.. I'm in no way associated with mapping, but thanks for going through the coding for him.. Seems like you even tested it out..
...that's what ff_2fort is for!
AltPluzF4 is offline   Reply With Quote


Old 09-25-2007, 08:19 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 AltPluzF4
...that's what ff_2fort is for!
LOL
gizmofo is offline   Reply With Quote


Old 09-25-2007, 10:18 AM   #11
stino
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
if a player is in the air he doesn't touch the ground > no surface
and surface type is accesible through lua.

so if you combine this with the no_spawnkilling functions found in one of the base files, you should be able to create something like this.
stino 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 09:31 AM.


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