Page 1 of 1

[WIP] Ortorin's Auras

PostPosted: Sat Apr 06, 2013 5:14 pm
by ortorin
Current code, sorry it's un-commented.

This is the global script for detecting the spells casted and getting the right elements going.

Code: Select all
begin aura_main

       short count
       short objgate

       if ( menumode )
               return
       endif

       if ( count == 2 )
               set count to 0
               set objgate to 0
               set aura_end_obj to 1
               set aura_end_spell to 1
               return
       endif

       if ( objgate )
               placeatpc "aura_object" 1 0 0
               set objgate to 0
       endif

       if ( player->geteffect sEffectFeather )
       else
               return
       endif

       if ( player->getspelleffects aura_spell_sheild )
               player->removespelleffects aura_spell_sheild
               startscript aura_sheild
       else
               return
       endif
       set count to ( count + 1 )
       set objgate to 1
end



This code is attached to the aura object to keep it moving with the player and delete the object when nessacary.

Code: Select all
begin aura_effect_object

       float pcposx
       float pcposy
       float pcposz

       long pcref
       long objref

       short itemref

       if ( menumode )
               return
       endif

       if ( aura_end_obj )
               set aura_end_obj to 0
               disable
               setdelete 1
       endif
       return

       setx pcref to xgetref "player"
       setx objref to xgetref "aura_object"

       xsetref pcref
       set pcposx to getpos x
       xsetref pcref
       set pcposy to getpos y
       xsetref pcref       
       set pcposz to getpos z
       set pcposz to ( pcposz - 250 )

       xsetref objref
       setpos x pcposx
       xsetref objref
       setpos y pcposy
       xsetref objref
       setpos z pcposz
end


