[ Shine ] GiveRes 1.1
http://steamcommunity.com/sharedfiles/filedetails/?id=354919755&searchtext=giveres
sh_giveres (Console command) and /giveres (Chat command) ~ Current settings: Marines to marines and/or aliens to aliens. No commanders allowed (yet). checks for the reciever and sees if the requested donation is above 100, and give the portion above 100 back to the donater.
local Shine = Shine local Plugin = {} Plugin.Version = "1.1" function Plugin:Initialise() self:CreateCommands() self.Enabled = true return true end function Plugin:CreateCommands() local function GiveRes( Client, TargetClient, Number ) local Giver = Client:GetControllingPlayer() local Reciever = TargetClient:GetControllingPlayer() //local TargetName = TargetClient:GetName() //Only apply this formula to pres non commanders // If trying to give a number beyond the amount currently owned in pres, do not continue. Or If the reciever already has 100 resources then do not bother taking resources from the giver if Giver:GetTeamNumber() ~= Reciever:GetTeamNumber() or Giver:isa("Commander") or Reciever:isa("Commander") or Number > Giver:GetResources() or Reciever:GetResources() == 100 then return end //If giving res to a person and that total amount exceeds 100. Only give what can fit before maxing to 100, and not waste the rest. if Reciever:GetResources() + Number > 100 then // for example 80 + 30 = 110 local GiveBack = 0 //introduce x GiveBack = Reciever:GetResources() + Number // x = 80 + 30 (110) GiveBack = GiveBack - 100 // 110 = 110 - 100 (10) Giver:SetResources(Giver:GetResources () - Number + GiveBack) // Sets resources to the value wanting to donate + the portion to give back that's above 100 Reciever:SetResources(100) // Set res to 100 anyway because the check above says if getres + num > 100. Therefore it would be 100 anyway. // Notify(StringFormat("[GiveRes] %s has reached 100 resources, therefore you've only donated %s", TargetName, Number) ) //Shine:Notify(Client, Number, TargetClient, "Successfully donated %s resource(s) to %s", nil) return //prevent from going through the process of handing out res again down below(?) end //// //Otherwise if the giver has the amount to give, and the reciever amount does not go beyond 100, complete the trade. (pres) //Shine:Notify(Client, Number, TargetClient, "Successfully donated %s resource(s) to %s", nil) Giver:SetResources(Giver:GetResources() - Number) Reciever:SetResources(Reciever:GetResources() + Number) //Notify(StringFormat("[GiveRes] Succesfully donated %s resource(s) to %s.", Number, TargetName) ) //Now for some fun and to expand on the potential of giveres within ns2 that ns1 did not reach? //In particular, team res and commanders. //If the giver is a commander to a recieving teammate then take the resources out of team resources rather than personal. //if Giver:GetTeamNumber() == Reciever:GetTeamNumber() and Giver:isa(Commander) then end local GiveResCommand = self:BindCommand( "sh_giveres", "giveres", GiveRes, true) GiveResCommand:Help( "giveres <name> <amount> ~ (No commanders)" ) GiveResCommand:AddParam{ Type = "client", NotSelf = true, IgnoreCanTarget = true } GiveResCommand:AddParam{ Type = "number", Min = 1, Max = 100, Round = true } end function Plugin:Cleanup() self:Disable() self.BaseClass.Cleanup( self ) self.Enabled = false end Shine:RegisterExtension( "giveres", Plugin )
Comments
30 sec onos with no ups/biomass, and no other lifeforms for half the game?? Could be a problem, but definitely a gamble.
60 res for onos = 3 players total starting rez pooled over to 1 player, so on a 7v7 or higher, you could have 2 onos right from the get go. Even 1 would be able to completely deny one whole side of the map, especially if they have a gorge to back them up.
The mod is unlikely to be used on a regular server and will probably end up in a mod pack/siege mod type thing (the author did create siege mod) with a range of balance changes that the person sees fit. This mod now gives a mechanism to give res to other players where before there was no such mechanism.
Forest for trees etc.
Also this is a mod from NS1 too, it's pretty usefull when you have gorge doing more work like building chambers/hives etc. It's pretty much for the siegemod really, you were originally meant to give one alien all the res to build resource towers right at the start, or get hives. In NS2 unless you are playing on siegemod this isn't a problem.
For siegemod this is perfect, but as he posted it as a general shine plug-in, I assumed, along with others, this was for ns2, and it would be a really bad idea for ns2.
I haven't played much NS2 lately, only SCC map tests, so I haven't got around to trying siegemod. Have you removed the alien commander and given building responsibility back to Aliens and Gorges in particular?