JimmyChooChoo Posted November 17, 2017 Share Posted November 17, 2017 I need help with a spell I plan on making but I don't know how to make it so I can toggle vampirism when I use it once to become a vampire and then again to change back I just need one bit ( if (player.isspelltarget *name* = 0) I don't know what to put where *name* is so I can make the script, if I need to use a different thing please help Link to comment Share on other sites More sharing options...
PkSanTi Posted November 17, 2017 Share Posted November 17, 2017 Well, firstly it'd be good some extra info so we can help you. Your entire script wouldn't hurt; that way we could help you in your problems with this function with some understanding of its context. If I understood right -I don't know if I did, 'cause like I said its quite difficult to know what you have planned-, you do not know what to put on the name part of the syntax of the IsSpellTarget function. I'm guessing what you want to do is to make the script know if your character is being currently affected by your spell (this is, if he is a vampire), so if he is not he becomes a vampire, and if he is, he ceases to be one. I'm also gonna guess here, but I suppose you have already created your spell and the script that makes it run properly. In which case, if both of my guessings are right, in *name* you should put your spell's ID; this is, the ID your spell has on the object window of the CS, on the Magic tree. Then again, it would had been so much easier to help you with a little bit more of clarity. Anyway, I hope I got it right. Link to comment Share on other sites More sharing options...
JimmyChooChoo Posted November 17, 2017 Author Share Posted November 17, 2017 (edited) Sorry I should have explained more. I'm trying to make it so when I'm not a vampire and I use it I will change into one and when I am a vampire it will cure me, I've successfully made a script, but it won't turn me into one (characters name is tiny by the way) Script Name AaATinysVampTogif ( vampirism100 )Player.removespell Vampirism100Player.removespell vampirism100skillsPlayer.removespell vampirism100att;and so on with vamp spells at lvl 100elsePlayer.addspell Vampirism100player.addspell Vampirism100SkillsPlayer.addspell Vampirism100att;again with the lvl 100 vampire spellssetPCVampire to 4 endifend Edited November 17, 2017 by JimmyChooChoo Link to comment Share on other sites More sharing options...
PkSanTi Posted November 17, 2017 Share Posted November 17, 2017 (edited) Hm, okey. So, I've been looking in the wiki and found this. Vampirism is actually an ActorValue that goes from 0 to 100. 100 would have the highest morphological transformation and a totally developed vampire. If you want your character to turn into a fully grown hungry deeply evil vampire, you should set his Vampire value to 100. Your spell script should look like this in general: Begin ScriptEffectStart If ( PlayerRef.IsSpellTarget *yourspell* == 1 ); this is, if you use your spell on your character If ( PlayerRef.GetVampire => 1 ); this is, if his ActorValue Vampirsm is equal or bigger than one (if he is a vampire) PlayerRef.SetActorValue Vampirisim 0 Else; this would be if he is NOT a vampire PlayerRef.ModActorValue Vampirisim +100; this is, set his Vampirism value to 100 (or the number you want) EndIfEndIf End Of course, what's next of the ; symbol on the script I wrote are notes and comments on what the script does, you do not need to copy them or use them in any way. EDIT: Is the first time I do anything with vampirism value and just the second time I do a magic spell script, so mistakes can be made. Although everything looks good in the script, if it doesn't work correctly post it here and we'll try to solve it together. Edited November 17, 2017 by PkSanTi Link to comment Share on other sites More sharing options...
JimmyChooChoo Posted November 17, 2017 Author Share Posted November 17, 2017 From what ive figured when I swapped the removespell and the addspells around it would change me into a vampire, but it will not cure me when I use it again so I have got close and I believe what you have suggested should work and I thank you as this will be much help to many people. :thumbsup: Link to comment Share on other sites More sharing options...
JimmyChooChoo Posted November 17, 2017 Author Share Posted November 17, 2017 (edited) so far no script errors just need to check in game if this works then you are sure to be a gem EDIT: ok you are most a gem I thank you infinity times and it works I really do thank you, from this hard work if I'm to upload anything including a spell to toggle things I will credit you for the script helping, again I thank you. Edited November 17, 2017 by JimmyChooChoo Link to comment Share on other sites More sharing options...
PkSanTi Posted November 17, 2017 Share Posted November 17, 2017 Please, there's no problem. No need to credit me, it was your idea and your work. Enjoy it! Link to comment Share on other sites More sharing options...
JimmyChooChoo Posted November 17, 2017 Author Share Posted November 17, 2017 If you wish to know how the script is set out then here: ScriptName (whatever you wish it to be called) Begin ScriptEffectStartif [ PlayerRef.Isspelltarget Vampirism100 ==1)player.removespell vampirism 100player.removespell vampirism100attplayer.removespell vampirismskillplayer.removespell vampireEmbraceofShadowsplayer.removespell vampireSeductionplayer.removespell vampireReignofTerrorplayer.removespell vampireHuntersSight elseplayer.addspell Vampirism100player.addspell Vampirism100attplayer.addspell vampirismskillsplayer.addspell vampireEmbraceofShadowsplayer.addspell vampireHuntersSightplayer.addspell vampireSeductionplayer.addspell vampireReignofTerrorsetPCVampire to 4 endifend Link to comment Share on other sites More sharing options...
JimmyChooChoo Posted November 17, 2017 Author Share Posted November 17, 2017 (edited) There will be reason to credit you for if you weren't here then I wouldn't have been successful with such script, so you deserve credit and as thanks I believe I will upload the file which was mainly just for me as it's named after my only character :thumbsup: Edited November 17, 2017 by JimmyChooChoo Link to comment Share on other sites More sharing options...
PkSanTi Posted November 17, 2017 Share Posted November 17, 2017 (edited) I think you're missing an If statement in your script. Wouldn't it be like this? ScriptName (whatever you wish it to be called) Begin ScriptEffectStartif [ PlayerRef.Isspelltarget Vampirism100 ==1)if ( PlayerRef.GetActorValue Vampirism => 1 ); this way it will only remove his spells when he is a vampire?player.removespell vampirism 100player.removespell vampirism100attplayer.removespell vampirismskillplayer.removespell vampireEmbraceofShadowsplayer.removespell vampireSeductionplayer.removespell vampireReignofTerrorplayer.removespell vampireHuntersSight elseplayer.addspell Vampirism100player.addspell Vampirism100attplayer.addspell vampirismskillsplayer.addspell vampireEmbraceofShadowsplayer.addspell vampireHuntersSightplayer.addspell vampireSeductionplayer.addspell vampireReignofTerrorsetPCVampire to 4 endifendif end I may be wrong, since it seems you don't use the Vampirism's Actor value, but just adding the vampire spells to the player, which would make sense if you don't want him to age. But still an If statement would be missing after the first one; one that checks that the player is already a vampire, and only then removes his powers. That way, it would be in humans language: If he is the target of your spell, If he is a vampire Remove his vampirism Else (if he is not a vampire) Make him a vampire EndIfEndIf EDIT: I was in a hurry today so I just tried to focus on the script. Regarding the credits, well, if you insist, I wont deny, since there's not much I can do about it, but I will too insist in the fact that my help was little and I don't consider it worth the honour. Thank you very much anyway. See you! Edited November 18, 2017 by PkSanTi Link to comment Share on other sites More sharing options...
Recommended Posts