Jump to content

Simple Script Help!


Bergzore

Recommended Posts

I'm having a hard time getting a magic effect to work. I want a script attached to it that dispels the magic effect when the player is not sneaking. So, you have said effect applied, and when you stand up, the effect dispels.

 

I'm a nub scripter. I can usually deconstruct or modify scripts to get what I need, but this one is proving to be difficult.

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

I've tried that, but it's not working out. I've got the effect to only work out of combat and while the player is sneaking, and it does dispel when the player stands. However, if I go into combat, then kill everything and come out of combat again, the ability never works again. I'm trying to get it to reapply every time the player sneaks and is out of combat.

Link to comment
Share on other sites

For some reason, unchecking the "No Duration" box, and putting 0 as the duration fixed it. For anyone having a similar problem with perk abilities, this seems to fix stubborn magic effects that abandon the perk after the first application. I see no reason why, but hey, the CK works in mysterious ways I guess.

Link to comment
Share on other sites

I was wrong. It's not working. Here's what I'm trying to do:

 

I want a camouflage effect for when the player is sneaking, but only out of combat. I've got the perk entry point to apply the ability. The ability's conditions check to make sure the player is not in combat and he is sneaking. The effect seems to be working great at first, but if I get into combat and come out of combat again, it never works again unless I save and reload.

 

I've tried using the original "apply sneak spell" contact method, but that doesn't work either. The spell in that case stays applied even when the player stands back up, and putting a "IsSneaking" condition on it makes it not work at all, because the player is not yet considered sneaking when the effect is applied.

 

I'm stumped... Any help would be greatly appreciated.

Link to comment
Share on other sites

What I'm going to suggest MAY work. It might take some effort and research to figure out how exactly to do it. I'm not sure of all the stuff you are trying to do.

 

Create a global variable

Create the spell

-- Create a non-visual effect

-- add a script to the non-visual effect so that when the spell is cast it changes the global variable's value

Create the visual and/or sound effects

Create a dummy quest with a player alias

On the player alias add a script

The player alias script will use:

-- an OnInit() event and register for a single update cycle.

-- an OnUpdate() event that checks for the global variable value.

---- If the following match, then apply the visual and/or sound effects.

------ what the spell effect changes the global variable to

------ the player is sneaking

------ the player is not in combat

---- a failing match on those three should be set to cancel the effects if active

---- In any scenario the OnUpdate() event will re-register for a single update cycle

---- setting the update cycle time to the same length of time as the effect is probably best.

 

 

Again, it is just a theory. I know that you can have a spell trigger a global variable via an effect script and have a player alias script do or don't do things based on that global variable value. However, I am not certain if you'll be able to script the effects that you want.

Link to comment
Share on other sites

Ishara, first off, thanks so much for responding. You're very helpful in the forums. I see your name popping up to help people all over the place.

 

Second, sadly all of that is beyond my current capabilities. I'm not a scripter. I can modify some scripts using common sense and trial and error, but I couldn't write a script from scratch to save my life and I'm too damn lazy to learn lol.

 

That said, I would really like to believe there is an easier way to make this work. I don't understand why it doesn't. Are some effect archetypes just stubborn like this? Because in my Proper Combat mod, I have effects that increase attack speed with swords. The effects dispel themselves when a sword is not equipped, and reapply when a sword is equipped again. They also dispel when Elemental Fury is used, and reapply after that effect goes away. Plus, I had this stealth effect working beautifully yesterday, but it's not working all of a sudden today. Some of these effects are FRIKKING PAINS IN MY REAR! lol

Link to comment
Share on other sites

Ishara's is the best bet for certain.

 

However, try this:

 

-Make your Magic Effect a Constant, On Self effect

-DO NOT put conditions in the Magic Effect

-Make a new Ability. Not a spell or power. An Ability (hard lesson I learned)

-In your Perk, DO NOT select "Ability." Select "Apply Sneaking Spell." This automatically applies the spell ONLY if the player/perk holder is sneaking.

-This should get the cloak to apply whenever the player sneaks. Try this, make sure it works and then we can worry over the Combat part.

 

The combat part:

 

Three options here:

 

-On the Ability itself (NOT the Magic Effect, but the ability using the effect) add this condition: isincombat == 0. That SHOULD dispel the cloak effect when combat starts and reinstate if after.

 

If this does not work, try this one:

 

-On the Perk where Apply Sneaking Spell is chosen, add this condition under the Perk Owner tab: isincombat == 0. This should work.

 

If neither of these work:

 

-On the ability, change condition to: isweaponout == 0 AND isweaponmagicout == 0. This will check to make sure the player does not have any weapons, even fists, readied. If BOTH are true, you get a cloak. Not perfect, but more balanced and more reliable, since "In Combat" detection on Gamebryo is flawed beyond belief.

 

-If this does not work, placing the same two conditions, and using AND (not OR) on the Perk should work for you.

 

Hope this helps. It did work for me.

Link to comment
Share on other sites

Ishara's is the best bet for certain.

 

However, try this:

 

-Make your Magic Effect a Constant, On Self effect

-DO NOT put conditions in the Magic Effect

-Make a new Ability. Not a spell or power. An Ability (hard lesson I learned)

-In your Perk, DO NOT select "Ability." Select "Apply Sneaking Spell." This automatically applies the spell ONLY if the player/perk holder is sneaking.

-This should get the cloak to apply whenever the player sneaks. Try this, make sure it works and then we can worry over the Combat part.

 

The combat part:

 

Three options here:

 

-On the Ability itself (NOT the Magic Effect, but the ability using the effect) add this condition: isincombat == 0. That SHOULD dispel the cloak effect when combat starts and reinstate if after.

 

If this does not work, try this one:

 

-On the Perk where Apply Sneaking Spell is chosen, add this condition under the Perk Owner tab: isincombat == 0. This should work.

 

If neither of these work:

 

-On the ability, change condition to: isweaponout == 0 AND isweaponmagicout == 0. This will check to make sure the player does not have any weapons, even fists, readied. If BOTH are true, you get a cloak. Not perfect, but more balanced and more reliable, since "In Combat" detection on Gamebryo is flawed beyond belief.

 

-If this does not work, placing the same two conditions, and using AND (not OR) on the Perk should work for you.

 

Hope this helps. It did work for me.

 

Edit: Last method I know of. This may work of all else fails:

 

-In the Perk, do not choose Apply Sneak Spell. Just choose ability and select the ability to apply to the player constantly.

-Open the ability. For the Cloak effect imbedded there, add all of your conditions here. This might be the most foolproof method.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...