CommandoBrando Posted January 7, 2008 Share Posted January 7, 2008 I was having problems with some script for a spell im trying to get working properly and I figured maybe one of you guys have used it before in one of your mods. I dug around both on the cs and online and basically came up with what I thought was right however it does not seem to work so well: scriptname test ref victimref Begin ScriptEffectStartset victimref to GetSelf If GetSelf (IsActor ==1) victimref.getinfaction test1 endifend Begin ScriptEffectFinishEnd The reason I need this is because I tried using a comman humanoid spell but that goes away when i use the "moveto" script so im using this in conjunction with a follow script (which i have a feeling isnt working yet either) to perminatly change their ai to make what would be the equivalant of the comman humanoid spell. Any help with this script or other possible ways around this would be much appreaciated. Link to comment Share on other sites More sharing options...
Vagrant0 Posted January 7, 2008 Share Posted January 7, 2008 I was having problems with some script for a spell im trying to get working properly and I figured maybe one of you guys have used it before in one of your mods. I dug around both on the cs and online and basically came up with what I thought was right however it does not seem to work so well: scriptname test ref victimref Begin ScriptEffectStartset victimref to GetSelf If GetSelf (IsActor ==1) victimref.getinfaction test1 endifend Begin ScriptEffectFinishEnd The reason I need this is because I tried using a comman humanoid spell but that goes away when i use the "moveto" script so im using this in conjunction with a follow script (which i have a feeling isnt working yet either) to perminatly change their ai to make what would be the equivalant of the comman humanoid spell. Any help with this script or other possible ways around this would be much appreaciated. Getinfaction is just used to detect if the actor is in the faction for use in conditions. It doesn't add them to the faction. I assume that you're trying to use the faction ranks stored on the NPC to determine what packages will be used by that NPC. Meaning a paired ability which is added to the NPC at some point which is scripted to force a package on the NPC based on their faction rank. Allowing for the NPC to be controlled by adjusting their faction ranks through some other means (like another spell, activation, or dialogues). If that is the case, then you will want to have the follow packaging set to use rank 1, have a wait package set to use rank 2. You will need to leave rank 0 as doing nothing so that if that NPC is something duplicated any duplicates will not also be following you. To add an NPC to a faction, the function you want is "setfactionrank". You will initially want to set it to 0, and then use modfactionrank to set their rank to 1. Modfaction rank has a nice effect since it doesn't change the rank for all copies of that NPC, but changes it for just that actor. You will of course want to use "setfactionrank -1" at some point at the end so that the NPC does not remain changed. Working with an ability to control the packages, add the ability to the NPC within the initial spell, and remove the ability when you remove their faction. Hopefully this helps. Link to comment Share on other sites More sharing options...
Vagrant0 Posted January 9, 2008 Share Posted January 9, 2008 That deffinatly does help clear up the problem. Thanks for the explanation, I was starting to go insane cause i couldnt find a working answer online or in other cs scripts. I have another question now too that im hoping will be just as easy for you guys to answer. As I mentioned before im basically trying to remake the command humanoid spell to get around a problem I was having, so I want the script to add an AI package I made. Once again from my search online and looking at other mods and original oblivion scripts ive come to the conclusion something like this should work: scn 1TestFollow begin ScriptEffectStart addscriptpackage 0TestFollow end However, once again I seem to be wrong wrong as it does not appear to be working. The example I used was the follow spell from the hilarity mod which was this exact script except it also removed the package after a time limit but since im making npcs that will be unimportant and im expecting to die within the time limit this didnt seem to important. You guys seem to have a very good grip of this whole script thing so your much more experienced opinion is greatly appreciated.Is that script on an ability, or just a spell? If it is an ability, you would need to use addspell/removespell on the NPC. if it's an ability you would also have to make some adjustments like I had mentioned above so that the ability is removed on death, and will only trigger the follow package when there is a non-default faction rank present. If you're just looking for a simple effect that you can use on a throwaway NPC, and don't want that NPC to follow or do anything after the effect has ended, you could just use something like; scn followmespell short var1 short disp ref actor begin scripteffectstart set actor to getself set disp to actor.getdisposition player actor.moddisposition player 100 actor.stopcombat end begin scripteffectupdate actor.addscriptpackage 0TestFollow end begin scripteffectfinish actor.moddisposition player -100 actor.moddisposition player disp actor.stopcombat actor.evp endand just forget doing anything with factions. If you're using factions just to change the disposition toward the player, and not for any internal logic, this will end up backfiring on you in cases of an NPC which is cloned (like dremora) since that faction gets added to all copies of that NPC, and while they are part of the faction, you can actually get a bounty for attacking them. Link to comment Share on other sites More sharing options...
CommandoBrando Posted January 9, 2008 Author Share Posted January 9, 2008 That deffinatly does help clear up the problem. Thanks for the explanation, I was starting to go insane cause i couldnt find a working answer online or in other cs scripts. I have another question now too that im hoping will be just as easy for you guys to answer. As I mentioned before im basically trying to remake the command humanoid spell to get around a problem I was having, so I want the script to add an AI package I made. Once again from my search online and looking at other mods and original oblivion scripts ive come to the conclusion something like this should work: scn 1TestFollow begin ScriptEffectStart addscriptpackage 0TestFollow end However, once again I seem to be wrong wrong as it does not appear to be working. The example I used was the follow spell from the hilarity mod which was this exact script except it also removed the package after a time limit but since im making npcs that will be unimportant and im expecting to die within the time limit this didnt seem to important. You guys seem to have a very good grip of this whole script thing so your much more experienced opinion is greatly appreciated.Is that script on an ability, or just a spell? If it is an ability, you would need to use addspell/removespell on the NPC. if it's an ability you would also have to make some adjustments like I had mentioned above so that the ability is removed on death, and will only trigger the follow package when there is a non-default faction rank present. If you're just looking for a simple effect that you can use on a throwaway NPC, and don't want that NPC to follow or do anything after the effect has ended, you could just use something like; scn followmespell short var1 short disp ref actor begin scripteffectstart set actor to getself set disp to actor.getdisposition player actor.moddisposition player 100 actor.stopcombat end begin scripteffectupdate actor.addscriptpackage 0TestFollow end begin scripteffectfinish actor.moddisposition player -100 actor.moddisposition player disp actor.stopcombat actor.evp endand just forget doing anything with factions. If you're using factions just to change the disposition toward the player, and not for any internal logic, this will end up backfiring on you in cases of an NPC which is cloned (like dremora) since that faction gets added to all copies of that NPC, and while they are part of the faction, you can actually get a bounty for attacking them. Alright im starting to feel rather stupid cause im still running into problems even tho youve pretty much handed me all the script. Im sure this is probably getting kind of annoying but if you dont mind me asking, how would I go about getting the id of the npc who is casting a target spell. The idea is that im giving this spell to an npc who goes into town once a day and basically attacks people with this spell, a portion of them are transported back to her hideout with her and a portion stay in the town but are still effected by this spell and will therefore attack the player. Now the new problem is that I need to modify the disposition of the caster to dislike the target. Im adding this to the script that you posted in your last reply so that when the caster hits the target it will make both the caster and the target dislike the player -100 and like each other 100. Once again chances are theres a much easier solution to this problem then I think and im just confusing myself. Ive really only just started playing around with the sript in the editor so im trying to learn all that I can and so far youve been a great help however I understand if completely if you dont have time to answer my annoying little questions. Thanks for all the help Vagrant. Link to comment Share on other sites More sharing options...
Vagrant0 Posted January 9, 2008 Share Posted January 9, 2008 There is no real way to detect who has cast a spell on someone else. Which is just as well since you can't tell an unknown actor to cast a spell on random people. Essentially you need both an actor which is known, and defined in the CS, and you need a means of determining who they will be targeting in the CS. You will also need to have that known, and defined actor as part of any packages. You can't really rely on standard combat to bring about these effects since the moment that the spell is used in combat, the target will stop combat, but the actor will stay in combat. If this fight is in the middle of a town, the actor would also have every other NPC around them to fight. As this idea of yours is essentially an excuse to be able to kill off any NPC you want, or make those NPCs unnaturally aggressive, I will no longer be helping you. Mods like that can break games as NPCs which are needed for running ahops and other stuff get killed off. Link to comment Share on other sites More sharing options...
CommandoBrando Posted January 9, 2008 Author Share Posted January 9, 2008 There is no real way to detect who has cast a spell on someone else. Which is just as well since you can't tell an unknown actor to cast a spell on random people. Essentially you need both an actor which is known, and defined in the CS, and you need a means of determining who they will be targeting in the CS. You will also need to have that known, and defined actor as part of any packages. You can't really rely on standard combat to bring about these effects since the moment that the spell is used in combat, the target will stop combat, but the actor will stay in combat. If this fight is in the middle of a town, the actor would also have every other NPC around them to fight. As this idea of yours is essentially an excuse to be able to kill off any NPC you want, or make those NPCs unnaturally aggressive, I will no longer be helping you. Mods like that can break games as NPCs which are needed for running ahops and other stuff get killed off. I know that a mod like that could ruin the game which is why im not going to place the npc in the middle of a town that is already in the game. At the moment it is, but only to test the spell. I wanted to ensure this spell was actually conceivable and test it to make sure it was all in working order before i went to the effort of making a new town or two and the quest to go along with it. The idea is that this npc will travel from their hideout once a day and go to the towns i make and to cast this spell and hopefully end up building a fair sized army. The plot is supposed to envolve something along the lines of needing to find out whose doing this and where their hiding and killing them before they get too large of an army to defeat. I do however understand and also want to thank you for all you time and help. Youve saved me tonnes of trouble so thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.