Jump to content

Need a script? Maybe I can help.


fg109

Recommended Posts

For the script with step 3, Creation kit doesn't want to compile it. Am I doing something wrong? I've added the condition directly to the procedure branch, and added the script fragment into the "On End" tab. I get the following compiling errors...

 

Starting 1 compile threads for 1 files...

Compiling "PF_NomadHealingSpell1_01001D9F"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PF_NomadHealingSpell1_01001D9F.psc(8,27): missing RPAREN at 'TestFaction1'

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PF_NomadHealingSpell1_01001D9F.psc(8,39): required (...)+ loop did not match anything at input ','

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PF_NomadHealingSpell1_01001D9F.psc(8,42): required (...)+ loop did not match anything at input ')'

No output generated for PF_NomadHealingSpell1_01001D9F, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on PF_NomadHealingSpell1_01001D9F

 

Is this normal, or what did I do wrong? Will it work still?

 

Sorry I'm such a moron, I'm doing my best to follow your steps as directly as possible...

 

EDIT: Tried it in-game, and it turns out ALL he's using is the first spell, and some sort of healing effect appears to happen, although not near as much as intended... I'm assuming this would be due to the papyrus fragment issues. I'll look at it again tomorrow, and see if I can fix my own mistakes. Thank you so much for the help you've already given - I'd have no clue where to start on my own!

Edited by avenger404
Link to comment
Share on other sites

  • Replies 272
  • Created
  • Last Reply

Top Posters In This Topic

Well, I managed to fix it now it seems.

 

I created 3 new properties in the script for items: steel plate armor, steel plate boots and steel plate gauntlets, and added lines removing and immediately adding those properties back to his inventory. This also seems to make him automatically equip them (guess the game makes NPC's do that when a better piece of armor than they had equipped is added to their inventory), before you even see him again. Tested it a couple of times and it works.

 

I do not doubt for a second that your method is better than the one I used, but the way I did it works now, and the script for that quest is a mess anyways (see my original post...) so I'd rather not mess it up now. Thanks for the assist nevertheless! It's useful to know about this reset command for future use. Really appreciate people taking their time to help others with less experience and skill, you're great!

 

T.

Link to comment
Share on other sites

Is there any "top level type thing" for all the things that are listed in the CK's Object Window under "Items"?

I'd like to create a array of this type as a property of a script of mine. I could add an array for each type of item (Weapon[], Ammo[], Armor[] and so on) but that's way to complicated for me. The array should allow the same type of input as the GetItemCount function.

 

Furthermore, I have a problem with the RemodeAddedForm function, that I already posted here

 

I hope that you, fg109, can help me with my problems.

Link to comment
Share on other sites

Impressive. :)

 

One thing I've been struggling with is to detect in a MagicEffect script whether or not the player has dual cast the spell that applied the magiceffect.

 

I managed to detect whether the player has the same spell in both hands by using GetEquippedSpell(0) == GetEquippedSpell(1), but there is a difference between that and actually dual casting it - you could as well cast it with both hands separately, or with one hand while doing nothing with the other.

 

This is an issue because I use a lot of RemoteCast with invisible activators for my spell effects, meaning the dual cast bonuses to duration/damage are not communicated to the spell that is being RemoteCast. I want a check in my script so if the player did dual cast the spell, the spell that will be RemoteCast is replaced with a more powerful version.

 

Thanks in advance. :)

Link to comment
Share on other sites

fg109... Thank you so much for doing this. I'd like to think I've learned a lot just from reading through the other posts. Maybe you could help me out with a script as well?

 

I would like to alter the follower AI in order to make a custom follower sneakier (I'm not going to try messing around with the vanilla followers). Primarily, I want to eliminate two behaviors... 1) followers running into combat when the enemy goes hostile (but before they've even fully detected or started attacking the player or follower). And 2) the follower running through the entire dungeon after an enemy or enemies, forcing the player to chase after them (or simply follow behind and loot the trail of bodies).

 

I thought one way to accomplish this might be to check if the player is sneaking, and if so, then the follower will not enter combat unless they or the player takes actual damage from enemy. If the player is not sneaking, then the follower can initiate attacks on hostiles. This alone may resolve most of the problem, but I also wondered if, in addition, it would be possible to force the follower to stay within a certain radius of the player during combat to prevent them from continuing to pursue more distant enemies?

 

I could be wrong, but I don't think I can do this with packages alone. I'm thinking I need a script or a script/package combination to override the combat behavior in this way. My thought is to have a script that uses oncombatstatechanged and checks to make sure the follower should actually be in combat (whether the player is sneaking, whether they have been hit/attacked, and whether the follower is within the acceptable distance to the player). I know there is a KeepOffsetFromActor, as well as IsSneaking and OnHit functions, so it seems like this might be possible.

 

