Fire Resistance, Flame Shader Enemies, Script Effect Spells

Post » Tue May 10, 2011 2:00 pm

I am working on a mod to help satisfy both my hunger for a deep deep dungeon crawl with excellent rewards that are not armor, weapons and so forth that are just handed out for free.
I have taken all my favorite armors and so forth and even some races (for enemies in this dungeon) and merged them all into an esp, which became an esm, and now I am working on the esp where the dungeon exists, however I have encountered a few problems, I have a few problems that haven't arisen yet but will come up, and a few things I am just not entirely sure how to do. The three things listed above are just part of the whole. So let's start first by saying; this mod won't be released publicly...unless I care enough to actually ask every single last modder whos work has been put into this (Actually I think a couple in this mod are free to use) and I certainly don't want to do that. So if that hasn't chased you off of the topic, lets go ahead and start the list. Each of the problems or things I need help with will be in a spoiler bracket, so if one sounds interesting, just pop it open and see what I am talking about!

Complete Fire Resistance and Very Painful Fire
Spoiler


For the most part I just need confirmation to know if this idea will work, and if it doesn't if you could clarify it for me.

This is not a problem as of right now. I want a "puzzle" (if you want to call it that) where there is very painful fire...we're talking a second or less in this fire and you'll be dead. I haven't played around with fire much so I am not sure how to adjust this setting, I doubt it is that complicated so if you don't want to help with that no problem I could figure out pretty quick. But here is the catch, I want to be able to walk through that fire so long as I have the proper equipment. I would imagine the proper way of going about that would just have 100% fire resistance, but I am unsure how well that will work.



Larger Enemies with Magic Shaders

Spoiler


