Bethesda, Please, I will only ask one question of you for th

Post » Mon Jun 18, 2012 5:43 pm

Is there NO possible way to add a perk to an actor using a script? (just with CK and no 3rd party tools)

Is the ONLY way to add a perk to an actor by doing it ONE by ONE for each actor manually for all 300 or so actors?

You do not even have to tell me HOW to do it just tell me it can be done and I will find it if it takes me a year to do so....
User avatar
CYCO JO-NATE
 
Posts: 3431
Joined: Fri Sep 21, 2007 12:41 pm

Post » Mon Jun 18, 2012 6:57 pm

The AddPerk() function should work on any actor. Only problem will be to loop over all actors. No idea how one would do that. Apart from that even if possible I wouldn't do that using a script. If you really need every actor to have that perk do it in the CK. I think that's a far cleaner solution, though prone to incombatibility between mods.
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am

Post » Mon Jun 18, 2012 6:43 pm

Am hoping SKSE gives us GetHighActors like OBSE did in Oblivion.


However, in regards to the CK's UI, I think it would have been good if the different properties of a table is editable.
E.g. With the Magic Effects table of a spell, you have to open a separate window just to change a Magic Effect's magnitude instead of simply being able to input it in that table that lists them.

Anyway, creating Aliases is currently the only way to make sure that the original base objects and references stay untouched.
I've not looked at it yet, but it looks like there's a way to find actors in the vicinity of the player.
Reference Alias (window) > Find Matching Reference. Add a condition for GetIsAlerted.
If my guess is correct, that should get you an Actor.
Create a few more of them and ensure that each one is unique with Allow Reserved.
Add a Script or a Spell (or anything) to them.
However, these are simply my guesses.

If this works as I suspect, then it should be a good method to temporarily add functionality to Actors without changing their base objects nor struggling with the CK's UI.
User avatar
Gen Daley
 
Posts: 3315
Joined: Sat Jul 08, 2006 3:36 pm

Post » Tue Jun 19, 2012 8:40 am

The AddPerk() function should work on any actor. Only problem will be to loop over all actors. No idea how one would do that. Apart from that even if possible I wouldn't do that using a script. If you really need every actor to have that perk do it in the CK. I think that's a far cleaner solution, though prone to incombatibility between mods.