Any chance you could help me out with this? I'm not set on these specific requirements, so if you think there is a better way to accomplish it, I'll certainly bow to your wisdom. If it's something you think needs to be accomplished with packages and not a script, then any advice you might have to point me in the right direction would be much appreciated. Thank you so much for all your help...not just for me, but in general. I hope you'll continue the awesome work; I can't imagine how many mods may benefit from access to this collection of scripts.

Link to comment
Share on other sites

Could you write a script that would allow the game to load a separate weapon model when it was unsheathed? I use the reversed daggers mod, but it looks silly when sheathed, since it is simply a reversed model, so it is reversed when sheathed as well. If you could write a script that would allow me to point the game to the reversed model when the weapon is out, and then revert back to the vanilla model when it is sheathed, that would be awesome!

thnx!

Link to comment
Share on other sites

@scrivener07

 

Are you sure that you need to move the workbench to the player? When I use the activate command from the console, I could be in a whole different cell from where the workbench actually is. As for your code, you have the activate function wrong. It's supposed to be:

 

(Item to be activated).Activate(Item doing the activating)

 

Also, I just had an idea. Why not just add the keyword for the workbench to your item instead? The keyword is CraftingSmithingForge for smithing, CraftingSmelter for smelting, and CraftingCookpot for cooking. I can't seem to find any recipes for potions though...

 

 

@avenger404

 

The compiler is saying there's a missing right parenthesis on the 8th line. Did you forget one? If not, could you post the whole script fragment? The compiler isn't always right about which line an error is on.

 

 

@M3rvin

 

Sorry, not that I know of. You might want to use formlists instead. They work almost the same as arrays (though they're more like sets because you're unable to have duplicate entries) and the only bad thing is that you cannot use them for integers/floats/bools. It's much easier to fill them since you can just drag and drop.

Link to comment
Share on other sites

@EnaiSiaion

 

That is something that I haven't tried out myself before. I would suggest that you have two magic effects for each spell instead, and to use the condition "IsDualCasting" so only one of them applies at a time. But I suggested that to someone before, and I think they said it didn't work. Doesn't hurt to try, I suppose.

 

Only other way I can think of is through animations. To figure out when the player is casting a spell, I would have an OnSpellCast in a script on the player. Then I would check the "IsCastingDual" animation variable using GetAnimationVariableBool or maybe GetAnimationVariableInt.

 

I'm not sure that OnSpellCast happens when you start casting or after you release a spell though, so you might have to use RegisterForAnimationEvent for "BeginCastLeft" and "BeginCastRight". You can find a full list of the animation events by loading the skyrim.esm and clicking GamePlay -> Animations... -> Actors\Characters\Behaviors\0_Master.hkx and then checking the list of anim events on the right of the window. Just a warning though, not all of them work (nothing will happen when you register for the anim event).

 

So maybe something like this:

 

Scriptname Example extends ReferenceAlias

GlobalVariable property DualCasting auto

Event OnSpellCast(Form akSpell)
if (GetActorReference().GetAnimationVariableBool("IsCastingDual") == 1)
	DualCasting.SetValue(1.0)
elseif (GetActorReference().GetAnimationVariableInt("IsCastingDual") == 1)
	DualCasting.SetValue(1.0)
elseif (GetActorReference().GetAnimationVariableFloat("IsCastingDual") == 1.0)
	DualCasting.SetValue(1.0)
endif
Utility.Wait(1)
DualCasting.SetValue(0)
EndEvent

 

And then in your magic effect scripts, you can check the global variable to see whether or not the player was dual casting.

Edited by fg109
Link to comment
Share on other sites

@kryptopyr

 

I suggest that you try lowering the follower's aggressiveness first, and then try to use a hold position package. Perhaps you should even make a new package instead of using the regular default package. Make a package template with the follow procedure (following the player) with the condition "IsInCombat == 0", and a hold position procedure (location near PlayerRef) when "IsInCombat == 1". Then check the flag for "Ignore Combat".

 

 

@Wienecke01

 

Check the earlier pages of the thread. I did something like this for ghosu.

Link to comment
Share on other sites

Hey there man, thanks for being so helpful.

 

Any chance you'd make a function that removes added forms from a formlist that doesn't get stuck on the first use? I've been trying to use RemoveAddedForm() to remove forms added with AddForm() but it gets stuck after the first use and even corrupts the data in the list. I figured it's a bug but it could be me doing something wrong. I'd appreciate if come up with something better or at least test this function and help me conclude if this is a bug or the bug is me lol.

 

This is the function that isn't working past the first attempt. In this case it's set to remove at random positions, but it doesn't seem to work even if it's a fixed position like 0.

 

  
FUNCTION Reward(FormList akRewardList)


int iPos = utility.RandomInt(0, ((akRewardList.GetSize())- 1))


Debug.Messagebox(akRewardList.GetSize())
akRewardList.RemoveAddedForm(akRewardList.GetAt(iPos))
Debug.Messagebox(akRewardList.GetSize())



EndFunction

Edited by ArcaneSmith
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...