09-25-2007, 02:13 AM | #1 |
Banned
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? |
|
09-25-2007, 02:50 AM | #2 |
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
|
|
09-25-2007, 03:32 AM | #3 |
Fortress Forever Staff
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! |
|
09-25-2007, 03:35 AM | #4 | |
Where is my mind?
|
Quote:
boondock saints quote? |
|
|
09-25-2007, 03:39 AM | #6 |
Join Date: Sep 2007
Posts Rated Helpful 0 Times
|
there is an IsOnGround function. Maybe that will work for you.
|
|
09-25-2007, 04:28 AM | #7 | |
Newb
|
Quote:
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 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. |
|
|
09-25-2007, 06:08 AM | #8 | |
The Bestest
|
Quote:
|
|
|
09-25-2007, 07:25 AM | #9 | |
Newb
|
Quote:
|
|
|
09-25-2007, 08:19 AM | #10 | |
The Bestest
|
Quote:
|
|
|
09-25-2007, 10:18 AM | #11 |
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. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|