Solved Rad zones and Animals stronger

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
Hi again.

So I want to make update to server, players wanted harder damage from Radiations and Animals, as we have PvE server, so it's really easy to craft whole game.

I would want to make plugin to edit:

- Animals HP +50%
- Radiation damage about 200% higher because it's just a joke right now :D

Yesterday I just ran naked into middle of big rad zone, run out with about 300-400 RAD and I had still about 80 hp. I know it would probably kill me after 30 minutes of waiting, but I want players to use pills and anti-rad clothes - thats why they are in this game.

I saw plugin in Oxide forum, but I don't have account so I can't even check how they made it.

Could you write something about it?

I saw HurtEvent, so maybe I could manage power of guns or something.. But I really want to make it proper way.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Hi again.

So I want to make update to server, players wanted harder damage from Radiations and Animals, as we have PvE server, so it's really easy to craft whole game.

I would want to make plugin to edit:

- Animals HP +50%
- Radiation damage about 200% higher because it's just a joke right now :D

Yesterday I just ran naked into middle of big rad zone, run out with about 300-400 RAD and I had still about 80 hp. I know it would probably kill me after 30 minutes of waiting, but I want players to use pills and anti-rad clothes - thats why they are in this game.

I saw plugin in Oxide forum, but I don't have account so I can't even check how they made it.

Could you write something about it?

I saw HurtEvent, so maybe I could manage power of guns or something.. But I really want to make it proper way.
Well Yeah. The wiki isn't complete, but we are working on It.


So...:

Python:
import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class WhatEver:

    def On_PlayerHurt(self, HurtEvent):
        """
        Let's debug some values here on Radiation Damage.
        I don't really know if the radiation has a weapon name or Separate DamageType
        Or the usual same DamageAmount. (Just to give you a notice
        some of the weapons have the same damage, and the damage changes after the game checked
        if the player has armor. Example: Hunting Bow, Spikes Hunting Bow always has 75 damage.. I have a guess that
        Garry was so professional as usual that he set the same damage permament on Radiation too.. Give it a test.)
        """
        Server.Broadcast(str(HurtEvent.DamageType))
        Server.Broadcast(str(HurtEvent.DamageAmount))
        Server.Broadcast(str(HurtEvent.WeaponName))

        # If you got any valuable info, do an if statement, like if DamageType == "Radiation"
        #Then just:
        HurtEvent.DamageAmount = float(int(HurtEvent.DamageAmount) * 2)
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
Oh yes. It's open forum, so I'll reply even I had no plugin done yet. I hope I'll make full plugin and upload on this site.

--

So if you didn't give me other idea, I finally got into your github and everything is easier: https://github.com/fougerite/Fougerite

Found an damage type in HurtEvent (radiation), so I can get it like you write. I'll think about animals later.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Oh yes. It's open forum, so I'll reply even I had no plugin done yet. I hope I'll make full plugin and upload on this site.

--

So if you didn't give me other idea, I finally got into your github and everything is easier: https://github.com/fougerite/Fougerite

Found an damage type in HurtEvent (radiation), so I can get it like you write. I'll think about animals later.
Nanananananana. That's old like shet.

https://github.com/Notulp/Fougerite

You could have said that you can handle yourself with the source code.
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
Yeah. Source and Documentation are best friends, so I could. But source is wrong (new also, thanks for link):

Code:
case 0:
return "Bleeding";

...

case 0x10:
return "Radiation";
But reality is that Fougerite don't see difference between Radiation and Bleeding, and just showing me that it's Bleeding.

I had Damage between 1.0 - 2.0, but I don't think it's a good thing to play with.

Player.Hp, Player.Rad, Player.Hungry - This needs to be done guys.

