1. I'd like to intercept blueprint use to prevent players to use them at all. Is there an existing hook that would do that? I'm working on a plugin to revamp research and I'd like to keep blueprint drops but change them to a resource rather than a usable item as they are now.
     
  2. Just remove them from loots? Would be easier.
     
  3. @Deicide666ra
    I found something in the Assembly that might help you
    Code:
    {
                BasePlayer basePlayer = args.Player();
                if (!basePlayer)
                {
                    return;
                }
                if (basePlayer.IsDead())
                {
                    return;
                }
                int num = args.GetInt(0, 0);
                basePlayer.inventory.crafting.CancelBlueprint(num);
            }
    
    Code:
    {
                BasePlayer basePlayer = args.Player();
                if (!basePlayer)
                {
                    return;
                }
                if (basePlayer.IsDead())
                {
                    return;
                }
                int num = args.GetInt(0, 0);
                if (basePlayer.inventory.crafting.CancelTask(num, true))
                {
                    return;
                }
                args.ReplyWith("Couldn't cancel task!");
            }
    
     
  4. I could as a last resort but that's not what I want. I want to eliminate blueprints as they exist now but recycle the "item" so it becomes a resource you can use to boost your research at the research table. Say you want to learn how to make an AK, you won't be able to just right-click the AK blueprint to learn it, you'll need to gather up the mats, have an actual AK, paper and go to the research table. Each blueprint for an AK you have in your inventory when trying to research will boost your research by say 25%.

    This way instead of just trashing the blueprints, I'm re-using them to boost research.

    I'm working on a mod that makes each research fail on an item increase your chances of successfully researching it on next attempts. You can read about the concept here:
    https://www.reddit.com/r/playrust/comments/3emq0w/research_and_blueprints_how_i_think_it_should_be/

    TLDR; I'd really like to just remove the "Learn blueprint" button altogether OR have a hook where I can just cancel both the blueprint being added to the player's known blueprints AND prevent the item from being consumed.
    [DOUBLEPOST=1438012359][/DOUBLEPOST]
    This is to cancel crafting, I don't think it has anything to do with blueprints being learned.
     
  5. What you can do is after he learned the blueprint, you could just remove it from his blueprint.
    Code:
    PersistantPlayer playerInfo = SingletonComponent<ServerMgr>.Instance.persistance.GetPlayerInfo(player.userID);
    if (playerInfo != null)
    {
        Item item = ItemManager.CreateByName(short_name);
        playerInfo.blueprints.complete.Remove(item.info.itemId);
        SingletonComponent<ServerMgr>.Instance.persistance.SetPlayerInfo(player.userID, playerInfo);
        player.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
    }
    This would do the job as i tested before, but the thing is, I'm not sure if there is a Hook for this. So find a way to call this after he learned and you should be fine. But your plan would require to give the blueprint back, so do it and send a message " Learning bp is blablabla"
     
  6. Yeah I don't think there is a hook for this. I'll try some stuff, maybe OnItemConsumed or some other generic hook is called..thanks for this btw I've been looking at how to remove blueprints for a while now and it seems you had the key all this time, lol. Did you test this with default bp's btw?
     
  7. Sadly, the default bps cant be removed. Well you can remove it but as soon as you save the data, rust will restore the default ones, this happens maybe because of the new cosmetic items, so you will always have it.
     
  8. I see, but this is still good news, it means I could add a random blueprint removal to my death penalty mod :) Not sure I'll ever release it unless someone shows interest in it, I plan on going for a positive approach rather than a punitive one, or perhaps a bit of both.