Last Resistance (Survivor Mod)
MetaMind
Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
HEy there,
I want to make a mod that would really suits the NS2 gameplay genre.
<!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->So the basic idea is:<!--sizec--></span><!--/sizec-->
<!--coloro:#00FFFF--><span style="color:#00FFFF"><!--/coloro-->-------------------------------------------------------------------------------------------------<!--colorc--></span><!--/colorc-->
Every player starts as marine, except one guy that is going alien (random slection)
All marines are fighting as a team.
The marine weapons are placed all around the map.
If the alien kill a marine, he will mutate to an alien, until all marines are killed and mutated to an alien.
Goal: Marines get points per second they survived as marine, the one with highest score wins
<!--coloro:#00FFFF--><span style="color:#00FFFF"><!--/coloro-->-------------------------------------------------------------------------------------------------<!--colorc--></span><!--/colorc-->
<!--coloro:#F4A460--><span style="color:#F4A460"><!--/coloro-->What I try to accomplish is an exponentially intensiving gameplay flow.<!--colorc--></span><!--/colorc-->
At first it will be easy for marines to defend them selves, after few marines mutated it will gradually get more serious until all hell breaks loose and only one marines is left against a horde of aliens.
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--><!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->But here comes the clue:<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc-->
To give the first alien a chance to kill a marine, he will be a fade (for expl.) who has 200% HP
After he got a kill, from there on all aliens will be born as skulks with 200%HP and leap researched (only upgrade availble at the time)
After <!--coloro:#FFC0CB--><span style="color:#FFC0CB"><!--/coloro-->10-20%<!--colorc--></span><!--/colorc--> marines mutated to aliens, the alien HP will be automaticly set to <!--coloro:#FFC0CB--><span style="color:#FFC0CB"><!--/coloro-->100%<!--colorc--></span><!--/colorc-->
After <!--coloro:#F4A460--><span style="color:#F4A460"><!--/coloro-->50%<!--colorc--></span><!--/colorc--> marines mutated to aliens, the alien HP will be automaticly set to <!--coloro:#F4A460--><span style="color:#F4A460"><!--/coloro-->60-75%<!--colorc--></span><!--/colorc-->, also a marine Dual Exosuit is spawning somewhere around the map.
After <!--coloro:#FF00FF--><span style="color:#FF00FF"><!--/coloro-->70%<!--colorc--></span><!--/colorc--> marines mutated to aliens, the alien HP will be automaticly set to <!--coloro:#FF00FF--><span style="color:#FF00FF"><!--/coloro-->50%<!--colorc--></span><!--/colorc-->
After <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->90%<!--colorc--></span><!--/colorc--> marines mutated to aliens, the alien HP will be automaticly set to <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->25-30%<!--colorc--></span><!--/colorc--> <--- This will only be active when more then 12 Players are in the server
This will guarantee, that the marines have a chance to defend themselves even when the aliens are in a huge majority.
Also it will help the first aliens to get a kill in a short time, but nevertheless skill is required!
Concerning the maps I think they have to be much smaller then standart ns2 maps, but for potentially first release I will use standart ns2 maps that I cut down to 1/4 the size.
Ok now get technicly,
I m still learing lua and I m at the very beginning of it.
For the first realease I just want to know the following things:
How to:
- get all players spawn as marines (skipping ready room if this is not that big of a deal)
- get random selection of a marine who will be alien or if this is to hard to code: marines can choose themselves to get first alien
- get mutation implemented
These are the first things that would be required for the first gameplay experience.
So I looked up in the lua folder and think:
Client.lua, DeathTrigger.lua, gamerules.lua, Biteleap.lua,player.lua (+ maybe player.client.lua), weapon.lua, weaponuttility.lua
is required to get this mod done.
So for the basic idea (all players: marines, mutation function) u guys think this would take ages to get done, or what is your view on that?
Again Thank you all for reading and let this thing get started :)))
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Update:<!--sizec--></span><!--/sizec-->
Features right now:
- Mutation got fully implemented
- all starting as marine
- redesigned Summit map (1/4 the size of normal) (type ingame in console: Map LR_Summit)
- Skulks make 110 damage per fullbite, but consumes more stamina energy
- Skulk movement modifed (not finished yet)
- Skulk Leap research availiblity from roundstart
- Fade have longer shadowstep and 1/3 more HP
- Alien respawn time set to 1 second
- and many things more
Feel free to go to our GitHub CodingChannel:
https://github.com/OnkelDagobert/Last_Resistance
I want to make a mod that would really suits the NS2 gameplay genre.
<!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->So the basic idea is:<!--sizec--></span><!--/sizec-->
<!--coloro:#00FFFF--><span style="color:#00FFFF"><!--/coloro-->-------------------------------------------------------------------------------------------------<!--colorc--></span><!--/colorc-->
Every player starts as marine, except one guy that is going alien (random slection)
All marines are fighting as a team.
The marine weapons are placed all around the map.
If the alien kill a marine, he will mutate to an alien, until all marines are killed and mutated to an alien.
Goal: Marines get points per second they survived as marine, the one with highest score wins
<!--coloro:#00FFFF--><span style="color:#00FFFF"><!--/coloro-->-------------------------------------------------------------------------------------------------<!--colorc--></span><!--/colorc-->
<!--coloro:#F4A460--><span style="color:#F4A460"><!--/coloro-->What I try to accomplish is an exponentially intensiving gameplay flow.<!--colorc--></span><!--/colorc-->
At first it will be easy for marines to defend them selves, after few marines mutated it will gradually get more serious until all hell breaks loose and only one marines is left against a horde of aliens.
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--><!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->But here comes the clue:<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc-->
To give the first alien a chance to kill a marine, he will be a fade (for expl.) who has 200% HP
After he got a kill, from there on all aliens will be born as skulks with 200%HP and leap researched (only upgrade availble at the time)
After <!--coloro:#FFC0CB--><span style="color:#FFC0CB"><!--/coloro-->10-20%<!--colorc--></span><!--/colorc--> marines mutated to aliens, the alien HP will be automaticly set to <!--coloro:#FFC0CB--><span style="color:#FFC0CB"><!--/coloro-->100%<!--colorc--></span><!--/colorc-->
After <!--coloro:#F4A460--><span style="color:#F4A460"><!--/coloro-->50%<!--colorc--></span><!--/colorc--> marines mutated to aliens, the alien HP will be automaticly set to <!--coloro:#F4A460--><span style="color:#F4A460"><!--/coloro-->60-75%<!--colorc--></span><!--/colorc-->, also a marine Dual Exosuit is spawning somewhere around the map.
After <!--coloro:#FF00FF--><span style="color:#FF00FF"><!--/coloro-->70%<!--colorc--></span><!--/colorc--> marines mutated to aliens, the alien HP will be automaticly set to <!--coloro:#FF00FF--><span style="color:#FF00FF"><!--/coloro-->50%<!--colorc--></span><!--/colorc-->
After <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->90%<!--colorc--></span><!--/colorc--> marines mutated to aliens, the alien HP will be automaticly set to <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->25-30%<!--colorc--></span><!--/colorc--> <--- This will only be active when more then 12 Players are in the server
This will guarantee, that the marines have a chance to defend themselves even when the aliens are in a huge majority.
Also it will help the first aliens to get a kill in a short time, but nevertheless skill is required!
Concerning the maps I think they have to be much smaller then standart ns2 maps, but for potentially first release I will use standart ns2 maps that I cut down to 1/4 the size.
Ok now get technicly,
I m still learing lua and I m at the very beginning of it.
For the first realease I just want to know the following things:
How to:
- get all players spawn as marines (skipping ready room if this is not that big of a deal)
- get random selection of a marine who will be alien or if this is to hard to code: marines can choose themselves to get first alien
- get mutation implemented
These are the first things that would be required for the first gameplay experience.
So I looked up in the lua folder and think:
Client.lua, DeathTrigger.lua, gamerules.lua, Biteleap.lua,player.lua (+ maybe player.client.lua), weapon.lua, weaponuttility.lua
is required to get this mod done.
So for the basic idea (all players: marines, mutation function) u guys think this would take ages to get done, or what is your view on that?
Again Thank you all for reading and let this thing get started :)))
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Update:<!--sizec--></span><!--/sizec-->
Features right now:
- Mutation got fully implemented
- all starting as marine
- redesigned Summit map (1/4 the size of normal) (type ingame in console: Map LR_Summit)
- Skulks make 110 damage per fullbite, but consumes more stamina energy
- Skulk movement modifed (not finished yet)
- Skulk Leap research availiblity from roundstart
- Fade have longer shadowstep and 1/3 more HP
- Alien respawn time set to 1 second
- and many things more
Feel free to go to our GitHub CodingChannel:
https://github.com/OnkelDagobert/Last_Resistance
Comments
The goal is: if a marine is dying he will respawn as alien.
I scanned many .lua scripts in ns2 folder.
The one that got my attention was: "PlayingTeam.lua"
In it I found these codelines:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->/**
* Transform player to appropriate team respawn class and respawn them at an appropriate spot for the team.
* Pass nil origin/angles to have spawn entity chosen.
*/
function PlayingTeam:ReplaceRespawnPlayer(player, origin, angles, mapName)
local spawnMapName = self.respawnEntity
if mapName ~= nil then
spawnMapName = mapName
end
local newPlayer = player:Replace(spawnMapName, self:GetTeamNumber(), false, origin)<!--c2--></div><!--ec2-->
Beside the "PlayingTeam.lua" I found some potential codelines in the "MarineTeam.lua" that can evoke respawn as alien after death:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function MarineTeam:GetTeamType()
return kMarineTeamType
end
function MarineTeam:GetIsMarineTeam()
return true
end
function MarineTeam:Initialize(teamName, teamNumber)
PlayingTeam.Initialize(self, teamName, teamNumber)
self.respawnEntity = Marine.kMapName <---------------------------------
self.updateMarineArmor = false
self.lastTimeNoIPsMessageSent = Shared.GetTime()
end
function MarineTeam:GetHasAbilityToRespawn()<!--c2--></div><!--ec2-->
Plz guys I need your help !!!
So I changed the "marine_server.lua" to:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function Marine:OnKill(attacker, doer, point, direction)
// drop all weapons which cost resources
self:DropAllWeapons()
// destroy remaining weapons
self:DestroyWeapons()
Player.OnKill(self, attacker, doer, point, direction)
self:PlaySound(Marine.kDieSoundName)
// Don't play alert if we suicide
if attacker ~= self then
self:GetTeam():TriggerAlert(kTechId.MarineAlertSoldierLost, self)
end
// Note: Flashlight is powered by Marine's beating heart. Eco friendly.
self:SetFlashlightOn(false)
self.originOnDeath = self:GetOrigin()
end
function AlienTeam:Initialize(teamName, teamNumber)
PlayingTeam.Initialize(self, teamName, teamNumber)
self.respawnEntity = Skulk.kMapName
// List stores all the structures owned by builder player types such as the Gorge.
// This list stores them based on the player platform ID in order to maintain structure
// counts even if a player leaves and rejoins a server.
self.clientOwnedStructures = { }
self.lastAutoHealIndex = 1
self.updateAlienArmorInTicks = nil
self.cloakables = {}
self.cloakableCloakCount = {}
self.timeLastWave = 0
end<!--c2--></div><!--ec2-->
So basicly it says when marine dies several things get activated.
So I want the marine to change Team when he dies (killed and suicide)
I added:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function AlienTeam:Initialize(teamName, teamNumber)
PlayingTeam.Initialize(self, teamName, teamNumber)
self.respawnEntity = Skulk.kMapName
// List stores all the structures owned by builder player types such as the Gorge.
// This list stores them based on the player platform ID in order to maintain structure
// counts even if a player leaves and rejoins a server.
self.clientOwnedStructures = { }
self.lastAutoHealIndex = 1
self.updateAlienArmorInTicks = nil
self.cloakables = {}
self.cloakableCloakCount = {}
self.timeLastWave = 0
end<!--c2--></div><!--ec2-->
...to the "onkill" command
unfortunatly it doesnt work.
When I die as marine I will respawn as marine again.
But the funny thing is when I change the spawnentity (First Spawn when game starts) in the marine_team.lua to <b>Skulk</b>
It works:
(I go to marine team, spawn as skulk in marine team, die and I will automaticly switch to the Alien team as Skulk !)
Why is this not workin when I m spawning as marine in marine team???
When its in a new file and your main mod file is loading the original ns2 files, that is not working,
you have to use a hooking mechanism like this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// overrides onclampspeed so the force is the same to every class
local originalPlayerOnClampSpeed
originalPlayerOnClampSpeed = Class_ReplaceMethod( "Player", "OnClampSpeed",
function(self, input, velocity)
// when not getting pushed, call the original method
if self.pushTime ~= -1 or self:isa("Lerk") then
originalPlayerOnClampSpeed(self, input, velocity)
end
end
)<!--c2--></div><!--ec2-->
I loaded the "... .lua" files in decoda, modified them and replaced them with the original ones in ns2/lua folder.
What do you mean by hooking?
Do I ve to create a blank .lua file and then put the code in there?
1) you can't play on any server
2) if uwe makes an update to the files you modfied, all your work is gone
Thats why you should create your own mod in Ns2
This is not such big of a deal for me right now, i backed up all my old files.
I m just twiddling with the code a bit, to see if its workin.
Again I ve no clue why the: feature: marine die = change team is not workin?
When I start as Skulk everything is fine only when I start as marine it will not switch teams.
Is it possible that the infantryportalqueue is hindering team switch???
So I opened the MapEditor and found something intresting.
Under "Entitys" there is a thing called: "team_join" so got this on my test map, set the dimensions, set the team name to join in aliens. But ingame, when I hit the (invisble) teamjoin "box" nothing happens, WHY????
So my plan is when a marine dies he will teleport to the "team_join-box area" to switch teams.
very kamikaze I know but its the only thing I can come up with right now.
Man i didnt know that something that simple like team_switch command can be so frustratingly hard :(
Plz help
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->GetGamerules():JoinTeam(player, kTeam2Index)<!--c2--></div><!--ec2-->
should do it.
But I dont know where to implement it?
I tried to put it under the:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function Marine:OnKill(attacker, doer, point, direction)
...<!--c2--></div><!--ec2-->
in the marine_server.lua but it didnt work (got activated), Why?
Also because the switch command is from "gamerules" do I ve to put "scriptload:gamerules" in the first lines from marine_server.lua to secure that the marine_server.lua recognizes the command?
After endless combinations regarding the team specific gamerules, I tackled it from a whole different starting point, I configured the spectator class in the marine.lua and voila, when marine is dying he will mutate to alien.
Unfortunatly the alien sticks to the "marine team" but after it(alien) got killed it switches to "alien team" so not that big of a prob right now.
I need some guys who wanna test it out.
Again its all pre alpha now but its playble I think.
make a reply here plz so I know who is attending.
allready tried that, but I need the bots to respawn when they die, they do not, right now.
Also I ve to manage balancing issues etc.
Also I tried to get borstys ns2bot working but when I m ingame and write in console: addbot 1 (for expl) nothing happens. I followed his instructions but it doesnt work!
I tried the serverconfig.lua and erased the:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->auto_team_balance = { enabled_on_unbalance_amount = 2, enabled_after_seconds = 10 },<!--c2--></div><!--ec2-->
line under local defaultConfig = {
but it doesnt work.
Or if not do you know the admin command for disabling the "team-auto-balance" ?
Guess I'll have to think of another idea.
Why random?
Dont undestand what you mean, having teams is no issue, if youre interested you can help me with coding or other things
@:intel
have thought about marines shooting each other until one dies but its problematic with afk people
I tried the serverconfig.lua and erased the:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->auto_team_balance = { enabled_on_unbalance_amount = 2, enabled_after_seconds = 10 },<!--c2--></div><!--ec2-->
line under local defaultConfig = {
but it doesnt work.
Or if not do you know the admin command for disabling the "team-auto-balance" ?<!--QuoteEnd--></div><!--QuoteEEnd-->
I think the "team auto balance " is disabled when cheats are enabled but anyway I think it's simpler to use this line instead :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->auto_team_balance = { enabled_on_unbalance_amount = 100, enabled_after_seconds = 10 },<!--c2--></div><!--ec2-->
Anyways offcourse I tried to manipulate the serverrconfig to set "enabled_on_unbalance_amount = 24" but guess what it wont work !
Also I tried so many things in the TeamJoin.lua Team.lua on and on but the code I wrote has made no impact on autoteambalance really strange.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->auto_team_balance = false,<!--c2--></div><!--ec2-->
instead of <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->auto_team_balance = { enabled_on_unbalance_amount = 2, enabled_after_seconds = 10 },<!--c2--></div><!--ec2-->
if this still doesn't work you can modify "autoTeamBalance" in NS2Gamerules.lua
guess I ve to set cheats enabled and alter the friendly fire to 0 and set the round win condition back to normal (coz when cheats enabled friendly fire is on and there arent any round win conditions)
so many things happened behind the curtain and we think it has finally come the time where we can present our first BetaTest to the public. We hope we can test this weekend, hopefully starting at friday.
We encourage you to join and tell us what you think.
See you there.
btw nice mod so far :P
Features right now:
- Mutation got implemented
- all starting as Marine
- Aliens make 90 damage per fullbite, but consumes more stamina energy
- Alien respawn time set to 1 second
- Skulk Movement modified
- Weapons spawn at Techpoints
- Weapon spawn probability
- Health Packs and Ammoboxes spawn at Resource nozzles
- a complete Sound and Music Overhaul
- Human indicator for Aliens (to find hidden marines more faster)
- Scoresystem fully implemented
- fully customizable serveroptions (such as Weapons/Armor upgrades etc)
- new maps
- All Weapons can be carried at once
new:Workshop collection: http://steamcommunity.com/sharedfiles/filedetails/?id=126387828
Source / issue-tracking: https://github.com/OnkelDagobert/Last_Resistance
Oh whew! SO relieved that the first post in 9 months wasn't "ummm is this still happening?" This looks like an awesome mod! Keep it up.