1. Would anyone be willing to make a plugin like this, I know there has been a lot of chatter on the two main rust forums.
     
  2. I know this isn't what you asked for, but it would feel odd making a plugin for just this. Either you could make it yourself, or this could help someone else.

    Caveat, I'm new to the oxide api... just started reading over it yesterday in interest of developing plugins. This code works. What my lack of experience doesn't know, is whether or not other items trigger = heatSource aside from just the camp fire.

    Code:
    void OnEntityEnter(TriggerBase trigger, BaseEntity entity)
            {
                if(trigger.name.Equals("heatSource") && entity.ToPlayer() != null)
                {
                    entity.ToPlayer().metabolism.comfort.value = 0.5f;
                }
            }
    
     
    Last edited by a moderator: Mar 1, 2017
  3. Wulf

    Wulf Community Admin

    I'd recommend null checking that entity, as it may not always be a player.
     
  4. I updated the snippet to include a check. Thanks for the tip Wulf.
     
  5. Wulf

    Wulf Community Admin

    Code:
    void OnEntityEnter(TriggerBase trigger, BaseEntity entity)
    {
        var player = entity.ToPlayer();
        if (trigger.name.Equals("heatSource")) player?.metabolism.comfort.value= 0.5f;
    }
     
  6. Tried testing your code.
    Error while compiling: TestPlugin.cs(21,79): error CS9030: The left-hand side of an assignment cannot contain a null propagating operator
     
  7. Wulf

    Wulf Community Admin

    Yeah, ignore that snippet. :p
    Code:
    void OnEntityEnter(TriggerBase trigger, BaseEntity entity)
    {
       var player = entity.ToPlayer();
       if(player != null && trigger.name.Equals("heatSource")) player.metabolism.comfort.value= 0.5f;
    }
    or
    Code:
    void OnEntityEnter(TriggerBase trigger, BaseEntity entity)
    {
       var player = entity.ToPlayer();
       if(!player && trigger.name.Equals("heatSource")) player.metabolism.comfort.value= 0.5f;
    }
    Both of these would work to avoid using ToPlayer() twice.
     
  8. I wish I could write code, I get a bit confused just trying to find what to modify in some of the json files or which command i need to type and where, thats why I asked if someone could do this.