Jump to content

erratichippo

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by erratichippo

  1. Based on your script you will be stuck in the while loop until ClosestMarker finds something. I would do a few things to alter your code to help you debug a little. This will let you know if you entered the loop and what your function is finding. Also make sure that you capitalize the C in closestMarker in your while loop. Your variable name must be consistent throughout your code. If you find you are not entering the loop try it without the while loop and see if you can get FindClosestReferenceOfAnyTypeInListFromRef to return something. Once you have that figured out then add the while loop back in. while (ClosestMarker==none) ClosestMarker = Game.FindClosestReferenceOfAnyTypeInListFromRef(IdleList, Caster, Distance) debug.notification("ClosestMarker"+ClosestMarker+".") endwhile Here is my script that uses that same function maybe you can use it as a reference. scriptName WeaponThrow extends ActiveMagicEffect import game import debug formlist property WeaponList auto float RadiusToFindWeapon = 2000.0 objectreference WeaponFound ;objectreference property Target auto Event Oneffectstart(Actor akTarget, Actor akCaster) WeaponFound = game.FindClosestReferenceOfAnyTypeInListFromRef(WeaponList, akCaster, RadiusToFindWeapon) debug.notification("Weapon Found "+WeaponFound) debug.notification("akTarget "+akTarget) ;Target.moveto(akTarget,0,0,5,true) WeaponFound.applyhavokimpulse(0,0,1,50) ;WeaponFound.translatetoref(game.getplayer(),100) Endevent
  2. I am trying to write a spell script that will cancel the blood and sound effects when a character is hit by a weapon. The purpose is to make shield ward act more like a physical shield. I want the hit effects to sound like the ward got hit and not the character. I am some scripting experience, but I have never done anything with fx. I do not want to delete the blood textures or sound files because I want hits to sound and look normal when the ward is not up. Basically, I need to change the blood effects and sound on hit while the ward is up.
  3. Hello I am trying to find a good tutorial on how to use functions in papyrus. The wiki isnt clear enough for me.
  4. I was wondering if anyone knew how to change the magnitude of a spell in a script. I am trying to change the amount of damage the ward can absorb based on my restoration level. My script would look something like this. Scriptname WardScriptBalancedMagic extends activemagiceffect {Adds the effect of the ward spells} Int Property WardMag Auto Event OnEffectStart(Actor Target, Actor Caster) Float frestorationskill = Game.GetPlayer().GetAV("Restoration") WardMag=(frestorationsklill*.5)+40EndEvent The variable WardMag means nothing of course. It has no bearing on the actual spell value. I want to know a way to relate the ward magnitude to my variable WardMag. I noticed there is an actor value called wardpower in the papyrus wiki, but there is no advice on how to use that in a script. I think that does what I want it to do, however I have no idea how to use it. Has anyone used this before?I am thinking I can use it just like my wardmag variable, in which case I think my script will look like Scriptname WardScriptBalancedMagic extends activemagiceffect {Adds the effect of the ward spells} Float Property WardMag Auto Event OnEffectStart(Actor Target, Actor Caster) Float frestorationskill = Game.GetPlayer().GetAV("Restoration") WardMag=(frestorationsklill*.5)+40 Game.GetPlayer().SetActorValue("WardPower", WardMag)EndEvent
  5. Hello, I am having some trouble getting my script into the game. It compiles just fine I just dont know how to activate it. The function of this script is to assign a hotkey to cast spells with a two handed weapon. I was getting really annoyed with having to enter a menu screen during my combat sequences to switch to spells. Normally I attach my scripts to an object like a spell or weapon. But I want this script to just run all the time while I am in game. Any idea how I can do that? I suppose I could tie this into an active magic effect that is always on the character, but I am wondering if there is a better way to do this. Thank you Scriptname z_two_handed_weapon_cast extends Actor Bool Function IsKeyPressed(Int dxKeycode) Global Native Bool bIsHotkeyPressed Int Property iHotkey = 260 Auto Int Property WeaponType Auto Int Property WeaponTypeStorage Auto Int Property aihand = 0 Auto Spell Property WardSteadfastLeftHand Auto Event onInit() RegisterForSingleUpdate(0.5) EndEvent Event OnUpdate() If bIsHotkeyPressed != IsKeyPressed(iHotkey) ; Only run code when the status changes bIsHotkeyPressed = !bIsHotkeyPressed ; Set bool to whatever it isn't If bIsHotkeyPressed ; ==True Debug.Trace("Hotkey Pressed") WeaponTypeStorage = Game.GetPlayer().GetEquippedItemType(1) If(WeaponTypeStorage == 5 || WeaponTypeStorage == 6) Debug.Trace("Weapon was two handed") Game.GetPlayer().GetEquippedWeapon().SetWeaponType(1) Game.GetPlayer().EquipSpell(WardSteadfastLeftHand, 0) Endif Else Debug.Trace("Hotkey Released") If bIsHotkeyPressed == False Game.GetPlayer().GetEquippedWeapon().SetWeaponType(WeaponTypeStorage) Endif Endif Endif RegisterForSingleUpdate(0.5) EndEvent
  6. Hello, I am having a little trouble with the script I am writing. The purpose of the script so far is to deflect an arrow that is hitting the caster of the effect. The problem I am having when calling the onHit function is that the projectile variable is of type projectile and I believe I need to use a variable of type ObjectReference when using the havokimpulse function. If anyone could help me get this thing working you would make my day. You would also earn yourself a cookie, that you will go out and buy yourself. Scriptname zWardshield_Improved extends activemagiceffect {Improves the ward shield by allowing it to block arrows. Also reduces the constant spell cost.} float hitAngle actor selfRef Projectile Property Arrow auto Event OnEffectStart(Actor akTarget, Actor akCaster) selfRef = akCaster Debug.Notification("Caster reference successful.") EndEvent Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) hitAngle = selfRef.GetHeadingAngle(akAggressor) Arrow = akProjectile as ObjectReference // I get error message saying cannot cast type projectile to objectreference if hitAngle >= -90.0 && hitAngle <= 90.0 Debug.Notification("Hit was in front of caster.") Arrow.ApplyHavokImpulse(1.0, 0.0, 0.0, 50) endif Debug.Notification("Hit was not in front of caster.") EndEvent
  7. Shameful bump because I am really stuck.
  8. I am trying to get the Ward spell to block not only magical but physical attacks. My goal is to make the ward spell act exactly like a shield does in game. The scripting part isnt a huge challenge for me. Its the collision layer. Currently if a sword hits a character casting ward there is still a blood splatter effect. In the CK if you go into the collision layer section under the misc tab there is a collision layer called L_Ward. It states that it is the collision layer for the ward spell. I added a bunch of things to that layer such as non-projectile weapons and projectile weapons however I still get blood splatter whenever I get hit with a weapon. Exactly like the sword were hitting flesh.Arrows also still fly freely though the ward spell. Do I need to add impact data between the L_Ward collision layer and the weapons collision layer? If so how do I do that? Also there is a material in the CK called MaterialWard? Is that the ward material? I tried changing that to have the havok heavy metal impact data set but it still didnt work out. Any help would be great, thank you.
  9. Hello, I had this idea for a mod but I dont know exactly how to implement it. The goal of this mod is to change the way armor works in Fallout. Currently armor works by decreasing the damage of a weapon. I wish to write a mod that causes armor to either allow the round to penetrate and damage the person or to negated the damage altogether. Basically I want power armor to totally block small arms fire such as 9mm rounds but be totally useless against a 50 cal round. The problem with just increasing the DT is that you will always take at least 20% of the base weapon damage, due to how damage is calculated in fallout. I would try a mod that had the ability to toggle demi god mod but, all that does is increase your HP by an infinite amount which is not what I am looking for. Another thought was to replenish any damage that was done to an actor that would have ordinarily not penetrated the armor. However this does not allow for one shot kills to the head, as you would be dead and thus no heath would be able to be replenished. So I was wondering if anyone knew how to write a script that caused a damage to a actor to be reduced to 0, and or temporarily reduce a weapons damage to 0. If a script could be written so that weapons damage was reduced to 0 unless it passed a simple boolean check that could also work for my purposes. Thank you for any help.
  10. I have been playing around with the game AI lately using the settings in the geck. I noticed that when I engaged a NPC in combat it sends off an alarm that makes the other NPCs in the area attack me. However this alarm has to small of a radius and the NPCs give up searching way to quickly. I was wondering if anyone knew of a way to expand the alarm and increase the search time and search distance of the NPC's. I was looking at the fcombatsearch values in the settings but there are a lot of them and I dont know what changing them will do. Any help would be great thank you.
×
×
  • Create New...