technicalbrutaldeathcore Posted June 26, 2014 Share Posted June 26, 2014 Npcs unable to fire bolts/Projectiles from crossbow based weapons Recently i decided to mess around with the creation kit and create npcs which make use of guns(based on crossbows) and other automatic weapons (crossbows) but i noticed they kept raising and lowering their weapons, at first i though i might have messed up the projectiles or scripts, so i spent hours seeing if that was a plausible issue, then later i thought of giving random npcs crossbows to test, but they displayed similar symptom, the PC can fire perfectly with no issues, but npcs seem to be stuck in a loop, and won't even melee with the crossbow although are able to switch weapons and attack with them, normal behaviour otherwise. It may be related to mods, although i'm not sure, as i've had these same mods for a while with no issues, i have been creating my own for my own enjoyment and messing about, but only with races, creating new npcs, factions, spells, armor and weapons and not in any way altering the vanilla (not editing vanilla records) anyway if you need more specifics or anything else to help me fix this issue i'd be happy to give any information required, and sorry if this is in the wrong section as i don't usually post in the forums, i did find one other with my issue on another site, but he received no replies... Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 26, 2014 Share Posted June 26, 2014 1. Can the player fire the weapon?2. When you give the weapon to an NPC, do you give them ammo as well? Link to comment Share on other sites More sharing options...
technicalbrutaldeathcore Posted June 26, 2014 Author Share Posted June 26, 2014 (edited) Yes, i mentioned in that mess of words here:"the PC can fire perfectly with no issues, but npcs seem to be stuck in a loop"and yes, I tried the newer ammo's i created, and a bunch of different vanilla ones(yes i tried bolts, not arrows as it is a crossbow)I also tried all manners of crossbows. if you would like i might make a video demonstrating the issue. i tested the crossbows on guards and other npcs, but what i'm more concerned about is getting the guns performing on my Npcs(few muck around ones, some dead space ones and others i forgot about.)i hope the above won't be necessary as it i believe i have explained the issue perfectly and the need of a demonstration seems unecessary. Edited June 26, 2014 by technicalbrutaldeathcore Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 26, 2014 Share Posted June 26, 2014 You stated that you have some scripts. What is the purpose of those scripts? If they have anything to do with firing projectiles, post them. You could very well have parts of the process blocked off for NPCs and not the player. At any point do you do a check for some reference to be equal to the player? If so, that may very well be the problem. Link to comment Share on other sites More sharing options...
technicalbrutaldeathcore Posted June 26, 2014 Author Share Posted June 26, 2014 they are the automatic weapons scripts i think originally created by automatic crossbows or something similar. and i'm sure that isn't the problem as i've used it for months with minimal issues, they basically choose the clip size, control firerate and the automation is controlled by simply holding the LMB(left mouse button). i've used these very scripts with npcs many times with no issues. thanks for replying by the way, i very much appreciate it. i'll post the scripts contents below if you think it'll help, the other script just links this script to the weapon. also note this script as you can see only edits a magic effect, therefore only affecting the weapon it is equipped on. -: :--------------------------------------------------------------------------------------: :-scriptName J3XCrossbowAutoEffectScript extends ActiveMagicEffect actor myTargetweapon myWeapon int property clipSize autoint clip float property firingSpeed auto Event OnEffectStart(Actor Target, Actor Caster)myTarget = TargetmyWeapon = myTarget.GetEquippedWeapon();debug.notification("equipped")RegisterForAnimationEvent(myTarget, "BowRelease")RegisterForAnimationEvent(myTarget, "bowDrawn")RegisterForAnimationEvent(myTarget, "AttackStop")EndEvent Event OnEffectFinish(Actor Target, Actor Caster);debug.notification("OnUnequipped")UnregisterForAnimationEvent (myTarget, "BowRelease")UnregisterForAnimationEvent (myTarget, "bowDrawn")UnregisterForAnimationEvent (myTarget, "AttackStop")EndEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName);debug.notification(asEventName)if (akSource == myTarget)if asEventName == "bowDrawn";debug.notification("OnAnimationEvent - drawn");RegisterForSingleUpdateGameTime(0.1)clip = clipSizeRegisterForSingleUpdate(firingSpeed)gotostate("firing")else;debug.notification("OnAnimationEvent - other") gotostate("")endifendifendEvent Event OnUpdate()EndEvent state firingEvent OnUpdate() ; This event occurs every five secondsif clip > 0myWeapon.fire(myTarget)clip = clip - 1;debug.notification("fire")RegisterForSingleUpdate(firingSpeed)elseDebug.SendAnimationEvent(myTarget, "AttackRelease")endifEndEventendstate-: :--------------------------------------------------------------------------------------: :- Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 26, 2014 Share Posted June 26, 2014 I don't see anything that stands out on that script as a possible cause. Have you tried these adjustments on a new game? If not, you can use COC in the console at the main menu and go somewhere like Riverwood. That would allow you to test in a "new game" environment. The game won't take some changes mid-game (prefers what is stored in the save file). Try it on a new game. See what happens. Link to comment Share on other sites More sharing options...
technicalbrutaldeathcore Posted June 27, 2014 Author Share Posted June 27, 2014 in testing i always start using a new game (i edited the ini so i start in a cell rather then going through the intro and startgame nonsense) and the problem persists, i don't test on saves as i know very well it's pointless. i hope this information helps. Link to comment Share on other sites More sharing options...
Recommended Posts