This is the spell effect code. It gets the distance between the player and the target and adds or removes the effect. (I'm gonna restructer this later for code optimization.)

Code: Select all
begin aura_sheild

       float dist
       float targposx
       float targposy
       float targposz
       float pcposx
       float pcposy
       float pcposz
       float xvar
       float yvar
       float zvar
       float dvar

       long targref
       long pcref

       short effect
       short targeffect
       short nogo
       short endaura
       short endauracount
       short globalref

       if ( menumode )
               return
       endif

       setx pcref to xgetref "player"

       if ( aura_end_spell )
               set aura_end_spell to 0
               set endaura to 1
       endif

       if ( endaura == 1 )
               set endauracount to ( endauracount + 1 )
       endif

       if ( endauracount == 11 )
               set endaura to 0
               set endauracount to 0
               stopscript aura_sheild
               return
       endif

       ifx ( targref )

               xsetref targref
               set targeffect to getspelleffects aura_spell_sheild_t
                       ;start first loop
               xsetref targref
               set targposx to getpos x
               xsetref targref
               set targposy to getpos y
               xsetref targref
               set targposz to getpos z
               xsetref pcref
               set pcposx to getpos x
               xsetref pcref
               set pcposy to getpos y
               xsetref pcref
               set pcposz to getpos z

               set xvar to ( targposx - pcposx )
               set xvar to ( xvar * xvar )
               set yvar to ( targposy - pcposy )
               set yvar to ( yvar * yvar )
               set zvar to ( targposz - pcposz )
               set zvar to ( zvar * zvar )
               set dvar to ( xvar + yvar + zvar )
               set dist to ( getsquareroot dvar )

               if ( dist <= 300 )
                       set nogo to 0
               else
                       set nogo to 1
               endif

               if ( endaura )
                       set nogo to 1
               endif

               ifx ( nogo )
                       ifx ( targeffect )
                               xsetref targref
                               removespell aura_spell_sheild_t
                       endif
               else
                       ifx ( targeffect )
                       else
                               xsetref targref
                               addspell aura_spell_sheild_t
                       endif
               endif
               setx targref to xnextref targref  
                       ;start second loop
               if ( targref == 0 )
                       return
               endif

               xsetref targref
               set targeffect to getspelleffects aura_spell_sheild_t

               xsetref targref
               set targposx to getpos x
               xsetref targref
               set targposy to getpos y
               xsetref targref
               set targposz to getpos z

               set xvar to ( targposx - pcposx )
               set xvar to ( xvar * xvar )
               set yvar to ( targposy - pcposy )
               set yvar to ( yvar * yvar )
               set zvar to ( targposz - pcposz )
               set zvar to ( zvar * zvar )
               set dvar to ( xvar + yvar + zvar )
               set dist to ( getsquareroot dvar )

               if ( dist <= 300 )
                       set nogo to 0
               else
                       set nogo to 1
               endif

               if ( endaura )
                       set nogo to 1
               endif

               ifx ( nogo )
                       ifx ( targeffect )
                               xsetref targref
                               removespell aura_spell_sheild_t
                       endif
               else
                       ifx ( targeffect )
                       else
                               xsetref targref
                               addspell aura_spell_sheild_t
                       endif
               endif
               setx targref to xnextref targref  
                       ;start third loop
               if ( targref == 0 )                               
                       return
               endif

               xsetref targref
               set targeffect to getspelleffects aura_spell_sheild_t

               xsetref targref
               set targposx to getpos x
               xsetref targref
               set targposy to getpos y
               xsetref targref
               set targposz to getpos z

               set xvar to ( targposx - pcposx )
               set xvar to ( xvar * xvar )
               set yvar to ( targposy - pcposy )
               set yvar to ( yvar * yvar )
               set zvar to ( targposz - pcposz )
               set zvar to ( zvar * zvar )
               set dvar to ( xvar + yvar + zvar )
               set dist to ( getsquareroot dvar )

               if ( dist <= 300 )
                       set nogo to 0
               else
                       set nogo to 1
               endif

               if ( endaura )
                       set nogo to 1
               endif

               ifx ( nogo )
                       ifx ( targeffect )
                               xsetref targref
                               removespell aura_spell_sheild_t
                       endif
               else
                       ifx ( targeffect )
                       else
                               xsetref targref
                               addspell aura_spell_sheild_t
                       endif
               endif
               setx targref to xnextref targref
                       ;start forth loop
               if ( targref == 0 )
                       return
               endif

               xsetref targref
               set targeffect to getspelleffects aura_spell_sheild_t

               xsetref targref
               set targposx to getpos x
               xsetref targref
               set targposy to getpos y
               xsetref targref
               set targposz to getpos z

               set xvar to ( targposx - pcposx )
               set xvar to ( xvar * xvar )
               set yvar to ( targposy - pcposy )
               set yvar to ( yvar * yvar )
               set zvar to ( targposz - pcposz )
               set zvar to ( zvar * zvar )
               set dvar to ( xvar + yvar + zvar )
               set dist to ( getsquareroot dvar )

               if ( dist <= 300 )
                       set nogo to 0
               else
                       set nogo to 1
               endif

               if ( endaura )
                       set nogo to 1
               endif

               ifx ( nogo )
                       ifx ( targeffect )
                               xsetref targref
                               removespell aura_spell_sheild_t
                       endif
               else
                       ifx ( targeffect )
                       else
                               xsetref targref
                               addspell aura_spell_sheild_t
                       endif
               endif
               setx targref to xnextref targref
                       ;start fith loop
               if ( targref == 0 )
                       return
               endif

               xsetref targref
               set targeffect to getspelleffects aura_spell_sheild_t

               xsetref targref
               set targposx to getpos x
               xsetref targref
               set targposy to getpos y
               xsetref targref
               set targposz to getpos z

               set xvar to ( targposx - pcposx )
               set xvar to ( xvar * xvar )
               set yvar to ( targposy - pcposy )
               set yvar to ( yvar * yvar )
               set zvar to ( targposz - pcposz )
               set zvar to ( zvar * zvar )
               set dvar to ( xvar + yvar + zvar )
               set dist to ( getsquareroot dvar )

               if ( dist <= 300 )
                       set nogo to 0
               else
                       set nogo to 1
               endif

               if ( endaura )
                       set nogo to 1
               endif

               ifx ( nogo )
                       ifx ( targeffect )
                               xsetref targref
                               removespell aura_spell_sheild_t
                       endif
               else
                       ifx ( targeffect )
                       else
                               xsetref targref
                               addspell aura_spell_sheild_t
                       endif
               endif
               setx targref to xnextref targref
       else
               setx targref to xfirstnpc
       endif
end

Re: [WIP] Ortorin's Auras

PostPosted: Sun Apr 07, 2013 5:46 pm
by ortorin
So I found this stupid problem with the scripting engine.  I have these two blocks of code that work perfectly fine on their own, but they cannot be in the same script. For no good reason as far as I can tell.

The conflicting functions are (xGetPcTarget) and (GetEffect and/or GetSpellEffects)...
Watch out for this, it's caused me some pain in testing.

Oh well... See... I need both of them to be running at the same time, I'm gonna have to get creative with some target scripts I believe. Once I get these two functions playing nice with eachother, I'll have made a very "hamfisted" way of moving the aura through doors and mysticism based teleport spells.

Currentlty I just turn the aura off when the player looks at a door. The aura comes back once you look away or go through. Honestly, without looking for it, it's hard to notice, I mean... you're looking at a door anyways, you can't SEE the aura (you gotta know where to look). That is achieved though the xGetPcTarget function.

long crosshair
long door
short doonce


setx crosshair to xgetpctarget                           ;xgetpctargref get the id of the object the player has in his crosshairs that he can activate
setx door to crosshair->xreftype                  ;you then look up what type of object it is  
if ( door == 1380929348 )                           ;and see if it's a door (the referance number for door)
       if ( doonce == 0 )               
               set aura_end_obj to 1                   ;disable and delete the object
               set doonce to 1                                ;when the player looks at a door
       endif
else
       if ( doonce )
               set objgate to 1                            ;turn on the object when you stop looking at the door
               set doonce to 0
       endif
endif

Now, my way of making the mysticism based teleport script to work is even more "hamfisted" than the doors. I get the spell effects on the player than wait until sound of the player taking a step plays. I'm doing this to get around Mel Teleport. That menu pops up and that screws with my setup. I had to pick something that wouldn't happen until after the player clicked his choice to test for and tell the script that you are now on the other side (or just exited the menu).

Here's the bitch, you can't reliably get the fact that you just changed cells in any fashion of the functions. My next logical option was sound detection. What is a surefire sound that will be played no matter what soon after a teleport???? A footstep by the player! So yeah, that makes a block of code dedicated to feet. lol

short teleport
short sound
short objgate

if (player->geteffect sEffectRecall )                                           ;Start off figuring out if the player just cast recall
               set teleport to 1                                                       ; Then disable and delete the object
               set aura_end_obj to 1
       endif

       if ( teleport )
               if ( player->getsoundplaying "footbareright" )                        ;All of this is me waiting for the first footstep taken,
                       set sound to 1                                                             ; I'm gonna add the left foot in soon, lol
               endif
               if ( player->getsoundplaying "footheavyright" )
                       set sound to 1
               endif
               if ( player->getsoundplaying "footlightright" )
                       set sound to 1
               endif
               if ( player->getsoundplaying "footmedright" )
                       set sound to 1
               endif
               if ( player->getsoundplaying "footwaterright" )
                       set sound to 1
               endif

               if ( sound )                                                       ; Finally, turn the object back on
                       set sound to 0               
                       set objgate to 1
                       set teleport to 0
               else
                       return       
               endif
       endif

Well, class over. I'm gonna go back to work.


Edit, 5 hours later.... still eluding me...

Re: [WIP] Ortorin's Auras

PostPosted: Mon Apr 08, 2013 12:42 pm
by ortorin
Here is the project at its current point. All core mechanics should be in place. Use player->addspell aura_spell_sheild to get the test aura. The test aura only works on NPCs that are not attacking the player.

Please tell me of any bugs you find!
MWSE dependant.


Re: [WIP] Ortorin's Auras

PostPosted: Tue Apr 09, 2013 10:42 am
by ortorin
Today's todo list: (by today I mean when I decided to do it)
*done*Get the magicka drain working
Create 10 basic auras
Start one scripted effect aura (I'm thinking about projectile deflection and an anti-magic field)
Make my first aura augmentation ring. (Double aura range at the cost of a ring slot.)


Listening to: Bassnectar

Re: [WIP] Ortorin's Auras

PostPosted: Tue Apr 09, 2013 9:23 pm
by ortorin
Special Request!
I'm looking for new and interesting ideas for aura spells and spells in general. Anything I use will be credited in the mod. Help a brother out and post up your ideas!

Re: [WIP] Ortorin's Auras

PostPosted: Fri Apr 12, 2013 10:59 am
by ortorin
Perfection! (or as close to it as I can get)

All core mechanics are FINALLY complete.
When the player runs out of magicka the aura turns off.
When the player looks at a door the aura pauses. The aura turns back on when no longer looking at a door.
When the player uses mysticism based teleportation the aura pauses. The aura turns back on at the next footstep the player takes.
When the player casts the spell twice the aura turns off, including when the two exceptions above are being handled.

The only exception I cannot handle is scripted teleportation. I'll just have to put a warning in the mod description and the readme. This leaves me with the creation of the different spell effects, implementing the spells into the game world, and the creation of augmented effects based on reagents.

The one part I am not looking forward to is balancing the spells. I've been testing with a spell that damages five mana per second, which is a really fast drain at low levels. This is based on the in-game cost for a 50 point shield spell (the effect of the aura I've been testing with.) When the time comes, I'm really going to need the input of others on the effectiveness of balancing the spells to the CS standard. Currently I believe it might be too high of a drain, but it will only be through numerous hours of combat testing that any definitive statement can be made.

I'm going to make a beta test release soon (hopefully before the end of the day). I hope that you will take some time to test out the effectiveness of my spells. I'm looking forward to working with all of you on this final, critical part of my mod's creation.

***Edit***
Sorry everyone. I was talking a big game about getting the beta released tonight, but life happened. I'll get this done as soon as I can, promise.

Re: [WIP] Ortorin's Auras

PostPosted: Sun Apr 14, 2013 6:53 am
by Crankgorilla
Nice progress. I'll be keeping tabs on this WIP. Might wait to see where you are going with this mod before offering imput as it sounds like it will be very interesting where your ideas alone will take it. But yeah, just voicing some support. All good!

Re: [WIP] Ortorin's Auras

PostPosted: Sun Apr 14, 2013 5:01 pm
by ortorin
Newest update:

I currently have 80 spells created. That's 10 "friendly" spells and 10 "enemy" spells with 4 tiers of magnitude each.

***Friendly Auras***
Shield
Haste  --Athletics and Speed
Battle  --Plus to all weapon types
Fire Shield
Frost Shield
Shock Shield
Healing
Resist Magicka
Free Movement -- Regen Fatigue, 100% resist paralysis, and feather
sanctuary

***Enemy Auras***
Fire damage
Frost damage
Shock damage
Sound
Blind
Enervation  -- Drain all weapon skills
Enfeeblement  -- Drain Str, End, and Will
Impediment   -- Drain Speed
Poison
Disintegration  -- armor and weapons


Next step is finish handling all the cell change exceptions I can in my current script. (Mage guild, silt strider, boats, papillon, something else I'm probably forgetting right now...) I'm still looking for new effects to add, I'd like your input on that idea. Also, If anyone has ever heard of script that can accurately detect cell change by the player and to get the reference to the new cell please let me know.

Re: [WIP] Ortorin's Auras

PostPosted: Mon Apr 15, 2013 6:44 am
by Spirithawke
The best way I have seen so far is to store the cell in a variable and then when the current cell do not match the variable you know cell change has occurred.

Re: [WIP] Ortorin's Auras

PostPosted: Mon Apr 15, 2013 8:56 am
by ortorin
Spirithawke wrote:The best way I have seen so far is to store the cell in a variable and then when the current cell do not match the variable you know cell change has occurred.


Ok, but so far in my tests I have yet to find a good function to do this. I tried using the xPcCellID but it was returning a different number every frame. Also, regular scripting doesn't seem to be able to detect the current cell except for in a IF statement. For example:

if ( GetPcCell "Vivec" == 1)

That's the only useage I've seen. IDK... If I get this one bit of code working than my auras would work smooth as silk no matter where the player goes or how he got there. I'll run more tests later and see if I can get this running.


Idea... I'm already moving the aura effect object to the coords of the player, maybe I can get distance and then detect a cell change that way. (The object will be left in the last cell)

Re: [WIP] Ortorin's Auras

PostPosted: Mon Apr 15, 2013 8:16 pm
by ortorin
I found an old post by Fliggerty that had the snip of code I needed to accurately detect cell change. I'll be getting this integrated into my script and when I do, there will no longer be any problems with any type of teleportation, door, travel service, or anything else that makes the player change cells! =D

All the pieces are coming together. I can't wait 'till I get to share this mod with all of you!

BTW, the problem I was experiencing with the xPcCellID was caused by the fact that I was looking at the data inside the variable through the regular messagebox. I forgot it was string data... do not make the same mistake as me. =)

Re: [WIP] Ortorin's Auras

PostPosted: Wed Apr 17, 2013 5:16 pm
by Drakkmore
OK I have gotten some of the bugs worked out on the Aura mesh. Here is a small clip of the lightning effect aura:



I have also made the Fire effect aura, and frost effect Aura.
Working on an Aura based on the Magicka Shield now. I will have screenshots to post later Ortorin

Re: [WIP] Ortorin's Auras

PostPosted: Wed Apr 17, 2013 8:23 pm
by ortorin
Awesome work dude. The only nitpick I have about it is the same as last night, it really needs to be more translucent. Think about the fact that people will be running around with the auras on for minutes at a time. If the aura is too opaque, it's gonna screw with aiming spells and bows, and generally make navigating difficult. Don't get me wrong, I like the work you've done, it's just too opaque is all.

Is the one based on the shield your idea for a general purpose aura?

Oh, one more thing... I'm starting to have second thoughts about the "sphere" concept. I'm worried about the line of sight issue like I said above. Truly I would like "lines" that move around without the "inside a soap bubble" effect.

Some pictures to illustrate my idea.

In this one, cut out all the green and it's close to the image in my head.
http://www.photo-dictionary.com/photofi ... sphere.jpg

here's an interesting thought, lines of magicka that radiate outward and then make a small "splash" at the outer limits of the aura.
http://imgs.inkfrog.com/pix/gamerlined66/E02690-8.jpg
http://www.photocase.com/stock-photos/3 ... htning.jpg

Here's a good image
http://www.starmagic.com/catalog/4441950P.JPG

I think this might be a good shape for illusion based magic
https://www.cst.com/CMS/images/article1 ... 00_542.jpg

We never really talked about the idea I had for this, it's my fault for waiting this long to say anything. In the end, as long as it's a sphere and as long as you can easily look through it I'd be happy. I'm sorry if I've cause any trouble by this.

Re: [WIP] Ortorin's Auras

PostPosted: Thu Apr 18, 2013 11:07 am
by ortorin
So Spirthawk has convinced me to take the time to do a proper release of my mod, compared to my old idea of just dumping everything on to a NPC for testing. I got some interesting ideas about how to integrate my spell effects into the game in a way that will make a skill progression system for the auras themselves. So check this;



The power of the aura is the power to connect to the life-force of all entities near the caster. This connection carries with it the will of the mage to either harm or empower those he is connected with.

For those that are a mage's foe, the magicka connection is volatile, unstable, and sometimes unpredictable. The act of destroying the life-force connected before dispelling the aura creates even more turmoil in the magicka built up in the body of the target. The results of this event can be benign, simply dissipating as if it was never there. There is one event that can happen that is most interesting though. As the malevolent magics try to find equilibrium after the severance from a life-force, it is possible for the magicka to condense itself into a material form.

The crystals created by this process are used to empower the mage's aura casting strength. With enough crystals utilized in the process of spell research, new and more powerful spells can be unlocked in the mind of the mage. The mage can also wield these crystals as reagents in the casting of an aura to augment the effects in different ways.



I hope you like that little teaser about the mod's direction. This is just the tip of the iceberg, there are many more features planned and still in planning to come. I don't want to spoil too much about my ideas since learning in-game is always the most fun IMO. Thanks for reading, stay tuned for more updates.  :D

Re: [WIP] Ortorin's Auras

PostPosted: Wed Apr 24, 2013 12:15 pm
by ortorin
So I got a little burnt out after nearly a month straight of working on this project. I'll be back at it later.

Re: [WIP] Ortorin's Auras

PostPosted: Sun Apr 28, 2013 5:27 pm
by ortorin
It's gonna be another 3-4 weeks before I'm back around these forums because I'm moving to a new place. I will be back, I'm not gonna let my project die.

Re: [WIP] Ortorin's Auras

PostPosted: Mon May 27, 2013 5:36 pm
by ortorin
I'm releasing my mod as is for now on here. I hope to get back to it and make some more content, but I don't have the time right now. If anyone else wants to mess around with this or use anything I've made, then go ahead.



There are 80 spells that you'll need to use the console to add. All cell change should be handled. There have been crashes with some of the spells. If anyone could fix those crashes then awesome =).

Anyways, enjoy it if you can, I'll work on it again later.

***NOTE*** The meshes I used with the auras were made by Drakkmore. You cannot use them for anything other than playing/testing this mod. You may not re-release them in another mod.

Re: [WIP] Ortorin's Auras

PostPosted: Tue May 28, 2013 2:01 am
by Spirithawke
*scratches head* hmm...don't we need the mesh(es) Drakkmore was working on to go with that esp?

Re: [WIP] Ortorin's Auras

PostPosted: Tue May 28, 2013 12:26 pm
by Melchior Dahrk
This sounds like a very interesting mod. Having auras would go really well with having companions.

Enjoy your break though, we all need them now and then!

Re: [WIP] Ortorin's Auras

PostPosted: Tue May 28, 2013 3:26 pm
by Drakkmore
When loaded in the CS does it bring up errors?
I have not checked this out at all as I'm no scripter.
However I assume you would need something with the ID names at the very least any mesh could be substituted, but my meshes were mad just for this.
How ever Ortorin did not have my permission to give others permission to use the meshes, and textures as they see fit.
I'm not even certain that he used the meshes I made, as towards the end of my mesh making for him, he was starting to not like my meshes, and wanted something completely different from what I did for him.

Re: [WIP] Ortorin's Auras

PostPosted: Tue May 28, 2013 5:00 pm
by ortorin
Dude, sorry, I forgot about the meshes. I'll remove them from the download if you wish. (BTW, the only mesh in this download is your first "soap-bubble" mesh.)

There are no errors in the CS. The crashes were experienced with the healing auras iirc.


ALSO... I don't necessarily dislike your meshes Drakk, I just have a different vision in my head. What you did works great and I'm happy to use them in my mod.

Re: [WIP] Ortorin's Auras

PostPosted: Tue May 28, 2013 8:29 pm
by Drakkmore
When I downloaded it earlier today (same time I had made my post), the meshes were not included in the download.  The only thing in there was the esp.
I never meant to say that you couldn't include them, but I was putting it as maybe a reason toy did not include them.
You can include them if you want, but credit where it is due is all I ask.

Re: [WIP] Ortorin's Auras

PostPosted: Fri Jun 14, 2013 9:15 pm
by ortorin
I'm not dead yet... in case anyone was wondering.

Re: [WIP] Ortorin's Auras

PostPosted: Tue Feb 10, 2015 12:22 pm
by ortorin
So!
Presenting ---Ort Sort---


I've done a little work over the last few months. My latest project was an improvement of the alchemy sorter systems. New features include:
-The ability to view the ingredient's effects when looking at the chest.
-Pop-up message of the quantity of items in the container.
-One click pulls everything out of the container if there is something within, puts everything in your inventory into the container if the container is empty.
-The main sorter chest now has some new tricks-
--All in/ all out
--view all contents
--(w.i.p.) Displays total number of ingredients in the containers

Any other ideas for improvement let me know... The current system is gonna be a cool boost as is. =P