Is there a way to trigger a message from a perk?

Post » Wed Jun 20, 2012 7:55 am

As the title says, is there anyway to make a perk trigger a message WITHOUT using activate? I'm thinking like when a spell hits or a sword hits etc.

Any help is sincerely appreciated.
User avatar
Tanya
 
Posts: 3358
Joined: Fri Feb 16, 2007 6:01 am

Post » Wed Jun 20, 2012 12:18 pm

Anyone have some insight? :/
User avatar
Vicky Keeler
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:03 am

Post » Wed Jun 20, 2012 3:05 pm

I am not sure what exactly you want. When should the message be triggered?

If you want a message that is triggered when the player is hit and has the perk, you can use Event OnHit and If game.getplayer().hasperk.

The easiest way to have these skills run continously is probably to create an ability that has the script attached as a permanent effect. The ability can be added to the player via a quest, I think perk scripts currently do not work at all.
User avatar
jessica breen
 
Posts: 3524
Joined: Thu Aug 03, 2006 1:04 am

Post » Wed Jun 20, 2012 1:49 pm

I think perk scripts might be like topic info scripts. Have you looked at the perk for DA04 (the elf blood collecting quest)? All it does is call some functions from the quest script.
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am

Post » Wed Jun 20, 2012 8:16 am

we really do need a better idea of what you're trying to do. If it's something solvable with a magic effect (just a place to put the code and get the events) you have a ton of options. There are some functions in the perk thing having to do with text and messages, but I don't remember what they are and I don't know if it had anything to do with actually displaying said message.
User avatar
I’m my own
 
Posts: 3344
Joined: Tue Oct 10, 2006 2:55 am

Post » Wed Jun 20, 2012 4:29 pm

Right now in one of my mods I have a quest that determines if a spell is cast under certain conditions. The perk applies the bonuses and always works, the quest however does not always trigger the message. What I would like is when the conditions are met in my perk to apply the bonuses AND display the message straight from the perk whenever the conditions are met so that it always triggers both for the exact same conditions.

The reason the quest triggers more often is because I am not able to check for a lot of things that you can in perks(I've made many topics on this subject and no one see's an issue with my code)

Edit: To clarify, I need it to be SOLELY the perk because it influences everything dynamically so I can't reference people or magic effects directly.
User avatar
Quick Draw III
 
Posts: 3372
Joined: Sat Oct 20, 2007 6:27 am

Post » Wed Jun 20, 2012 6:03 pm

A quest is usually the way to do this.
Perks do not listen to any events AFAIK (Even OnInit() did not work for me), so they cannot fire a message on certain conditions.
What exactly can you check for in perks that you cannot check in a script? About the only thing I can think of is the EP-Magic-haskeyword condition, that is somehow able to detect a spell's school (which is something spell.haskeyword cannot for some reason).
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Wed Jun 20, 2012 6:35 pm

Cronos, that specifically is why I can't. It's one of the functions you need to test for. Along with the inability to test if a spell is projecticle, which is also crucial. I was specifically wonder if there was a way to make them listen to events, or even a work around. I tried adding "apply spell bash" with a magic effect that triggered a message but even that didn't work.
User avatar
Alexx Peace
 
Posts: 3432
Joined: Thu Jul 20, 2006 5:55 pm

Post » Wed Jun 20, 2012 1:39 pm

So is this still the original question? Is it the message you're really concerned with or the effect? Does the effect not work and you really just want a debug message? Are you certain the perk is applied? If not, have you tried alternate methods to make sure it's getting to that point?
User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm

Post » Wed Jun 20, 2012 5:11 pm

The perk itself and damage is correctly displayed always. The message is sometimes not triggered when the damage is(and should have been a sneak attack). Hence why I am asking if I can do both the damage and the message through the perk somehow.
User avatar
Rachel Hall
 
Posts: 3396
Joined: Thu Jun 22, 2006 3:41 pm

Post » Wed Jun 20, 2012 5:08 am

Hmm, what Conditions exactly do you want for the message? Without knowing the specifics, its hard to say whether there is a workaround.

It seems like you can easily do one of the following:
- Have the perk start a quest, have the quest fire a message
- Have the perk add an ability to the player, have the ability fire the message.
User avatar
Danel
 
Posts: 3417
Joined: Tue Feb 27, 2007 8:35 pm

Post » Wed Jun 20, 2012 8:33 am

Maybe sometimes it's just not working quite right?

I know the perks that give you a critical strike when sprinting, or knock people over when blocking and sprinting just don't always fire. Even with bethesda defined perks, they sometimes just .... don't work. The conditions like IsSprinting, IsMoving, and movement direction related ones just lag sometimes. Maybe others do to.
User avatar
Eire Charlotta
 
Posts: 3394
Joined: Thu Nov 09, 2006 6:00 pm


Return to V - Skyrim