agent0002 Posted June 18, 2007 Share Posted June 18, 2007 i'm not all that great at scripting, but i give it my best shot. what the goal of the script that i need help with is to take the health of whatever the player is fighting, and give or take some of it, modifying the NPC's total hp. (This is so it won't take exactly 5 hits to kill every scamp when youre level 3) i am using obse obviously. what part i specifically need help with is getting it to start at the right time. here's what i did by myself: scn 00randomizinghealth short newhealthshort oldhealthref NPCref Begin OnStartCombat //i think this is the problem set NPCref to player.getattacked //or this is set oldhealth to NPCref.getactorvalue health set newhealth to (rand -3 3) * (.1*oldhealth) if newhealth || 0 NPCref.modactorvalue health newhealth endifend --------------------------------------------------------------------scn 00addRandomizeeffect //i don't think there's anything wrong with this, //this is just to add the effect to the player Begin GameMode if player.HasSpell 00randomizinghealthspell returnendif else player.addspell 00randomizinghealthspellendifend anyone that could help would be greatly appreciated Link to comment Share on other sites More sharing options...
Vagrant0 Posted June 18, 2007 Share Posted June 18, 2007 What are you attaching this script to? As this determines how you'll have to get the various references and what blocktypes to use, it is very important to know this before trying to figure out where you went wrong. Link to comment Share on other sites More sharing options...
agent0002 Posted June 18, 2007 Author Share Posted June 18, 2007 the first one is a magic script the second one is a quest script (the second one is just to add the magic ability to the player. it seems to work fine, because it did add the effect when i tested it.) Link to comment Share on other sites More sharing options...
Vagrant0 Posted June 18, 2007 Share Posted June 18, 2007 the first one is a magic scriptSo you're attaching the script as the scripted spell effect on a spell being cast on an NPC from the player, or is it being cast by other people? Or what? Not quite undersanding what you're trying to do here, maybe it's your methods for trying to accomplish this... Link to comment Share on other sites More sharing options...
agent0002 Posted June 19, 2007 Author Share Posted June 19, 2007 the script effect is run through a magic ability. there is no casting of it. when a fight starts between the player and an NPC, the script should automatically calculate the NPC's health and modify its total health by -10% to +10%. Link to comment Share on other sites More sharing options...
Vagrant0 Posted June 19, 2007 Share Posted June 19, 2007 the script effect is run through a magic ability. there is no casting of it. when a fight starts between the player and an NPC, the script should automatically calculate the NPC's health and modify its total health by -10% to +10%.Ok, so you're adding the ability to the player... And trying to do all this by trying to figure out what is attacking the player so that you can use that thing as a target for the script... This is the problem. There isn't any way of determining what is attacking the player short of having an activator which constantly moves to where the player is that casts an AoE spell to apply an effect to everything nearby. The problem with that being that it would tag everything that can be affected by spells in the area, which can create ALOT of frame loss. There simply isn't any good way to determine what is attacking the player. A better solution would probably be to attach an ability, (or several abilities of varying strength through a leveled spell list) to all the creatures. Or using OBSE to occasionally adjust one of the game settings related to calculating health of leveling creatures. The downside to the first one is that it changes alot of creatures, so would conflict with any other creature mod. The downside of the second would be that you'd still get packs of stuff with the same strength, and that it wouldn't affect things that don't have autoalculated health. Link to comment Share on other sites More sharing options...
agent0002 Posted June 19, 2007 Author Share Posted June 19, 2007 dang. the leveled lists were what i was trying to get around by writing the script :unsure: oh well. thanks for the help. the people/person that makes OBSE makes the scripting more powerful...anyone know if there's a way to contact them and request something specific be made available in the next version? (something like getting the NPC who is fighting the player...) Link to comment Share on other sites More sharing options...
Vagrant0 Posted June 19, 2007 Share Posted June 19, 2007 the people/person that makes OBSE makes the scripting more powerful...anyone know if there's a way to contact them and request something specific be made available in the next version? (something like getting the NPC who is fighting the player...)I doubt they could, or they would have by now. Which is beside the point... What you're wanting to do is really one of the more useful things about leveled lists. Leveled lists allow for randomized equipment, spawns, and spells to be used. It doesn't have to be based on levels so much as the probabilities of the result. Since creatures would spawn with those abilities already present, their health wouldn't take a sudden jump the moment they were attacked. The way you were doing it, this may have been what would happen, NPCs that aren't aggressive would be attacked by the player, and suddenly gain a significant amount of health. But really, what you're trying to do (make some variation in spawns) is already done with OOO or Frans, just in a different way. Which is probably why alot of people use them. Granted, they have been sidetracked by adding everything else they can, and have been geared more towards eliminating leveled spawns, but their goal was the same. Their solution was also the same. Link to comment Share on other sites More sharing options...
agent0002 Posted June 20, 2007 Author Share Posted June 20, 2007 what i meant by not using the leveled lists was how long it takes to edit and add all those creatures in. i was looking for a faster way to do it. Link to comment Share on other sites More sharing options...
Vagrant0 Posted June 20, 2007 Share Posted June 20, 2007 what i meant by not using the leveled lists was how long it takes to edit and add all those creatures in. i was looking for a faster way to do it.Not that complicated really... you don't have to remake the creature spawning lists, or even touch them. Just add an ability to every generic creature. The only leveled list you might have to make would be a leveled spell list containing several abilities which increase health (fortify health) in various amounts. This list then would be placed on each of those generic creatures instead of using a set ability. Really, it's less complicated to do it this way than it is to figure out the scripting that would adjust the health of the creatures. You could probably even just limit it to the creatures that spawn at low levels since by the time higher levels happen, there is usually some variation already due to how leveled creatures work. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.