In the Pluton/Objects folder.This is probably a stupid question, but where is BuildingPart.cs located. I spent the last 10 minute looking for it
Yes, any one can.Well you can, but when a BuildingPart's health is set of BuildingPart.MaxHealth, when you try to break it (without remove), it gives some outofindex error/warning on the server console, which I am guessing is never good. It's just as easy to set it by hand but up to you.
You can do pull request![]()
They most likely wont allow you to, cause it would have to be custom compiled. I requested it to be added to Pluton, so possibly on future build you will be able toThanks, I will have to contact my hosting company to see if I can get access. Doesn't appear I have access to those files, which is why I couldn't find it. Thanks for the location coersum!
Thanks corrosion! I won't bother putting in the request and hopefully they will add it to a future build. Thanks for the response and loving the plugin so far.They most likely wont allow you to, cause it would have to be custom compiled. I requested it to be added to Pluton, so possibly on future build you will be able to![]()
Do you mind letting me know what version your server is and when was the last time you updated Pluton?apparently the update was causing my server to crash according to streamline had to go back to v1.0
I was told MaxHealth cannot be changed. However, the Set Health can, and will be added. Might not be until a few other things are added. You can modify the code yourself if you cant wait.so is the instant build ready to go ? or there still needs fixin?
def On_BuildingUpdate(self, be):
if be.Builder.Admin:
if be.Tool.Name == "Hammer": #straight to lvl 6 with one hit
be.BuildingPart.Health = 515
else: #salvaged hammer gives you 1 level per hit
if (be.BuildingPart.Health + 85) > 515:
be.BuildingPart.Health = 515
else:
be.BuildingPart.Health += 85
__author__ = 'CorrosionX- modified by Coersum'
__version__ = "1.0.2"
# With major help from balu92
import clr
import sys
clr.AddReferenceByPartialName("UnityEngine")
clr.AddReferenceByPartialName("Pluton")
import UnityEngine
import Pluton
class EasyRemove:
def On_PluginInit(self):
DataStore.Flush("Remove")
def On_BuildingUpdate(self, be):
if be.Builder.Admin:
if be.Tool.Name == "Hammer":
be.BuildingPart.Health = 515
else: #salvaged hammer gives you 1 level per hit
if (be.BuildingPart.Health + 85) > 515:
be.BuildingPart.Health = 515
else:
be.BuildingPart.Health += 85
def On_BuildingPartAttacked(self, attacked):
player = attacked.Attacker.ToPlayer()
if player is not None and Server.Players[player.userID].Admin:
gid = player.userID
if DataStore.Get("remove", gid) is not None:
Util.DestroyEntity(attacked.Victim.buildingBlock)
def On_Command(self, cmd):
if cmd.User.Admin:
if cmd.cmd == "remove":
isdestroying = DataStore.Get("remove", cmd.User.GameID)
if isdestroying is not None:
DataStore.Remove("remove", cmd.User.GameID)
cmd.User.Message("Remove De-Activated!")
else:
DataStore.Add("remove", cmd.User.GameID, True)
cmd.User.Message("Remove Activated!")
[10/17/2014 5:23:01 AM] [Exception] [ Plugin->Invoke | Plugin->OnBuildingUpdate | <>c__DisplayClass46-><InstallHooks>b__17 | AnonymousObserver`1->Next | AbstractObserver`1->OnNext | Subject`1->OnNext | Hooks->EntityBuildingUpdate | BuildingBlock->OnAttacked_Build | BuildingBlock->OnAttacked | Component->SendMessage | BasePlayer->DoAttackShared | BasePlayer->OnAttack | Node->Call | Router->Route | Server->ReceivedMessage | Server->Cycle | ServerMgr->Update | ]Just in case you wanted to use it, I set instabuild on the building update instead than in onFramedeployed because we can't get Player info on FrameDeployed, just BuildingPar.
Also used the 2 diff building Hammer because sometimes I like to have the textures of other levelsPython:def On_BuildingUpdate(self, be): if be.Builder.Admin: if be.Tool.Name == "Hammer": #straight to lvl 6 with one hit be.BuildingPart.Health = 515 else: #salvaged hammer gives you 1 level per hit if (be.BuildingPart.Health + 85) > 515: be.BuildingPart.Health = 515 else: be.BuildingPart.Health += 85
End result (sorry I stripped your code away to add other stuff) for my personal use (or anyone that wants it:
With this, as admin (unless changed), you put down a frame, hit it with hammer for instant lvl 6, or hit it with salvaged hammer and get 1 level per hit (capped so we don't get the outofboundindex error) and destroy with weapon as long as we keep /remove on (seemed I had to /remove anytime I made a mistake because the timer had gone off)Python:__author__ = 'CorrosionX- modified by Coersum' __version__ = "1.0.2" # With major help from balu92 import clr import sys clr.AddReferenceByPartialName("UnityEngine") clr.AddReferenceByPartialName("Pluton") import UnityEngine import Pluton class EasyRemove: def On_PluginInit(self): DataStore.Flush("Remove") def On_BuildingUpdate(self, be): if be.Builder.Admin: if be.Tool.Name == "Hammer": be.BuildingPart.Health = 515 else: #salvaged hammer gives you 1 level per hit if (be.BuildingPart.Health + 85) > 515: be.BuildingPart.Health = 515 else: be.BuildingPart.Health += 85 def On_BuildingPartAttacked(self, attacked): player = attacked.Attacker.ToPlayer() if player is not None and Server.Players[player.userID].Admin: gid = player.userID if DataStore.Get("remove", gid) is not None: Util.DestroyEntity(attacked.Victim.buildingBlock) def On_Command(self, cmd): if cmd.User.Admin: if cmd.cmd == "remove": isdestroying = DataStore.Get("remove", cmd.User.GameID) if isdestroying is not None: DataStore.Remove("remove", cmd.User.GameID) cmd.User.Message("Remove De-Activated!") else: DataStore.Add("remove", cmd.User.GameID, True) cmd.User.Message("Remove Activated!")
As we talked about earlier in the thread, you need to have certain setter/getters that are not in the current build of Pluton (might or might not ever be added). You'd have to look up in the thread and add them yourself then recompile Pluton[10/17/2014 5:23:01 AM] [Exception] [ Plugin->Invoke | Plugin->OnBuildingUpdate | <>c__DisplayClass46-><InstallHooks>b__17 | AnonymousObserver`1->Next | AbstractObserver`1->OnNext | Subject`1->OnNext | Hooks->EntityBuildingUpdate | BuildingBlock->OnAttacked_Build | BuildingBlock->OnAttacked | Component->SendMessage | BasePlayer->DoAttackShared | BasePlayer->OnAttack | Node->Call | Router->Route | Server->ReceivedMessage | Server->Cycle | ServerMgr->Update | ]
System.MissingMemberException: can't assign to read-only property Health of type 'BuildingPart'
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,int) <0x000ec>
at (wrapper dynamic-method) object.On_BuildingUpdate$41 (System.Runtime.CompilerServices.Closure,IronPython.Runtime.PythonFunction,object,object) <0x0042c>
yeah it didnt work, remove works build doesnt. i didnt restart server i just reloaded the plugin.
oh ok i guess i can wait until next pluton update, the way rust goes i assume it be very soon lol. Thanks for help.As we talked about earlier in the thread, you need to have certain setter/getters that are not in the current build of Pluton (might or might not ever be added). You'd have to look up in the thread and add them yourself then recompile Pluton
Thanks for your help. I have confirmed than set health for buildings will be added, no time frame was given as obviously not a priority.As we talked about earlier in the thread, you need to have certain setter/getters that are not in the current build of Pluton (might or might not ever be added). You'd have to look up in the thread and add them yourself then recompile Pluton
So I can't find the answer anywhere so I figured you might know. I forked Pluton, made commits to my own version as I need a few things not in main Pluton. I was wondering, how do I apply commits made from the original Notulp/Pluton after I forked it, to mine ? (from the github.com)Yes, any one can.
Create a GitHub account, and then you click the pencil/edit button. it saves a copy to your person hub, then lets you edit it, and once complete can request a pull to merge with original. Owner can approve or deny changes, or modify them.
They most likely wont allow you to, cause it would have to be custom compiled. I requested it to be added to Pluton, so possibly on future build you will be able to![]()