Last Resistance (Survivor Mod)

MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
edited February 2013 in Modding
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
«1

Comments

  • BurdockBurdock Join Date: 2012-08-27 Member: 156553Members
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2012
    So I tried to look up for the indiviual spawning conditions for players.
    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 !!!
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2012
    Ok I made a little progress concerning marine death = respawn in Alien Team as Skulk feature

    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???
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    Where do you replace the functions, directly in the ns2 code or in a new file?
    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-->
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    First thanks for replying :)

    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?
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    Well that's the worst thing you can do, modify directly files in your ns2 folder

    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
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2012
    Ahh ok

    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???
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2012
    I ve tried so many combinations now but none of them seem to work.
    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
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2012
    Ok I spoke with one of th UWE Devs (Brian) and he said that this code line:


    <!--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?
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2012
    Good news, I finally figured it out, well kind of...
    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.
  • SomnambulistSomnambulist Join Date: 2010-07-26 Member: 73051Members
    Sounds very similar to the Infection game mode that we'll be implementing in our beta version. Message me if you like, I think we might be able to converge our ideas if you're interested.
  • TharosTharos Join Date: 2012-12-18 Member: 175439Members
    I think you can test it with the basic bots implemented in ns2, they don't move alone but you can kill them (with cheats enabled) I think it's the best way to test a new mod
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2012
    @Tharos
    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!
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    Anyone knows how to set auto-team-balance off when launching a Server (on default)
    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" ?
  • AFireInAsaAFireInAsa Join Date: 2012-09-20 Member: 160156Members
    I was just going to start an infection mod, but it seems like at least two people (or teams) are doing that. :(

    Guess I'll have to think of another idea.
  • intel.intel. Join Date: 2012-12-21 Member: 175769Members
    <!--quoteo(post=2042108:date=Dec 8 2012, 01:54 PM:name=MetaMind)--><div class='quotetop'>QUOTE (MetaMind @ Dec 8 2012, 01:54 PM) <a href="index.php?act=findpost&pid=2042108"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Every player starts as marine, except one guy that is going alien (random slection)<!--QuoteEnd--></div><!--QuoteEEnd-->

    Why random?
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    @fireinasa
    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
  • TharosTharos Join Date: 2012-12-18 Member: 175439Members
    edited December 2012
    <!--quoteo(post=2049481:date=Dec 21 2012, 11:06 PM:name=MetaMind)--><div class='quotetop'>QUOTE (MetaMind @ Dec 21 2012, 11:06 PM) <a href="index.php?act=findpost&pid=2049481"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Anyone knows how to set auto-team-balance off when launching a Server (on default)
    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-->
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    Thank you so much Tharos, i didnt know that you ve to set cheats enabled in order to get rid of autoteambalance, who on earth has come up with this logic ?????

    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.
  • TharosTharos Join Date: 2012-12-18 Member: 175439Members
    I just looked the ServerConfig.json file and I think you should try this
    <!--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
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2012
    yeah tried that before, have deleted the old serverconfig.json file to get it to create the updated json file but it had no impact, also as I said I tried many things in the ns2gamerules.lua but it wasnt successful,
    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)
  • The AlgerianThe Algerian Join Date: 2012-12-22 Member: 175962Members
    It sounds a bit like another mod being made for NS2, called "The Hidden", but the Infection concept adds something quite interesting to it.
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    HEy everyone :)
    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.
  • TharosTharos Join Date: 2012-12-18 Member: 175439Members
    I played this mod and I don't understand why you don't randomize first alien selection.

    btw nice mod so far :P
  • MinimumMinimum Join Date: 2012-12-27 Member: 176382Members
    Is there a place to find out what time and place the testing will happen? This mod sounds like awesome fun and I'd really like to participate.
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    well if you want you can add me on steam (name: metamind09), then I will invite you when testings happen.
  • JackFoxJackFox Join Date: 2013-01-21 Member: 180957Members
    Looks like something promising here, reminds me alot of "The Thing" in the old SC:Brood War game.
  • OnkelDagobertOnkelDagobert Join Date: 2013-01-31 Member: 182694Members
    Update 0.9

    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:
    • Grenades explode immediately on impact
    • Bigger Clip Size for rifle, grenade launcher and flamethrower
    • Leap can stun Marines for 1sec
    • After a deathstreak of 4 the Alien gets Camo/Carapace till the next kill
    • Aliens with Camo/Carapace are marked on the Scoreboard
    • Flames on Scoreboard to indicate Players on Killstreak
    • Weapon Upgrades depending on Marine/Alien rate
    • Aliens get full Hp for a kill
    • Roundbased Mapchange

    Workshop collection: http://steamcommunity.com/sharedfiles/filedetails/?id=126387828
    Source / issue-tracking: https://github.com/OnkelDagobert/Last_Resistance
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    MetaMind wrote: »
    something big is going to happen... stay tuned ;)

    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.
Sign In or Register to comment.