I figured this is pretty easy one to do. Set the enemy's scale to how i want it, then make a magic ability on self doing 0 points of damage for the shader. Well, setting the enemies scale on the enemies tab in the cs worked...sort of. After a certain point of scaling their AI seemed to glitch and they wouldn't know how to attack (It sort of depended on the enemy type. For example, since dogs/wolves are smaller by default - at the 1.0 scale - a 3.0 scale they were still capable of attacking, while enlarging a Shambles, it would loose it's AI at 3.0). I should add at this point it isn't LITERALLY loosing it's AI, it's just the AI seems to dumb down. It still followed me like it was about to attack me, but didn't ever actually attack. I am guessing this is just because it was TOO DAMN large for it to actually attack, but I was curious if there was any way around this. Also, my idea of applying the shader didn't work either. I tried making a script effect ability with no script, and use the "fire" shader and make it non hostile and have it last indefinately (0) but still that didn't work either. My only other idea of applying a shader effect would be to use a script on the creature itself, a very simple one,
"begin on gamemode
cast [a fire skill or skill with fire shader]
end"
but some how I don't think that will work.



AI Glitch in the CS and CS Patching Problem

Spoiler


Oh boy has this one been a pain in my rear end. While on the topic of AI in the game, I decided to make different enemy types out of the existing enemies in the CS (like you know how there are 3 different types of shambles?)
(I did this with 4 different enemies, but for the sake of this, let's just talk about Shambles since I think they're one of the coolest-looking enemies in the game) I just grabbed any ol' existing ID of shambles (obviously first thing changed the ID) and then modified it's stats appropriately. After a test run I thought it was interesting they just sort of stood around. So I went back into the CS and checked their AI and realized...these Shambles were the test shambles. THEY HAVE NO AI! Even worse news, I did this for ALL the enemy types I made. All 7 Shambles types I made, all 6 Skeleton types I made, ect. Goodness, I need to pay more attention to this.
Anyways, I didn't care, I figured I would just plop on any ol' AI package that most every enemy type had, adjust the responsibility, agrression, ect levels and tuh-duh a working enemy....but even ONE click on an ai package and the CS crashed. I cannot mess with AI at all without the CS crashing!
I figured perhaps I should update it...which I thought I already was. I went online and noticed a new CS patch (or it said new next to it, doesn't necessarily mean it is new) but when I ran the update it kept saying something along the lines of this: "Old File not found. However, a file of the same name was found. No update done since file contents do not match."

(I resolved the AIs for the enemies I made by completely remaking them (deleting the ones I made prior) but using the proper enemies. However, I do wish to add new enemies to the game and I do not wish to have to find some incredibly obnoxious roundabout to add proper AI)



Instant Killing (random % chance) Script dependant on % of helath and % of fatigue

Spoiler


This is just a script - something I am terribly bad at. I am trying to add a knife in as a reward in my terribly long dungeon that will instantly kill (or atleast do a lot of damage) that is based on 3 factors (as mentioned in this sections title) the percentage of health left, the percentage of fatigue left, and a random chance. I might be able to sort out the script myself if you guys could point me in the right direction, but if someone just wants to be so awesome and kind as to just write one to feed my greedy little heart, then that would be great too, of course!




Script Effect Magic
Spoiler


This section contains subsections. It works the same as the sections above. Pick a title that sounds interesting then write a response if you have an answer and feel like responding.

Freeze Movement Spell

Spoiler


I noticed a similar spell in LAME (so if worse comes to worse I can just open it up and find it) where the person the spell is cast on stops in that exact frame of animation and cannot be hurt. In fact they almost seem to loose their "physical" properties. I would like to include this in my mod.
I did find a similar spell in Midas (though I haven't tested it so I am not sure if it works the same) but it is suppose to freeze the enemy, so this is what my current script for the spell looks like:
Spoiler

scn UObMFreezeSpellref meref myBallshort spellFailshort myrestrainedshort myparalysisfloat timershort doStateshort indexshort frameskipshort frostresistshort playerDestructionbegin ScriptEffectStart; Initialize	set me to getSelf	set spellFail to 0; Check if resistant to Frost or riding horse, no effect if yes  if isSpellTarget UObMSpecialSpell002; - - Spell exempts frost test	set frostresist to 0  else     set frostresist to getav resistfrost  endifset playerDestruction to player.getav destruction set myrestrained to getrestrained	if (me.isActor == 0) || (me.getDead == 1)  || (me.isRidingHorse == 1) || ( frostresist >= playerDestruction ) || ( myRestrained == 1 ) ||  ( me == CreatureMehrunesDagon )		set spellFail to 1		return	elseif frostresist >= 100		set spellFail to 1		Message "Target Resisted Spell"		return	endIf set myparalysis to getav paralysis me.setrestrained 1 ;me.setav paralysis 1 me.Setghost 1 endbegin ScriptEffectUpdate set frameSkip to 1endbegin ScriptEffectFinish ;modav fatigue MyFatigue     if spellFail == 0	 me.Setghost 0		 me.setrestrained myrestrained	 ;me.setav paralysis myparalysis endifend



Dont give me any credit on script writing. I believe 99.9% of that is Xilver's skill. As it stands, however, this spell just stops the enemy like they have no speed. They still look at me and if I get close and still attack. Also, it tends not to work on about 70% of all the enemies. So, help would be appreciated!


% Chance Spell

Spoiler


Might as well simplify this to "How do you do a % chance script?" because there are some other things I would like to be defined by luck...actually speaking of luck, it would be nice if the script is defined literally by the players luck.
Anyways, this spell is a rather fun one, and I am proud to say I did most of the scripting on this one...but I got help from Sheogorath. I liked his spell that he casts on you when you hit him, so I decided I wanted the player to have that. Well 2 problems (one resolved) 1) It didn't work the same when the player cast it on something else. But i fixed that with this:
scn UObMDimentionHopSpellBegin ScriptEffectStart	moveto SEOopsMarker	EndIfEnd

It's a real simple script, but still, it works. but that brings me to the second problem: It works...and for that matter ALL THE TIME! That makes it one incredibly powerful spell! Any enemy that gets hit with this is gone in an instant so long as there is enough magic, which makes it a rather over powered spell. So I want to correct this with 3 things: 1: a random chance of effectiveness. 2: A result effect for failure on the player (should be easy: something like
elseifplayer.cast[painfulspell]

3: a result effect of failure to the enemy (that way it does SOMETHING to the enemy even if it isn't much).


Spells I would Like to Have, But am Okay Without

Spoiler

Teleport spell anywhere:
I know how to make a teleport spell to move to a single location, but I would like to know how to make a teleport spell using a menu. A menu asks which specified points you wish to teleport. Select it, and your off!

Radius/constant heal spell
A spell that will heal anyone within a radius around the player (that is a good guy) and will constantly heal so long as the cast button is held down. On that note about the "cast button being held down", I found a template script online that is an OBSE quest script for charging a fireball stronger and stronger by holding the cast button. So I am certain a little change in the script will allow the "so long as cast button is held" part. But the other problem is, is cancelling the cast once the player's magic has completely drained. Yes, this spell is a little more complicated than the spells above, I apologize for that.
if you are interested in that charged fireball script, here it is:
Spoiler

scn dchSCRIPT

float fquestdelaytime
short addspell
short castnow
short castdown
short iscurrentspell
float timer
long mag
long area

begin gamemode
set fquestdelaytime to 0.01

;ADD SPELL ON FIRST RUN
if addspell == 0
player.addspell dchspel
set addspell to 1
endif

;ON NEW LOAD, ENABLE CAST IF CHARGEABLE FIREBALL IS NOT CURRENT SPELL
if getgameloaded
if getplayerspell != dchspel
enablecontrol 7
return
endif
endif



;CAST NOW
if castnow == 1
tapcontrol 7
set castnow to 0
return
endif



;ENABLE CAST WHEN PLAYER SWITCHES FROM CHARGEABLE FIREBALL TO TO ANOTHER SPELL
if getplayerspell != dchspel
if iscurrentspell == 1
enablecontrol 7
set iscurrentspell to 0
endif
return
endif



if getplayerspell == dchspel

;DISABLE CAST IF PLAYER SWITCHES TO THE CHARGEABLE FIREBALL
if iscurrentspell == 0
disablecontrol 7
set iscurrentspell to 1
endif

;WHEN CAST IS PRESSED, RESET TIMER
if iscontrolpressed 7
if castdown == 0
set timer to 0
set castdown to 1
return

;WHEN CAST IS HELD DOWN, INCREASE TIMER
elseif castdown == 1
set timer to timer + getsecondspassed
return
endif

;WHEN CAST IS RELEASED, SET TIMER AND SPELL EFFECT, GOTO CAST NOW
else
if castdown == 1
if timer < 1
set timer to 1
elseif timer > 4
set timer to 4
endif

removealleffectitems dchspel
set mag to timer * 25
set area to timer * 5
addfulleffectitem fidg mag area 1 2 dchspel

set castnow to 1
set castdown to 0

endif
endif
endif
end




I think that is enough. I can't think of anything else really.

Why did I put all these questions onto this ONE topic?
Well responses on the CS forum tend to be slow, and often times my questions don't get answered, so I am hoping with a little luck I will get more questions answered faster this way.

Thank you so very much on all the help you provide!
User avatar
Ezekiel Macallister
 
Posts: 3493
Joined: Fri Jun 22, 2007 12:08 pm

Post » Tue May 10, 2011 11:39 pm

For the painful fire, you give it a script to only hit you if your not wearing an item. This script is almost like the one them game uses, only causing damage once every 3 seconds. If you want it to kill even wit 100% fire resistance, make firespell a scripted kill effect.
scn painfulfirescriptfloat fireTimershort activatedbegin onTrigger Player	if activated == 0                if player.getequipped fireproofitem		        cast firespell player		        set activated to 1		        set fireTimer to 3                endif	endifendbegin gameMode	if activated == 1		if fireTimer > 0			set fireTimer to fireTimer - getSecondsPassed		endif		if fireTimer <= 0			set activated to 0		endif			endifend


To do a shader, add a scripted ability like this:
scn mycreatureshaderbegin gamemodepms myshaderend


I know very little about AI. I can't help you there.

For the knife, you left it pretty open ended, but you would have to make it check health and fatigue and if the average of their percentage is less than a random number, kill them
scn knifeenchantmentref targetshort healthshort fatigueshort randombegin scripteffectstartset target to getselfif target.getessential == 1        returnelse        set random to getrandompercent * 75 / 99        set health to ( target.getav health ) / ( target.getbaseav health )        set fatigue to ( target.getav fatigue ) / ( target.getbaseav fatigue )        if ( ( health + fatigue ) / 2 ) < random        target.kill playerend


That should kill the target if the average percentage of their health and fatigue is less than a random number between 0 and 75, so it can only possibly kill someone with full health if they are missing half of their fatigue or more. This may be a little overpowered, since I just made up the numbers, so you could have to tweak it a bit.

The freeze spell should be simple. This might work.

scn freezescriptref targetbegin scripteffectstartset target to getselftarget.setghost 1                    ;only if you want them invincible while frozentarget.setactorsai 0target.setunconscious 1endbegin scripteffectfinishtarget.setghost 0target.setactorsai 1target.setunconscious 0end



For the % chance one, it can be like the knife spell. get a random percent, add luck divided by a number, or something like that, if it is greater than (a high number), move them. If it is less than (a low number) move an XMarker reference to the player and have it hit them with a painful spell, then be sure to move it back to a dummy cell so its not left in an oblivion gate and deleted. if its between the numbers, nothing happens.

Not quite sure what kind of teleport you want, but a Morrowind style Mark/Recall thing would just move an XMarker to you when you cast Mark and you to the marker with recall.

For a spell that heals, make a quest that checks once a second, and if your current spell is the healing aura one, disable the C key, and if you're holding cast, and your magicka is above the cost per second amount, decrease your magicka by the cost (this uses modav2, an OBSE function) and move a marker to the player to cast an area of effect a spell like this:

scn healauraref targetbegin scripteffectstartset target to getselfif target.shouldattack player == 0 && target.isincombatplayer == 0target.modav2 health (however much you want it to heal each second)endifend




I think that's about it.
User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Wed May 11, 2011 2:05 am

The enlarged monsters might not be able to attack because of their attack reach. If their collision radius is higher than their attack reach they will never get close enough to attack. They try to get close enough to the player but are blocked by their own collision. This is just a guess, but you could try to increase their attack reach and see if it helps.

Large creatures are usually not a good idea anyway, especially in dungeons. They can't follow you into narrow passages and thus it's very easy for the player to kill them. Even if they have 1000 hp and do 1000 damage per strike they're nothing but a joke if they run against a tunnel entrance that is too small for them while the player smokes a cigarette while casting flare spells at them.
User avatar
Rachel Cafferty
 
Posts: 3442
Joined: Thu Jun 22, 2006 1:48 am

Post » Tue May 10, 2011 2:33 pm

The enlarged monsters might not be able to attack because of their attack reach. If their collision radius is higher than their attack reach they will never get close enough to attack. They try to get close enough to the player but are blocked by their own collision. This is just a guess, but you could try to increase their attack reach and see if it helps.

Large creatures are usually not a good idea anyway, especially in dungeons. They can't follow you into narrow passages and thus it's very easy for the player to kill them. Even if they have 1000 hp and do 1000 damage per strike they're nothing but a joke if they run against a tunnel entrance that is too small for them while the player smokes a cigarette while casting flare spells at them.



Ha ha ha, yes, OOO seemed to have a problem with that in a few dungeons. I came across a couple of trolls that were probably .1 size too big for the door. Though they were 20 levels higher than me, I killed them.
But I realize this problem and have made large chambers for these monsters where the door locks behind the player once they enter. The rooms are huge so hopefully there should be no problem.
But thanks for your help! I will go run a test with these wonderful new changes and see what happens.
User avatar
victoria johnstone
 
Posts: 3424
Joined: Sat Oct 14, 2006 9:56 am


Return to IV - Oblivion

cron