Also http://forum.rustoxide.com/threads/easy-heal-hunger.3339/:
Code:
public class Metabolism : IDLocalCharacter
{
    public float tickRate = 3f;
    public bool selfTick;
    public float hungerDamagePerMin = 5f;
    public void SetTargetActivityLevel(float level)
    public float GetActivityLevel()
    public float GetNextConsumeTime()
    public void MarkConsumptionTime()
    public bool CanConsumeYet()
    public float GetCalorieLevel()
    public float GetRemainingCaloricSpace()
:::::::::::::::::::::::::
    public float GetRadLevel()
:::::::::::::::::::::::::
    public bool IsCold()
:::::::::::::::::::::::::
    public bool HasRadiationPoisoning()
:::::::::::::::::::::::::
    public bool IsPoisoned()
    public void MakeDirty()
    public void MakeClean()
    public bool IsDirty()
    public void SubtractCalories(float numCalories)
    public void AddCalories(float numCalories)
    public void AddWater(float litres)
    public void AddAntiRad(float addAntiRad)
    public void AddRads(float rads)
    public void AddPoison(float amount)
    public void SubtractPosion(float amount)
    public void MarkWarm()
    public bool IsWarm()
    [RPC]
    public void Vomit()
    public void MarkDamageTime()
    public float TimeSinceHurt()
    public void OnHurt(DamageEvent damage)
    public void DoNetworkUpdate()
}
With Player.HasRadiationPoisoning it would be easy as shit! I could just add it I think if I would know how to compile... I always had problems and errors

Now there is no option for me to do this.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Yeah. Source and Documentation are best friends, so I could. But source is wrong (new also, thanks for link):

Code:
case 0:
return "Bleeding";

...

case 0x10:
return "Radiation";
But reality is that Fougerite don't see difference between Radiation and Bleeding, and just showing me that it's Bleeding.

I had Damage between 1.0 - 2.0, but I don't think it's a good thing to play with.

Player.Hp, Player.Rad, Player.Hungry - This needs to be done guys.

Also http://forum.rustoxide.com/threads/easy-heal-hunger.3339/:
Code:
public class Metabolism : IDLocalCharacter
{
    public float tickRate = 3f;
    public bool selfTick;
    public float hungerDamagePerMin = 5f;
    public void SetTargetActivityLevel(float level)
    public float GetActivityLevel()
    public float GetNextConsumeTime()
    public void MarkConsumptionTime()
    public bool CanConsumeYet()
    public float GetCalorieLevel()
    public float GetRemainingCaloricSpace()
:::::::::::::::::::::::::
    public float GetRadLevel()
:::::::::::::::::::::::::
    public bool IsCold()
:::::::::::::::::::::::::
    public bool HasRadiationPoisoning()
:::::::::::::::::::::::::
    public bool IsPoisoned()
    public void MakeDirty()
    public void MakeClean()
    public bool IsDirty()
    public void SubtractCalories(float numCalories)
    public void AddCalories(float numCalories)
    public void AddWater(float litres)
    public void AddAntiRad(float addAntiRad)
    public void AddRads(float rads)
    public void AddPoison(float amount)
    public void SubtractPosion(float amount)
    public void MarkWarm()
    public bool IsWarm()
    [RPC]
    public void Vomit()
    public void MarkDamageTime()
    public float TimeSinceHurt()
    public void OnHurt(DamageEvent damage)
    public void DoNetworkUpdate()
}
With Player.HasRadiationPoisoning it would be easy as shit! I could just add it I think if I would know how to compile... I always had problems and errors

Now there is no option for me to do this.
Pretty sure I could push some code tomorrow.

Sent from my Samsung Galaxy S4
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Yeah. Source and Documentation are best friends, so I could. But source is wrong (new also, thanks for link):

Code:
case 0:
return "Bleeding";

...

case 0x10:
return "Radiation";
But reality is that Fougerite don't see difference between Radiation and Bleeding, and just showing me that it's Bleeding.

I had Damage between 1.0 - 2.0, but I don't think it's a good thing to play with.

Player.Hp, Player.Rad, Player.Hungry - This needs to be done guys.