Nope it doesn't. I have tested this extensively and it didn't work (it's also written on the Creation Kit page here that it doesn't do anything for NPCs: http://www.creationkit.com/AddPerk_-_Actor)

I've also tried adding an ability with a magic effect with the ''Perk to Apply:'' flag set, but even that only adds the ability itself and not the perk.

Looping over the actors through script is no problem though.

Am hoping SKSE gives us GetHighActors like OBSE did in Oblivion.


However, in regards to the CK's UI, I think it would have been good if the different properties of a table is editable.
E.g. With the Magic Effects table of a spell, you have to open a separate window just to change a Magic Effect's magnitude instead of simply being able to input it in that table that lists them.

Anyway, creating Aliases is currently the only way to make sure that the original base objects and references stay untouched.
I've not looked at it yet, but it looks like there's a way to find actors in the vicinity of the player.
Reference Alias (window) > Find Matching Reference. Add a condition for GetIsAlerted.
If my guess is correct, that should get you an Actor.
Create a few more of them and ensure that each one is unique with Allow Reserved.
Add a Script or a Spell (or anything) to them.
However, these are simply my guesses.

If this works as I suspect, then it should be a good method to temporarily add functionality to Actors without changing their base objects nor struggling with the CK's UI.

I have been thinking of quest aliases too... like for example creating 10 or 15 quest aliases (so there'll be support for at most 10 or 15 actors in combat with the player at the same time), but the big issue is: is it possible to reuse the same aliases? As in, if there are 15 enemies in a dungeon and they've taken spots as quest aliases, and the player leaves the dungeon and enters another dungeon, can those previous 15 quest aliases be cleared and reused? I didn't find a way to do this really, but if you can figure this one out you'll be a great help to both me and spookyfx :P
User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm

Post » Mon Jun 18, 2012 9:26 pm

It looks to me as if the Story Manager can update the Alias.
According to the Wiki:
Find Matching Reference
This option allows the Story Manager to find a reference from anywhere in the world (but only persistent references, or Unique actors, can be found this way outside the loaded area). The "Match Conditions" are used by the Story Manager to filter the potential choices. The optional checkboxes are as follows:

In Loaded Area: This limits the search to the loaded area (the player's current interior cell, or the 5x5 cells around the player in a worldspace). Useful when you want something near the player.

The note for "In Loaded Area" suggests that the Alias changes according to the loaded area.
User avatar
quinnnn
 
Posts: 3503
Joined: Sat Mar 03, 2007 1:11 pm

Post » Tue Jun 19, 2012 9:02 am

It looks to me as if the Story Manager can update the Alias.
According to the Wiki:


The note for "In Loaded Area" suggests that the Alias changes according to the loaded area.

Yes but to me it looks like this only works at the time the quest is trying to fill it's aliases. And according to this page: http://www.creationkit.com/Quest_Alias_Tab that time is ''when the quest starts''. This means that you can fill each alias once, and that alias can indeed be filled by an actor near the player, but afterwards that actor doesn't have to be near the player anymore and you can't refill it with another actor. Might be wrong (and hoping I am), but this is how I read it.
User avatar
kirsty williams
 
Posts: 3509
Joined: Sun Oct 08, 2006 5:56 am

Post » Tue Jun 19, 2012 5:27 am

Ahhh...I missed that "when the quest starts".
What if you have another Quest that checks OnLocationChanged ()
and have it Reset () the Quest with the Aliases?
User avatar
Jose ordaz
 
Posts: 3552
Joined: Mon Aug 27, 2007 10:14 pm

Post » Mon Jun 18, 2012 9:59 pm

Guess I could give that a try... and it might help fix my problem because I can actually better use scripts than perks (perks was just a workaround because I couldn't attach scripts to everyone), but it won't help spookyfx really, because he needs to add perks and there isn't even a place to add perks to quest aliases :(

Again stupid.. you can add factions, spells, keywords, items, AI packages and scripts to a quest alias but you can't add perks.... makes no sense at all imo
User avatar
nath
 
Posts: 3463
Joined: Mon Jan 22, 2007 5:34 am

Post » Tue Jun 19, 2012 6:16 am

If this works, let us know. A few of my Oblivion mods that I want to transfer over needs this (or OBSE's GetFirstRef/GetNextRef or GetHighActors functions).
Also, the Aliases lacking Perks could simply be an oversight from Bethesda. They may add a section for it in an update. Though, this doesn't really help the current need for it.
User avatar
Sudah mati ini Keparat
 
Posts: 3605
Joined: Mon Jul 23, 2007 6:14 pm

Post » Tue Jun 19, 2012 4:44 am

If this works, let us know. A few of my Oblivion mods that I want to transfer over needs this (or OBSE's GetFirstRef/GetNextRef or GetHighActors functions).
Also, the Aliases lacking Perks could simply be an oversight from Bethesda. They may add a section for it in an update. Though, this doesn't really help the current need for it.

Bethesda updating Creation Kit with new features? Would be great, but to be honest I doubt they'll even update it with bug fixes :P I'll try this after lunch today, will let you guys know how it went
User avatar
maddison
 
Posts: 3498
Joined: Sat Mar 10, 2007 9:22 pm

Post » Tue Jun 19, 2012 5:48 am

Thanks for your ideas kuertee, just tested and attaching scripts to nearby actors worked. Because it's not what this thread was originally about, I created a new topic in which I described the making of the mod and the testing of it in hopefully enough detail here: http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/

Unfortunately this isn't gonna help duke patrick with the perks though, but it should help me, and hopefully duke and others can also find use for this somehow.
User avatar
GPMG
 
Posts: 3507
Joined: Sat Sep 15, 2007 10:55 am

Post » Tue Jun 19, 2012 5:50 am

Ok, so a mysterious stranger in my mod thread said this:


If you actually look at the Targe of the Blooded perk, you'll see it has no conditions whatsoever on who gets access to the perk - it's activated soley via an entry point condition attached to the Perk Entry, which is the game's method for precise control of when the perk's effect are turned on (e.g. some perks are abilities which are always on regardless, and others are spells which are triggered upon precise criteria). Whoever has the targe shield equipped gets the spell applied. The same principle can be applied to any perk, and thus you can generate global weapon changes without the need for scripting or altering every weapon speed individually. Further, you can create a perk family and apply stamina conditions to each level, allowing for different weapon speeds.


I only get about half of what he is saying, but I will look at this in the CK. Dose this make sense to anyone that was in this thread already?
Will this REALLY work to add perks effects like the arrow deflection perk to all the actors without needing to add the perk to each actor in the CK?

I am worried that what he is talking about is not the same as what I am after.
User avatar
Andrew Perry
 
Posts: 3505
Joined: Sat Jul 07, 2007 5:40 am

Post » Tue Jun 19, 2012 7:37 am

Ok, so a mysterious stranger in my mod thread said this:


If you actually look at the Targe of the Blooded perk, you'll see it has no conditions whatsoever on who gets access to the perk - it's activated soley via an entry point condition attached to the Perk Entry, which is the game's method for precise control of when the perk's effect are turned on (e.g. some perks are abilities which are always on regardless, and others are spells which are triggered upon precise criteria). Whoever has the targe shield equipped gets the spell applied. The same principle can be applied to any perk, and thus you can generate global weapon changes without the need for scripting or altering every weapon speed individually. Further, you can create a perk family and apply stamina conditions to each level, allowing for different weapon speeds.


I only get about half of what he is saying, but I will look at this in the CK. Dose this make sense to anyone that was in this thread already?
Will this REALLY work to add perks effects like the arrow deflection perk to all the actors without needing to add the perk to each actor in the CK?

I am worried that what he is talking about is not the same as what I am after.


Well, that mysterious stranger is mistaken, unfortunately. There are only 2 entities in the whole game that starts off with that 'targe of blood' perk. One is the player and the other one is the original owner of the shield - Umana or something. With that said, any other NPC who 'happens' to equip Targe Of Blood shield will not have access to that 'bleeding effect'

To your question, yes, its possible to add your arrows deflection perk to each and 'any' actor in the game. Well, should be any actor that player encounters.
User avatar
Shelby McDonald
 
Posts: 3497
Joined: Sat Jan 13, 2007 2:29 pm

Post » Tue Jun 19, 2012 5:35 am

errr... HUH? How?

the Addperk script command is broken, it will not work on actors.
The only other way I have heard of is with 3rd part programs, but do not want to get into that kind of thing until SKSE is out of beta.


To your question, yes, its possible to add your arrows deflection perk to each and 'any' actor in the game. Well, should be any actor that player encounters.
User avatar
Darlene DIllow
 
Posts: 3403
Joined: Fri Oct 26, 2007 5:34 am

Post » Mon Jun 18, 2012 9:36 pm

errr... HUH? How?

the Addperk script command is broken, it will not work on actors.
The only other way I have heard of is with 3rd part programs, but do not want to get into that kind of thing until SKSE is out of beta.

I assume you tried making an invisible "cloak", increasing it's projectiles' range to some large number (A cloak works by shooting a "projectile" at each valid target in line of sight and in range) and having it use that effect on a target with the OnEffectStart event, on the target? If you could make an effect that works like a disease, and is applied by such a cloak spell, you should be able to stick a script on every actor the player meets to do just about anything...how have you tested whether the Perk is being applied?

Keep in mind, the Arrow Deflection perk would only work if two conditions are met...the actor must have a shield, and needs to be blocking if I remember the mechanism correctly...and you don't see NPCs blocking much...I think I've seen my followers do it, but very rarely.
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm

Post » Tue Jun 19, 2012 2:19 am

errr... HUH? How?

the Addperk script command is broken, it will not work on actors.
The only other way I have heard of is with 3rd part programs, but do not want to get into that kind of thing until SKSE is out of beta.

Well, the addperk script sure works! I just tried this script in my Quest script that updates every 1 second...

Event OnUpdate()If (!Game.GetPlayer().HasPerk(TrickShot))  Game.GetPlayer().AddPerk(TrickShot)  Debug.Notification("Player doesn't have TrickShot yet!")  Debug.Notification("TrickShot has been added!")ElseIf(Game.GetPlayer().HasPerk(TrickShot))  Debug.Notification("Player has TrickShot perk!")EndIfEndEvent

and here is the output

Player doesn't have TrickShot yet!TrickShot has been added!Player has TrickShot perk!Player has TrickShot perk!Player has TrickShot perk!Player has TrickShot perk!

Unless you meant player is not actor..... But the game actually treats player as an Actor instance.

The other way around adding perk is spell ability. From the way I see it, perk are just .... spell. You could create an deflect arrows ability and use the command addspell on actors, which works very well. (I'm using one for my mounted combat mod :P)
User avatar
Louise
 
Posts: 3407
Joined: Wed Nov 01, 2006 1:06 pm

Post » Mon Jun 18, 2012 11:15 pm

oh boy.... :nope:

the title of this thread is:


Bethesda, Please, I will only ask one question of you for the rest of my life
( adding perks to actors other than the player)


darn...my hopes and dreams were bashed again.


AddPerk does not work for the actors who is not the player.

It has been tested a lot by myself and by Borgut1337.
And It even says so in the Wiki:


ADDPERK - ACTOR

Notes
This does nothing for NPCs.


see here: http://www.creationkit.com/AddPerk_-_Actor


I tested it with a visual effect added to the perk. Borgut1337 tested it with other effects as well and none would work.





Well, the addperk script sure works! I just tried this script in my Quest script that updates every 1 second...

Event OnUpdate()If (!Game.GetPlayer().HasPerk(TrickShot))  Game.GetPlayer().AddPerk(TrickShot)  Debug.Notification("Player doesn't have TrickShot yet!")  Debug.Notification("TrickShot has been added!")ElseIf(Game.GetPlayer().HasPerk(TrickShot))  Debug.Notification("Player has TrickShot perk!")EndIfEndEvent

and here is the output

Player doesn't have TrickShot yet!TrickShot has been added!Player has TrickShot perk!Player has TrickShot perk!Player has TrickShot perk!Player has TrickShot perk!

Unless you meant player is not actor..... But the game actually treats player as an Actor instance.

The other way around adding perk is spell ability. From the way I see it, perk are just .... spell. You could create an deflect arrows ability and use the command addspell on actors, which works very well. (I'm using one for my mounted combat mod :tongue:)
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Tue Jun 19, 2012 6:51 am

Ok :P your dream were bashed away, well, not entirely

In shameless attempt to make up for my poor reading ability, I do have a work around for you.

Perks can be treated as Ability, or spell. You can create a similar effect in term of spell ability and use addspell function (which im sure working)
User avatar
Tina Tupou
 
Posts: 3487
Joined: Fri Mar 09, 2007 4:37 pm

Post » Tue Jun 19, 2012 2:48 am

Another possibility... and I haven't thought it through since I just realized it... is to script an unnoticeable ward spell to activate whenever an actor blocks. In the CK, there is a Collision Layer list under Miscellaneous. You could add "L_Projectile" to the "L_Ward" list.

I've never played with them, but if it acts how I think it would, it would cause arrows to stop when it hits the invisible ward. Of course, it may do odd things like cause the arrow to float in mid-air :-P

I'm still trying to figure out how to tap into the perk's ability to modify settings and values so you could script such things instead. Personally, I plan on using an "IsBlocking" in a script's If Statement for my mod. Hopefully it will do what I want it to :-P
User avatar
Jack Moves
 
Posts: 3367
Joined: Wed Jun 27, 2007 7:51 am

Post » Mon Jun 18, 2012 7:00 pm

Ok, 2nd attempt :tongue: (you made me feel quite guilty spookyfx)

This approach is a lot more promising. You can create a spell, or an ability. Then, you create a new Magic Effect instance and link it to the spell/ability you just created.
Under Magic Effect window, there is an option called 'Perk to Apply', where you can select whatever perk you want to apply to this spell during its effect duration

http://www.creationkit.com/Magic_Effect#Base_Data
Look for 'Perk to Apply'

Once you link the Perk you want to that spell/ability, what left is to call Addspell on whatever actor you wish to have the perk. Im quite positive that addspell works on any actors. Which I already tested on my horse.
User avatar
Kelly Osbourne Kelly
 
Posts: 3426
Joined: Sun Nov 05, 2006 6:56 pm

Post » Tue Jun 19, 2012 8:57 am

Ok, 2nd attempt :tongue: (you made me feel quite guilty spookyfx)

This approach is a lot more promising. You can create a spell, or an ability. Then, you create a new Magic Effect instance and link it to the spell/ability you just created.
Under Magic Effect window, there is an option called 'Perk to Apply', where you can select whatever perk you want to apply to this spell during its effect duration

http://www.creationkit.com/Magic_Effect#Base_Data
Look for 'Perk to Apply'

Once you link the Perk you want to that spell/ability, what left is to call Addspell on whatever actor you wish to have the perk. Im quite positive that addspell works on any actors. Which I already tested on my horse.

I've already tested this with a perk which is supposed to show bright flame effects, and a perk which is supposed to reduce all incoming damage to 0 (those effects because they can easily be tested), both through the AddPerk function and through what you said, a spell with a magic effect with ''Perk to Apply''. Both methods only work on the player. Also, what you said earlier about making just a spell which simulates what the perk does.. I think that's hard to do in the case of the Deflect Arrows perk, because it's effects are pretty much hardcoded.

Another possibility... and I haven't thought it through since I just realized it... is to script an unnoticeable ward spell to activate whenever an actor blocks. In the CK, there is a Collision Layer list under Miscellaneous. You could add "L_Projectile" to the "L_Ward" list.

I've never played with them, but if it acts how I think it would, it would cause arrows to stop when it hits the invisible ward. Of course, it may do odd things like cause the arrow to float in mid-air :-P

I'm still trying to figure out how to tap into the perk's ability to modify settings and values so you could script such things instead. Personally, I plan on using an "IsBlocking" in a script's If Statement for my mod. Hopefully it will do what I want it to :-P

That does sound like an interesting idea... if it works it's of course only for the deflect arrows perk and not any other perks, but it might help spooky if it works :P

On second part you said what you're planning to do, that's not gonna work. First of all, ''IsBlocking'' is a function which only exists for conditions (conditions you can apply to spells, perks, magic effects, quests etc) and the console. It can't be used in Papyrus Scripts and there is no Papyrus variant either. Secondly, if the function had existed, it would return true if a target was performing the block animation, not necessarily only if he actually blocked. So if an enemy would turn his back on the player and block, and the player hit him in the back, IsBlocking would return true.

Now what would work would be to attach a script to the actor using an OnHit event. One of the parameters of an OnHit event is a boolean abHitBlocked, which is true if the hit was really actually blocked.
User avatar
Anthony Santillan
 
Posts: 3461
Joined: Sun Jul 01, 2007 6:42 am

Post » Tue Jun 19, 2012 4:25 am

THANKS!

That will work I think. But it is another example of how I will be adding HELL of a lot of abilities scripts to all actors to get all the combat features I did in Oblivion to work in Skyrim...


Ok, 2nd attempt :tongue: (you made me feel quite guilty spookyfx)


This approach is a lot more promising. You can create a spell, or an ability. Then, you create a new Magic Effect instance and link it to the spell/ability you just created.
Under Magic Effect window, there is an option called 'Perk to Apply', where you can select whatever perk you want to apply to this spell during its effect duration

http://www.creationkit.com/Magic_Effect#Base_Data
Look for 'Perk to Apply'

Once you link the Perk you want to that spell/ability, what left is to call Addspell on whatever actor you wish to have the perk. Im quite positive that addspell works on any actors. Which I already tested on my horse.
User avatar
DAVId MArtInez
 
Posts: 3410
Joined: Fri Aug 10, 2007 1:16 am

Post » Mon Jun 18, 2012 7:06 pm

Well, that mysterious stranger is mistaken, unfortunately. There are only 2 entities in the whole game that starts off with that 'targe of blood' perk. One is the player and the other one is the original owner of the shield - Umana or something. With that said, any other NPC who 'happens' to equip Targe Of Blood shield will not have access to that 'bleeding effect'

Mysterious stranger here. I'm not sure you're entirely correct about only those 2 actors starting off with the targe of the blooded perk, how did you determine this exactly?

In any case, I was able to modify a speed perk to apply when a two-handed weapon is equipped and this appeared to apply to the stormcloaks and guards hitting me with their warhammers and greatswords (unless my eyes deceive me). More testing is required on my part to make sure that other things aren't happening instead and to make sure that the perk is actually affecting the speed of weapon strikes by using extreme values at either end (after several minutes' observation, it was hard to remember the vanilla speed).

The key is controlling it. You appear to have two ways of applying an effect to a perk: Ability vs. EntryPoint.

A perk with an Ability looks to have less control than one with a more defined EntryPoint, as you cannot apply a condition to when the effect kicks in (it's 'always on'). These thus need to be defined in the perks access conditions instead, and unfortunately these appear to be more limited to what you can set in the entrypoint. The disadvantage with an EntryPoint, however, is that you have to select from a predetermined list (e.g. ApplyBashingSpell, ModAttackDamage etc.) and hope there's an item that gives you the arguments you want.
User avatar
Lucky Girl
 
Posts: 3486
Joined: Wed Jun 06, 2007 4:14 pm

Post » Mon Jun 18, 2012 6:25 pm

I've already tested this with a perk which is supposed to show bright flame effects, and a perk which is supposed to reduce all incoming damage to 0 (those effects because they can easily be tested), both through the AddPerk function and through what you said, a spell with a magic effect with ''Perk to Apply''. Both methods only work on the player. Also, what you said earlier about making just a spell which simulates what the perk does.. I think that's hard to do in the case of the Deflect Arrows perk, because it's effects are pretty much hardcoded.



That does sound like an interesting idea... if it works it's of course only for the deflect arrows perk and not any other perks, but it might help spooky if it works :tongue:

On second part you said what you're planning to do, that's not gonna work. First of all, ''IsBlocking'' is a function which only exists for conditions (conditions you can apply to spells, perks, magic effects, quests etc) and the console. It can't be used in Papyrus Scripts and there is no Papyrus variant either. Secondly, if the function had existed, it would return true if a target was performing the block animation, not necessarily only if he actually blocked. So if an enemy would turn his back on the player and block, and the player hit him in the back, IsBlocking would return true.

Now what would work would be to attach a script to the actor using an OnHit event. One of the parameters of an OnHit event is a boolean abHitBlocked, which is true if the hit was really actually blocked.

I would have thought IsBlocking would be a property, not a function...something like Game.GetPlayer().IsBlocking or TargetActor.IsBlocking
User avatar
Kelly Osbourne Kelly
 
Posts: 3426
Joined: Sun Nov 05, 2006 6:56 pm

Post » Tue Jun 19, 2012 2:00 am

On second part you said what you're planning to do, that's not gonna work. First of all, ''IsBlocking'' is a function which only exists for conditions (conditions you can apply to spells, perks, magic effects, quests etc) and the console. It can't be used in Papyrus Scripts and there is no Papyrus variant either. Secondly, if the function had existed, it would return true if a target was performing the block animation, not necessarily only if he actually blocked. So if an enemy would turn his back on the player and block, and the player hit him in the back, IsBlocking would return true.

Yeah, I was afraid of that. I do wish that scripts could have the same abilities and functions that perks and conditions have.

I also found out that last part in earlier conditional attempts, haha! No matter what angle I attacked a target from, as long as they were blocking, the condition still took effect. I actually tried to rig it (somewhat successfully) by also adding the condition "GetLineOfSight"

Haha, it still wasn't to my liking, though :-P


One of the parameters of an OnHit event is a boolean abHitBlocked, which is true if the hit was really actually blocked.

Now THAT is VERY helpful! Thank you so much! I actually can't think of many reasons to use "IsBlocking" if I can use "abHitBlocked" instead... maybe to be able to move faster while blocking, but not much else.

Thank you again! :-D
User avatar
Matt Terry
 
Posts: 3453
Joined: Sun May 13, 2007 10:58 am

Next

Return to V - Skyrim