dubiousintent Posted December 31, 2017 Share Posted December 31, 2017 AFAIK: you can't add "perks" to NPCs. "All Companions are NPCs, but not all NPCs are Companions." See 'TIP: Perks for Companions' under the "Custom NPCs" section in the wiki "Getting started creating mods using GECK" article. Just as a suggestion: Why won't a Weapon "Object Effect" work instead?Impact Script: The script which is run on an Actor which is hit by a projectile shot by a weapon using this ammunition. This script is run before any Ammo Effects are applied, but after any Object Effects which are applied by the weapon itself. Note that since this script is run on Actors, projectiles fired at inanimate targets will not have their scripts executed. Also note that an Ammo effect script also has Hit information available in the ScriptEffectStart block, accessible via the functions GetHitAttacker, GetHitHealthDamage, GetHitLimbDamage, GetHitProjectile and GetHitWeapon-Dubious- Link to comment Share on other sites More sharing options...
trashgarbage666 Posted December 31, 2017 Author Share Posted December 31, 2017 (edited) I read here that you can't use GetHitLocation on a weapon's Object Effect:http://geck.bethsoft.com/index.php?title=GetHitLocation "GetHitLocation won't work if used in a weapon's Object Effect, but will work if used in the weapon's Crit Effect." But, like the "NPCs can't have perks" thing, I'm just parroting stuff I read on the wiki. Obviously, I'm no expert. Edited December 31, 2017 by punchbattle Link to comment Share on other sites More sharing options...
dubiousintent Posted December 31, 2017 Share Posted December 31, 2017 Mostly that's all I'm doing as well (parroting the wiki). All experience does is let you say: "Tried that; know the result." But nothing says you can't get the HitLocation info outside of the ObjectEffect, save it to your own variable, and check that in your Object Effect. Or reconsider why you can't use "Crit Effect" where it does work. The key issues is "timing" of when you can obtain the information and then use it.. Which is where "EventHandlers" come in handy. When you can't do what you want in a straightforward manner, then you have to "work around" the limitations. Also remember, the wiki is a lot less authoritative that it appears. Often even the developers don't know why some things are the way they are, or that they could even be done. It can sometimes surprise you to just try it out and see what happens. Which is how the community still finds things to add to the wiki. -Dubious- Link to comment Share on other sites More sharing options...
Mktavish Posted December 31, 2017 Share Posted December 31, 2017 I read here that you can't use GetHitLocation on a weapon's Object Effect: An Entry point is not an object effect ... and would most certainly work in the condition field of that entry point. The question is the Attacker and Attacker weapon .... thein lies the conditions you seek ... but maybe a script ? Link to comment Share on other sites More sharing options...
trashgarbage666 Posted December 31, 2017 Author Share Posted December 31, 2017 (edited) An Entry point is not an object effect ... and would most certainly work in the condition field of that entry point. The question is the Attacker and Attacker weapon .... thein lies the conditions you seek ... but maybe a script ? I've set up a perk that gives the player a guaranteed critical hit along with a massive critical hit damage bonus against NPCs not wearing a helmet. I'm using Entry Point > Calculate My Critical Hit Chance and Entry Point > Calculate My Critical Hit Damage. It offers three condition fields: Perk Owner, Weapon, and Target. GetHitLocation seems unresponsive in all three fields. All other conditions I've set are working fine, but GetHitLocation is arguably the most important part of a would-be headshot perk. Maybe I could attach a script to a weapon that sets a variable when it hits something in the head, and then have the perk check for that variable ...? I'm not sure how to get perks to check for variables, though. Edited December 31, 2017 by punchbattle Link to comment Share on other sites More sharing options...
Mktavish Posted January 1, 2018 Share Posted January 1, 2018 (edited) Maybe I could attach a script to a weapon that sets a variable when it hits something in the head, and then have the perk check for that variable ...? I'm not sure how to get perks to check for variables, though. GetScriptVariable is available in the condition drop down. You then just select the object that ran the script and set the variable. But I thought your impact script was working fine except for the player getting head shot.So I was suggesting to only use a perk for the player getting hit.By using : Perk / Entry Point / Adjust Limb dmg / multiply value / 10 or higher ... what ever can take all the hit points.And on the perk owner conditions use ...GetHitLocation == 1 ORGetHitLocation == 2 ANDGetEquiped MyHelmet != 1 Then since you probably want only certain npc's to head shot ... Use the "Attacker &or Attacker Weapon" condition tabs. you said "EDIT: Also, just as a side thing, I'm almost certain "Adjust Limb Damage" is for limb crippling, not health points. (Just confirmed it.)" But limbs have health , and you cripple them by taking the health they have ... which does take away from the over all health .Are you sure you can't overkill a limb to take the whole health pool ? Edited January 1, 2018 by Mktavish Link to comment Share on other sites More sharing options...
trashgarbage666 Posted January 1, 2018 Author Share Posted January 1, 2018 (edited) After lots and lots of testing, I found the script to be too inconsistent to be reliable. And when it started acting odd, it wouldn't work again until the next fight. Sometimes the game would crash when the bullet hit its target. The problem was bad enough that I wanted to try out a perk version, and it's sooo much more stable. No crashes, and no inconsistencies! I guess the goal now is to make two perks for the player -- one that lets NPCs headshot the player, and one that lets the player headshot NPCs. I'm trying to use GetScriptVariable, but its Function Paramters field, the field where I'm assuming my script goes, needs me to select something from the Render Window. Meaning it's expecting my script to be a ...physical object in the game world? Either that, or it's being very misleading. Either way, I have no idea how to feed my script into it. After multiple experiments with "Adjust Limb Damage", I can confirm beyond a reasonable doubt that it only affects how much damage a limb can withstand before being crippled. Limbs do not have health points, they have a durability number derived from the owner's health points. Both numbers go down when damage is applied, but they are separate values. Edited January 1, 2018 by punchbattle Link to comment Share on other sites More sharing options...
Mktavish Posted January 1, 2018 Share Posted January 1, 2018 (edited) It doesn't want the script name , it wants the base-ID of the object the script is attached to.Then the second parameter will become active , and you pick the variable name that pops up. If you use a quest script , then you use the condition of GetQuestVariable , and pick the ID of the quest. Hmmm so it's looking like there is no entry point you can use for when the player gets hit then.But you can do an ability , which would be an actor effect you set up. And add the base effect of "Damage Health" and set its magnitude high enough to kill the player. Then put those 3 conditions I posted previously on the conditions of the perk ... Which I think you need to select "Reference" in the "Run On" drop down ... then hit the select button and from that window ... go to the reference drop down ... and scroll down to "Player Ref" I think that will work for ya. Edited January 1, 2018 by Mktavish Link to comment Share on other sites More sharing options...
trashgarbage666 Posted January 1, 2018 Author Share Posted January 1, 2018 (edited) It doesn't want the script name , it wants the base-ID of the object the script is attached to.Then the second parameter will become active , and you pick the variable name that pops up. If you use a quest script , then you use the condition of GetQuestVariable , and pick the ID of the quest. There are two ways to fill GetScriptVariable's target field: selecting something from the Render Window, or telling it which Cell your object is in, and selecting from a dropdown list of objects contained within the Cell. I feel like this method is for something like unique NPCs or objects. My script is attached to all ammunition, and thus isn't something being placed in the game world. GetQuestVariable might be the more viable option, but I have zero experience with quests. I'll give it a try, but it'll be harder to distinguish lack of functionality from user error. For some reason, I'm having no luck using an Ability effect to apply damage on hit. I'm going to keep at it, but it's kind of discouraging that I'm getting nothing from it at all. Like the other thing, I'm having a hard time telling if I'm doing something wrong, or if it just doesn't like GetHitLocation. Edited January 1, 2018 by punchbattle Link to comment Share on other sites More sharing options...
Mktavish Posted January 2, 2018 Share Posted January 2, 2018 (edited) It doesn't want the script name , it wants the base-ID of the object the script is attached to.Then the second parameter will become active , and you pick the variable name that pops up. If you use a quest script , then you use the condition of GetQuestVariable , and pick the ID of the quest. There are two ways to fill GetScriptVariable's target field: selecting something from the Render Window, or telling it which Cell your object is in, and selecting from a dropdown list of objects contained within the Cell. I feel like this method is for something like unique NPCs or objects. My script is attached to all ammunition, and thus isn't something being placed in the game world. Ah Ya sorry ... was just going from memory there. Your right , you have to select a reference that has actually been dropped in the render screen , therefore in a cell. But since the Base-ID is what holds the script , it is calling back to that.So how you get something that won't start out having a ref instance of it. Is make a dummy cell and drop the item in it.However this is still not going to work for you. Because you can only select objects that have an object script with "GetScriptVariable" And Ammo objects are an odd duck with having an effect script. So if you want the ammo effect script to set a variable , you make a dummy object that can hold an object script , to declare the variable in. Something like this I guess ... ~~~~~~~~~~~~SCN zzzFootLockerScript Int iPlayerHead~~~~~~~~~~~~ Then the ammo script like this ... ~~~~~~~~~~~~SCN ZZZMyBulletScript BEGIN GameMode Ref rTarget Set rTarget to GetOwnerLastTarget If rTarget.GetIsReference PlayerRef == 1 zzzFootLockerRef.SetVariable iPlayerHead 1else zzzFootLockerRef.SetVariable iPlayerHead 0 endIf END~~~~~~~~~~~~~~~~ GetQuestVariable might be the more viable option, but I have zero experience with quests. I'll give it a try, but it'll be harder to distinguish lack of functionality from user error. For some reason, I'm having no luck using an Ability effect to apply damage on hit. I'm going to keep at it, but it's kind of discouraging that I'm getting nothing from it at all. Like the other thing, I'm having a hard time telling if I'm doing something wrong, or if it just doesn't like GetHitLocation. Im thinking maybe just scrap the perk for player getting head shotted , and just use an ActorEffect that is flagged PC Start. Add the effect of "Damage Health" and give it a magnitude of 500 ... what ever will surely kill the player at all levels. Then these 3 conditions ... Run on: Subject ; GetScriptVariable "zzzFootLockerRef " , iPlayerHead == 1 ANDRun on: Subject ; GetEquiped Armour : MyHelmet != 1 ANDRun on: PlayerRef ; GetHitLocation == 1 MaaayyyyBeee that will work for ya :unsure: crossing fingers :whistling: Edited January 2, 2018 by Mktavish Link to comment Share on other sites More sharing options...
Recommended Posts