EmeraldHaze Posted December 14, 2016 Share Posted December 14, 2016 Greetings. I'm at an impasse right now. See, I've finally devised a scheme to make the ammo from my mod completely non-lethal (an that's quite the task, because the game resists you shooting at NPCs and not killing them at every possible opportunity), so you literally CAN'T kill NPCs (finally). But to make other parts of the mod to work, I still have to implement a script that will ensure that current followers will equip and use non-lethal ammo together with player. As far as I know there isn't a direct way to find out what ammo an NPC has equipped or is firing. So my question is this: is there a way to find out what ammo an NPC has loaded/is currently firing, and more importantly - is there a way to give an NPC a command to switch to another ammo-type ? All feedback is greatly appreciated, thanks in advance. Link to comment Share on other sites More sharing options...
madmongo Posted December 14, 2016 Share Posted December 14, 2016 I may be wrong, but I thought that NPCs always use the default ammo for the weapon regardless of what ammo you give them. Link to comment Share on other sites More sharing options...
EmeraldHaze Posted December 14, 2016 Author Share Posted December 14, 2016 Ah, that's most likely true, then I must clarify my questions: of all NPC's I only care about the followers that the player currently has. And they do seem to use the ammo you give them. I just need to ensure they are using the right ammo for the job - if the player has non-lethal ammo equipped (this fact I can already detect using Player.GetPlayerCurrentAmmo) hired followers must switch to non-lethal ammo too, if it's in their inventory alongside normal ammo. And it's this part of making them equip the ammo - I just don't know how to do that. Hope this helps. Link to comment Share on other sites More sharing options...
Mktavish Posted December 15, 2016 Share Posted December 15, 2016 (edited) Would one of these 3 functions do it for ya ? http://geck.bethsoft.com/index.php?title=SetWeaponAmmohttp://geck.bethsoft.com/index.php?title=SetWeaponAmmoUsehttp://geck.bethsoft.com/index.php?title=SetWeaponProjectile But I'm not really clear on how to utilize them. And my thoughts for how I know I could make it work , would be to just swap out their weapons. That or take away their leathal ammo. Edited December 15, 2016 by Mktavish Link to comment Share on other sites More sharing options...
EmeraldHaze Posted December 15, 2016 Author Share Posted December 15, 2016 Hm, While the first two functions that you posted are, most likely, not applicable, the third one looks promising, I'll have to tinker with it for sure. About taking away the ammo - yeah, I thought about that: basicly as the follower is using their lethal ammo I can nullify the damage they are dealing, restore their lethal ammo and take away their non-lethal ammo on a per-shot basis. But that will be some impressive juggling to pull off, a last resort. I'll still try to find an easier way of actually forcing a follower to use applicable ammo. Anyway, thanks for the input, greatly appreciated. Link to comment Share on other sites More sharing options...
Mktavish Posted December 15, 2016 Share Posted December 15, 2016 (edited) I guess the question of how you are delivering non lethal projectiles to targets struck : How is this getting achieved in your mod ? My thoughts would be they are getting set as essential so they just pass out. But when I said to take away the lethal ammo from your follower NPC's ... I meant you would remove the ammo from their inventory ... making them use the non lethal ammo left in their inventory. Just remove it to a container in some dummy cell specified to an npc specifically. And when you the player are using lethal ammo again ... move what ammo got moved back to their inventory.This would function on the principal that they will use the best most lethal ammo in their inventory. Similar to which weapon they would choose. But not really sure how they pick the ammo as in what mongo implied.But then also how you are making the player ammo non lethal , and what that means to the target getting hit with it. Setting the target as essential would be my first choice ... and then no matter what the follower uses ... is non lethal. Edited December 15, 2016 by Mktavish Link to comment Share on other sites More sharing options...
EmeraldHaze Posted December 16, 2016 Author Share Posted December 16, 2016 My mod is already released and is called Non-Lethal Ammo. I'm just trying to rewrite it because I'm not satisfied with my previous implementation, so if you are interested, you can open it in fnvedit and see the current mechanisms with your own eyes. The short version is - my custom ammo has an on-hit object effect, that triggers a base effect, that then triggers an effect script and runs it on the hit target. That script then applies new Base fatigue value of the target and damages it's fatigue according to the formula. If the target's fatigue drops below zero - it is then considered knocked out. To prevent targets death I currently use healing (and it's not effective, because the target can still be killed in one hit due to the fmindammultiplier, which prevents me from lowering the current weapon's damage below 20%). I've experimented with SetEssential, but it didn't work for me, NPCs refused to become essential plus it's not very useful in my case as the NPC can still be killed by the first shot fired that was meant to interact with it and set it to essential (maybe I should try it some more). As for how I want to do it in the next version - while the player is using non-lethal ammo (which is detected easily) i change fmindammultiplier from 0.2 to 0.0001 which ensures that it is impossible to kill anything with it. I then simulate all other damage dealt by NPCs (except current active followers) that is lower than target's DT using an on-hit event handler, so they can still damage each other and the player. The main issue that remains is to ensure that current followers also use non-lethal ammo from their inventory even if they have other ammo types present there. Your idea with teleporting all other ammo types for their current weapon to a container sounds good (if done only when the follower is in combat). I'll try it out the next chance I'll have some time, thanks man. Link to comment Share on other sites More sharing options...
RoyBatterian Posted December 22, 2016 Share Posted December 22, 2016 NPC's will use whatever rounds they have in their inventory. They choose whatever is first in the ammo form list that they have in their inventory. Link to comment Share on other sites More sharing options...
EmeraldHaze Posted December 23, 2016 Author Share Posted December 23, 2016 (edited) Thanks RoyBatterian, I'll take it into consideration. Edited December 23, 2016 by EmeraldHaze Link to comment Share on other sites More sharing options...
Recommended Posts