spawn protection (ways to prevent from spawn killing)

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

Post Reply
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

spawn protection (ways to prevent from spawn killing)

Post by Luk4ward »

Hi,

didnt find any command for it..So i guess its impossible to set so easily...Can it be done somehow?

regards
Last edited by Luk4ward on Sat Jan 20, 2007 5:23 am, edited 1 time in total.
wolFTeam.pl
User avatar
Nail
Posts: 425
Joined: Fri Jan 02, 2004 3:47 pm
Contact:

Post by Nail »

afaik, only on shrub based mods
Improvise, Adapt, Overcome
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

Nappy wrote a lua so you can set this in ETPro too.

http://wolfwiki.anime.net/index.php/User:Nappy
GhosT:McSteve
Ghostworks Gaming Community
User avatar
Clutch152
Posts: 33
Joined: Thu Oct 12, 2006 8:52 pm

Post by Clutch152 »

I have a spawn protection thing in the mod I am working on. Basically everyone will keep their spawn shield until they move or shoot. After the player moves or shoots they keep their protection for the normal 3 seconds and thats it. The one drawback to this is it requires the use of g_inactivity set higher than 1. If g_inactivity is set to 0 then the mods spawn protect feature will also be disabled.

If you wish to just simply increase or decrease the time with lua then you could write this:

Code: Select all

function et_RunFrame( levelTime )
     mtime = levelTime
end

function et_ClientSpawn(clientNum,revived)
     local spawnProtect = mtime + 3000 -- 3000 is default spawn shield time
     if revived == 0 then
          et.gentity_set(clientNum,"ps.powerups", 1, spawnProtect)
    end
end
Or you could use nappy's method of changing the invulnerability time for the whole team
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

thanks again :)

Nappy said that time is in miliseconds...And the default shield is 3 miliseconds...But then it is 10^-3*3 seconds...Is it true?
wolFTeam.pl
Nappy
Posts: 15
Joined: Mon Apr 10, 2006 4:52 pm

Post by Nappy »

That was an error. All times are in ms. Thanks.
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

No problem, but still got question. In this script is:

Code: Select all

-- This script modifies the duration of the spawn shield.  If either g_alliedSpawnInvul or g_axisSpawnInvul are non-zero, they will override g_spawnInvul.
-- Resulting cvars&#58; g_spawnInvul < duration >, g_axisSpawnInvul < duration >, g_alliedSpawnInvul < duration >  &#40; all times in milliseconds &#41;
-- If none of the above cvars are present, spawn shield time will default to defaultSpawnInvul 
 
-- DEFAULT VALUE
defaultSpawnInvul = 3
So the error is only with defaultSpawnInvul...But then whats the defualt time of spawn protection in minutes?

If i set only g_spawnInvul to about 180000, i guess i do not have to set other cmds and the spawn protection will be about 3 mins, yes?

Regards
wolFTeam.pl
Nappy
Posts: 15
Joined: Mon Apr 10, 2006 4:52 pm

Post by Nappy »

defaultSpawnInvul is only used when g_alliedSpawnInvul, g_axisSpawnInvul, and g_spawnInvul are all either zero or do not exist. Both g_alliedSpawnInvul and g_axisSpawnInvul take precedence over g_spawnInvul.

You only need to use the axis and allied timers if you want each team to have a different duration. Oasis is a good example. Allies spawnshield can be increased but it's a bad idea to increase axis spawnshield.

The file is updated. defaultSpawnInvul = 3000
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

Hello again,


I was wondering about more enhanced anti spwan system. Clutch152's system is based on movements (kmod), but I thought about the better way. Clutch152 is saying that its not possible :P, McSteve smth other...The idea is based on firing by player, so if a respawned player is firing his SpawnInvultime will be gone (or will be 2 times short) otherwise it will be counted double time or smth...

So the question is: it is possible?

Regards
wolFTeam.pl
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

If you are going down the lua route (which I know you are), I'm not aware of any working method for measuring whether or not a client is firing. Using sess.aWeaponStats might have worked, but its broken apparently. There is another field, sess.damage_given, that you could use. I did a quick test and it seems to work fine. This will only tell you a client's damage given, and so it wont detect if he is firing, but it will tell you if he has inflicted damage. Mine and dyno damage would get counted too, but they are relatively infrequent compared to light weapons fire and so they may serve the purpose well enough.
GhosT:McSteve
Ghostworks Gaming Community
User avatar
Clutch152
Posts: 33
Joined: Thu Oct 12, 2006 8:52 pm

Post by Clutch152 »

yea mine uses the clients inactivity. So if a player shoots or moves they become active thereby enabling the 3 second countdown. Otherwise they can stand there and look around and retain their spawn shield. The one drawback is if the player doesnt move they will get kicked for inactivity because the client inactivity detector requires the use of g_inactivity. What I had originally wanted to do was let the player retain their spawnshield unless they move then it would count down from 3 seconds. But if they were to shoot they would loose their shield entirely. But alas I cannot do that...yet
Image
User avatar
ReyalP
Posts: 1663
Joined: Fri Jul 25, 2003 11:44 am

Post by ReyalP »

Just FWIW, aWeaponStats should be fixed in the next version.
send lawyers, guns and money
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

w00t!

Makes me very happy, got a lua script on hold for that one.

Much <3 @ ETPro team.

On topic: Luk4ward, from what Clutch has said and after reading up on his mod, I really dont think there is much to improve on. Just set a high time for g_inactivity and it will do what you want. Does it really matter if the player can look around with his mouse for as long as he wants?
GhosT:McSteve
Ghostworks Gaming Community
User avatar
Clutch152
Posts: 33
Joined: Thu Oct 12, 2006 8:52 pm

Post by Clutch152 »

lol I found if you set the g_inactivity to high it glitches up and goes to some weird number and boots really fast.
Image
Post Reply