Also http://forum.rustoxide.com/threads/easy-heal-hunger.3339/:
Code:
public class Metabolism : IDLocalCharacter
{
    public float tickRate = 3f;
    public bool selfTick;
    public float hungerDamagePerMin = 5f;
    public void SetTargetActivityLevel(float level)
    public float GetActivityLevel()
    public float GetNextConsumeTime()
    public void MarkConsumptionTime()
    public bool CanConsumeYet()
    public float GetCalorieLevel()
    public float GetRemainingCaloricSpace()
:::::::::::::::::::::::::
    public float GetRadLevel()
:::::::::::::::::::::::::
    public bool IsCold()
:::::::::::::::::::::::::
    public bool HasRadiationPoisoning()
:::::::::::::::::::::::::
    public bool IsPoisoned()
    public void MakeDirty()
    public void MakeClean()
    public bool IsDirty()
    public void SubtractCalories(float numCalories)
    public void AddCalories(float numCalories)
    public void AddWater(float litres)
    public void AddAntiRad(float addAntiRad)
    public void AddRads(float rads)
    public void AddPoison(float amount)
    public void SubtractPosion(float amount)
    public void MarkWarm()
    public bool IsWarm()
    [RPC]
    public void Vomit()
    public void MarkDamageTime()
    public float TimeSinceHurt()
    public void OnHurt(DamageEvent damage)
    public void DoNetworkUpdate()
}
With Player.HasRadiationPoisoning it would be easy as shit! I could just add it I think if I would know how to compile... I always had problems and errors

Now there is no option for me to do this.
Btw. If Player.Hp is health that should be Player.Health.

Sent from my Samsung Galaxy S4
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
Yeah it would be beautiful to implement some of this basic functions. If they are available they should be in your mod, no matter if programmers will use it or not. One of them will.

- GetRadLevel
- GetCalorieLevel()
- IsRadPoisoned
- IsCold
- IsHungry
- IsPoisoned
etc.

Perfect for survival game, to add some more damage.

Also this "DamageType" fix would be good.

I'll try to add do something with animals now.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Yeah it would be beautiful to implement some of this basic functions. If they are available they should be in your mod, no matter if programmers will use it or not. One of them will.

- GetRadLevel
- GetCalorieLevel()
- IsRadPoisoned
- IsCold
- IsHungry
- IsPoisoned
etc.

Perfect for survival game, to add some more damage.

Also this "DamageType" fix would be good.

I'll try to add do something with animals now.
As I see we did this on DestroyEvent.

https://github.com/balu92/IronPythonModule/blob/master/IronPythonModule/FougeriteEx/DestroyEvent.cs#L106

lul
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
I told you that line is not working, you have it in HurtEvent too. But Fougerite still think it's Bleeding.

ANIMALS

So I couldn't set animals health this way. I'm just adding HP with hit.

Python:
def On_NPCHurt(self, Hurt):
        if Hurt.Victim.Name=="MutantBear" | Hurt.Victim.Name=="MutantWolf":
            health = (Hurt.DamageAmount/100)*65
            Hurt.Victim.Health=Hurt.Victim.Health+health
        else:
            health = (Hurt.DamageAmount/100)*35
            Hurt.Victim.Health=Hurt.Victim.Health+health
It's something weird with this BroadcastNotices. Always makes big lag, sometimes bear just kill me when I'm frozen.
 
Last edited:

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
I told you that line is not working, you have it in HurtEvent too. But Fougerite still think it's Bleeding.

ANIMALS

So I couldn't set animals health this way. I'm just adding HP with hit.

Python:
def On_NPCHurt(self, Hurt):
        if Hurt.Victim.Name == "MutantBear":
            if Hurt.Victim.Health > 60:
                Hurt.Victim.Health=Hurt.Victim.Health+60
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
        if Hurt.Victim.Name == "Bear":
            if Hurt.Victim.Health > 35:
                Hurt.Victim.Health=Hurt.Victim.Health+35
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
        if Hurt.Victim.Name == "MutantWolf":
            if Hurt.Victim.Health > 45:
                Hurt.Victim.Health=Hurt.Victim.Health+45
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
        if Hurt.Victim.Name == "Wolf":
            if Hurt.Victim.Health > 30:
                Hurt.Victim.Health=Hurt.Victim.Health+30
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
        if Hurt.Victim.Name == "Boar":
            if Hurt.Victim.Health > 45:
                Hurt.Victim.Health=Hurt.Victim.Health+45
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
It's something weird with this BroadcastNotices. Always makes big lag, sometimes bear just kill me when I'm frozen.
Notice in Rust was always laggy.

