Toggleabla Nighteye

Post » Sun Oct 24, 2010 4:17 am

I'm making a small Vampire Mod, With hoods which protect your from the sun and Toggleable Nighteye, I need a script on how to toggle it on and off,

Thanks.

Edit: Ops i meant, Toggleable on the Topic
User avatar
jessica Villacis
 
Posts: 3385
Joined: Tue Jan 23, 2007 2:03 pm

Post » Sat Oct 23, 2010 7:39 pm

There already is a http://www.gamesas.com/index.php?/topic/1097520-toggled-power-scripts-stuck-on/ about this, might want to take a look at it
User avatar
Eve(G)
 
Posts: 3546
Joined: Tue Oct 23, 2007 11:45 am

Post » Sat Oct 23, 2010 9:55 pm

Yes i know, I checked it but i did not fully understand it, It just shows how to toggle it off i think.
User avatar
claire ley
 
Posts: 3454
Joined: Fri Aug 04, 2006 7:48 pm

Post » Sat Oct 23, 2010 5:52 pm

Yes i know, I checked it but i did not fully understand it, It just shows how to toggle it off i think.


The script linked above (post 2) will work as long as you make the Night-Eye spell an ability. What it's saying is:

If (player) already has Night-Eye active, remove it.

Otherwise, (Night-Eye isn't active), add it.

To implement this, make two spells. One the Night-Eye ability (this is the one you will reference in the script, checking if it's active), and one a regular spell the player can cast (This is the spell you attach the script to). When the player casts the spell (begin script effect), it will toggle the ability on or off.

Hope this helps.
User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Post » Sat Oct 23, 2010 3:23 pm

Hmmm, Thanks, I've tried this

Scriptname 0VampireHuntersSight

short targetMagicka
ref casterRef

Begin ScriptEffectStart

If ( player.IsSpellTarget OmberVampireHuntersScript == 0 )
player.addSpell OmberVampireHuntersScript
else
set casterRef to Player.PlaceAtMe OmberMagickaReplenisher 1, 0, 1
casterRef.MoveTo Player 0, 0, 128
casterRef.Cast OmberRestoreMagicka Player
casterRef.disable
RemoveSpell OmberVampireHuntersScript
endif

End

Is that fine ?
User avatar
Melanie
 
Posts: 3448
Joined: Tue Dec 26, 2006 4:54 pm

Post » Sat Oct 23, 2010 1:54 pm

It seems to me that what that script will do is check to see if the Night-Eye is active, and if not, add it; but if it is active, restore magicka via the caster ref. If that's correct, then the Night-Eye won't become active. Also, it seems you're mixing up the spell and the script (adding script instead of spell) but that could be just a typo.

You might also want to create the caster ref, put him in a cell you create for him, and move him to the player, then move him back after casting. This way, there is only one caster ref, rather than one created every time the player casts the spell. I don't know if this would work for your purpose, though, as I'm not an expert on scripting.
User avatar
SamanthaLove
 
Posts: 3565
Joined: Mon Dec 11, 2006 3:54 am

Post » Sat Oct 23, 2010 9:14 pm

Hmm, Thanks but i tried the script out and it WORKED ! ;)
User avatar
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

Post » Sat Oct 23, 2010 8:14 pm

Good! I'm glad it worked. :)
User avatar
Dominic Vaughan
 
Posts: 3531
Joined: Mon May 14, 2007 1:47 pm


Return to IV - Oblivion