@replaceMethod(MeleeThrowAttackEvents) public func OnExit(stateContext: ref<StateContext>, scriptInterface: ref<StateGameScriptInterface>) -> Void { let throwEquipmentRequest: ref<ThrowEquipmentRequest>; let itemObj: wref<ItemObject>; let transactionSystem: ref<TransactionSystem>; let quantity: Int32; let itemType: gamedataItemType;
I also agree that this new revised script is working rather well. I'm referring to the revised script posted by Sohail181 and I also have Silent Silencers and Throwing Knives {for Patch 2.0} and there does not seem to be any compat problems between those mods. I mean we are basically enabling cheats at this point but they have their uses...
Wasn't always the case. Knives used to just disappear after being thrown. I wasted a legendary tanto once by doing that before this feature was added, was so pissed.
it works, you just need to open the mod file, edit it. delete all text then enter the text above that is proper prompt code for the mod. remove all non-blade weapons. put same blade in all slots if you want true unlimited. by that i mean it bypass the reload time.
all this mod does is instantly spawns a new blade to be reloaded
194 comments
The recoverable version (or how it should have been from the start version) of throwing knives is out now!
Have fun :)
public func OnExit(stateContext: ref<StateContext>, scriptInterface: ref<StateGameScriptInterface>) -> Void {
let throwEquipmentRequest: ref<ThrowEquipmentRequest>;
let itemObj: wref<ItemObject>;
let transactionSystem: ref<TransactionSystem>;
let quantity: Int32;
let itemType: gamedataItemType;
this.RemoveThrowAttackGameplayRestrictions(stateContext, scriptInterface);
this.DisableNanoWireIK(scriptInterface);
transactionSystem = GameInstance.GetTransactionSystem(scriptInterface.owner.GetGame());
itemObj = transactionSystem.GetItemInSlot(scriptInterface.executionOwner, t"AttachmentSlots.WeaponRight");
itemType = itemObj.GetItemData().GetItemType();
if this.m_projectileThrown && !itemObj.GetItemData().HasTag(n"Cyberware") && Equals(itemType, gamedataItemType.Wea_Knife) {
quantity = transactionSystem.GetItemQuantity(scriptInterface.executionOwner, itemObj.GetItemID());
if quantity < 1 {
throwEquipmentRequest = new ThrowEquipmentRequest();
throwEquipmentRequest.owner = scriptInterface.executionOwner;
throwEquipmentRequest.itemObject = itemObj;
GameInstance.GetScriptableSystemsContainer(scriptInterface.owner.GetGame()).Get(n"EquipmentSystem").QueueRequest(throwEquipmentRequest);
this.OnForcedExit(stateContext, scriptInterface);
} else {
// Add a knife back to the inventory after throwing
transactionSystem.GiveItem(scriptInterface.executionOwner, itemObj.GetItemID(), 1);
};
};
}
Replace the actual script with this for the mod and it works ingame for both scripts, the one in roaming vortex file and the one in cyberpunk r6 file
Used GPT to write this, it works
copy and paste this
@replaceMethod(MeleeThrowAttackEvents)
public func OnExit(stateContext: ref<StateContext>, scriptInterface: ref<StateGameScriptInterface>) -> Void {
let throwEquipmentRequest: ref<ThrowEquipmentRequest>;
let itemObj: wref<ItemObject>;
let transactionSystem: ref<TransactionSystem> = GameInstance.GetTransactionSystem(scriptInterface.owner.GetGame());
let quantity: Int32;
let itemType: gamedataItemType;
this.RemoveThrowAttackGameplayRestrictions(stateContext, scriptInterface);
this.DisableNanoWireIK(scriptInterface);
itemObj = transactionSystem.GetItemInSlot(scriptInterface.executionOwner, t"AttachmentSlots.WeaponRight");
itemType = itemObj.GetItemData().GetItemType();
if this.m_projectileThrown && !itemObj.GetItemData().HasTag(n"Cyberware") && Equals(itemType, gamedataItemType.Wea_Knife) {
quantity = transactionSystem.GetItemQuantity(scriptInterface.executionOwner, itemObj.GetItemID());
if quantity < 1 {
throwEquipmentRequest = new ThrowEquipmentRequest();
throwEquipmentRequest.owner = scriptInterface.executionOwner;
throwEquipmentRequest.itemObject = itemObj;
GameInstance.GetScriptableSystemsContainer(scriptInterface.owner.GetGame()).Get(n"EquipmentSystem").QueueRequest(throwEquipmentRequest);
this.OnForcedExit(stateContext, scriptInterface);
} else {
// Add a knife back to the inventory after throwing
transactionSystem.GiveItem(scriptInterface.executionOwner, itemObj.GetItemID(), 1);
};
};
}
Steam\steamapps\common\Cyberpunk 2077\r6\scripts\Unlimited Daggers
Downloaded and installed trhough vortex, not working, my redscript is up to date but it is still not working
all this mod does is instantly spawns a new blade to be reloaded