Sent from my Samsung Galaxy S4
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
I told you that line is not working, you have it in HurtEvent too. But Fougerite still think it's Bleeding.

ANIMALS

So I couldn't set animals health this way. I'm just adding HP with hit.

Python:
def On_NPCHurt(self, Hurt):
        if Hurt.Victim.Name == "MutantBear":
            if Hurt.Victim.Health > 60:
                Hurt.Victim.Health=Hurt.Victim.Health+60
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
        if Hurt.Victim.Name == "Bear":
            if Hurt.Victim.Health > 35:
                Hurt.Victim.Health=Hurt.Victim.Health+35
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
        if Hurt.Victim.Name == "MutantWolf":
            if Hurt.Victim.Health > 45:
                Hurt.Victim.Health=Hurt.Victim.Health+45
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
        if Hurt.Victim.Name == "Wolf":
            if Hurt.Victim.Health > 30:
                Hurt.Victim.Health=Hurt.Victim.Health+30
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
        if Hurt.Victim.Name == "Boar":
            if Hurt.Victim.Health > 45:
                Hurt.Victim.Health=Hurt.Victim.Health+45
                Server.BroadcastNotice("HP: "+str(Hurt.Victim.Health))
It's something weird with this BroadcastNotices. Always makes big lag, sometimes bear just kill me when I'm frozen.
That line should be working though. I will test that myself when Im home.

Sent from my Samsung Galaxy S4
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
When I was testings it showed me that I was bleeding. And it's ok.. Because RadiationPoisoning makes bleeding in this game.

But those lines are still necessary. IsRadPoisoned and IsPoisoned are just basics. If you have IsCold, you should've those too.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
When I was testings it showed me that I was bleeding. And it's ok.. Because RadiationPoisoning makes bleeding in this game.

But those lines are still necessary. IsRadPoisoned and IsPoisoned are just basics. If you have IsCold, you should've those too.
Its fine. Will be added.

Sent from my Samsung Galaxy S4
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
And one more thing.

This NPC_Hurt function is creating some BIG .dump file. There is no error or something (I'm not seeing), just printing every HurtEvent variables/functions:

Code:
Object type: Fougerite.Events.HurtEvent
TimeNow: 2/6/2015 2:53 AM
Depth: 3
MaxItems: 20
ShowPrivate: True
UseFullClassName: True

(Fougerite.Events.HurtEvent) {
  Attacker: (Fougerite.Player) {
    Admin: (System.Boolean) true
    GameID: (System.String) ""
    Health: (System.Single) [100]
    Inventory: (Fougerite.PlayerInv) {
      ArmorItems: (PlayerItem[]) "Fougerite.PlayerItem[]"
      BarItems: (PlayerItem[]) "Fougerite.PlayerItem[]"
      FreeSlots: (System.Int32) "30"
      InternalInventory: (PlayerInventory) "Player :player_soldier (PlayerInventory)"
      Items: (PlayerItem[]) "Fougerite.PlayerItem[]"
      _armorItems: (PlayerItem[]) "Fougerite.PlayerItem[]"
      _barItems: (PlayerItem[]) "Fougerite.PlayerItem[]"
      _inv: (PlayerInventory) "Player:player_soldier (PlayerInventory)"
      _items: (PlayerItem[]) "Fougerite.PlayerItem[]"
      player: (Fougerite.Player) "Fougerite.Player"
    }

AND MORE AND MORE
Looks like I'll have about 100mb in 10 minutes if it'll show on linux server too.

(Deleted my IDs)
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
And one more thing.

This NPC_Hurt function is creating some BIG .dump file. There is no error or something (I'm not seeing), just printing every HurtEvent variables/functions:

Code:
Object type: Fougerite.Events.HurtEvent
TimeNow: 2/6/2015 2:53 AM
Depth: 3
MaxItems: 20
ShowPrivate: True
UseFullClassName: True

(Fougerite.Events.HurtEvent) {
  Attacker: (Fougerite.Player) {
    Admin: (System.Boolean) true
    GameID: (System.String) ""
    Health: (System.Single) [100]
    Inventory: (Fougerite.PlayerInv) {
      ArmorItems: (PlayerItem[]) "Fougerite.PlayerItem[]"
      BarItems: (PlayerItem[]) "Fougerite.PlayerItem[]"
      FreeSlots: (System.Int32) "30"
      InternalInventory: (PlayerInventory) "Player :player_soldier (PlayerInventory)"
      Items: (PlayerItem[]) "Fougerite.PlayerItem[]"
      _armorItems: (PlayerItem[]) "Fougerite.PlayerItem[]"
      _barItems: (PlayerItem[]) "Fougerite.PlayerItem[]"
      _inv: (PlayerInventory) "Player:player_soldier (PlayerInventory)"
      _items: (PlayerItem[]) "Fougerite.PlayerItem[]"
      player: (Fougerite.Player) "Fougerite.Player"
    }

AND MORE AND MORE
Looks like I'll have about 100mb in 10 minutes if it'll show on linux server too.

(Deleted my IDs)
I had that .dump problem as well.
Download this to stop that:
http://fougerite.com/resources/ironpython-module.96/
 
  • Like
Reactions: MasterPeace

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
.. Nothing. I just wasted your time, I'm sorry.

With this scripting programming I can't do anything with those properties, because there is no Hook like "On_PlayerAlive", "On_PlayerMoving", anything - if you know what I mean. If I want to use Player object, I need to call Class what will call that for me - so it's "closed wheel", just unmakable.

I have now functions but can't use them. I need to use it in main loop, not in hook..

I tried even something stupid like this:

Code:
class Ducks_Survival_Set:

    pplayer = Fougerite.Player

    if pplayer.Health > 40:
        pplayer.Health=pplayer.Health-2
But not.

I'm so tired. At least I have harder animals... But waiting in Radiation Zone to hit 450 RAD is some sort of joke. Everybody just getting everything even naked.

I would even make mod in C# if that would help me, but probably it's too hard.

Thank you both.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
.. Nothing. I just wasted your time, I'm sorry.

With this scripting programming I can't do anything with those properties, because there is no Hook like "On_PlayerAlive", "On_PlayerMoving", anything - if you know what I mean. If I want to use Player object, I need to call Class what will call that for me - so it's "closed wheel", just unmakable.

I have now functions but can't use them. I need to use it in main loop, not in hook..

I tried even something stupid like this:

Code:
class Ducks_Survival_Set:

    pplayer = Fougerite.Player

    if pplayer.Health > 40:
        pplayer.Health=pplayer.Health-2
But not.

I'm so tired. At least I have harder animals... But waiting in Radiation Zone to hit 450 RAD is some sort of joke. Everybody just getting everything even naked.

I would even make mod in C# if that would help me, but probably it's too hard.

Thank you both.
What are you trying to do?
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
.. Nothing. I just wasted your time, I'm sorry.

With this scripting programming I can't do anything with those properties, because there is no Hook like "On_PlayerAlive", "On_PlayerMoving", anything - if you know what I mean. If I want to use Player object, I need to call Class what will call that for me - so it's "closed wheel", just unmakable.

I have now functions but can't use them. I need to use it in main loop, not in hook..

I tried even something stupid like this:

Code:
class Ducks_Survival_Set:

    pplayer = Fougerite.Player

    if pplayer.Health > 40:
        pplayer.Health=pplayer.Health-2
But not.

I'm so tired. At least I have harder animals... But waiting in Radiation Zone to hit 450 RAD is some sort of joke. Everybody just getting everything even naked.

I would even make mod in C# if that would help me, but probably it's too hard.

Thank you both.
Just make bleedings do 2x damage?
The only way you bleed is from gun shoots I think (which shouldn't matter on a PvE server)