Can you add "status effects" through scripts?

Post » Wed Jun 20, 2012 3:37 pm

I need to make spells that stun, paralyze, knock unconscious, etc. but these spells also require extensive scripting, and the status effects only happen under certain circumstance while the damage is unconditional. Also the durations of the paralyze are random. But, I can't seem to find the scripts that will enable me to do this.
I suppose I could import as property a 1 second 0 mana paralyze spell that get's cast by akCaster at a certain point in the MagicEffect in a while loop for whatever the duration is...




Weird requirements, I know, but go here: http://faqs.ign.com/articles/446/446922p1.html and CTRL+F for Chromatic Orb. It's the first spell I'm making for torment, and literally requires use of every single thing i've created for the game, and some things that I haven't yet thought of. I think the magic system is going to take significantly longer than the physical combat system.

Small other inquiry, do scripts like Actor.SetUnconscious() actually knock the actor out, or do they just "flag" him as unconscious for other purposes.
User avatar
Sarah Evason
 
Posts: 3507
Joined: Mon Nov 13, 2006 10:47 pm

Post » Wed Jun 20, 2012 9:54 am

You will need to make individual MGEF for the effects you want, some will need to be scripted (such as paralyze) and others can use base archetypes. Here's how I did one of my random paralyze spells

Scriptname mm_BeluaBreathOfFrostScript extends ActiveMagicEffect Spell Property mm_BeluaVampireBreathOfFrostSpell AutoGlobalVariable Property BeluaGlobalCurrentVampireLevel AutoEvent OnEffectStart(Actor akTarget, Actor caster)int VampireLevel = BeluaGlobalCurrentVampireLevel.GetValue() as Intutility.Wait(1.0)akTarget.EnableAI(false)utility.wait(Utility.RandomInt(VampireLevel,VampireLevel*2))akTarget.EnableAI(true)EndEvent

If I recall SetUnconscious is just a flag.

-MM
User avatar
Wane Peters
 
Posts: 3359
Joined: Tue Jul 31, 2007 9:34 pm

Post » Wed Jun 20, 2012 7:43 pm

Wait, paralysis is just saying EnableAI=false?
Hmm.

Here's what I've done, don't know if it works yet. I made the one second 0 mana cost paralyze/stagger spells, and then I did this:

	  int StunCounter = 0	  duration = 30 + Utility.RandomInt(0,70)	  duration = duration/6	  while  durationcounter <= duration		 DnDParalyse1Sec.Cast(mage, hitactor)		 Utility.Wait(1)		 durationcounter = durationcounter + 1	  endWhile
User avatar
laila hassan
 
Posts: 3476
Joined: Mon Oct 09, 2006 2:53 pm

Post » Wed Jun 20, 2012 6:51 pm

I think paralysis is actually SetRestrained. Toggling AI (at least in the console) prevents any animation as well.

It's been so long since I played Torment I didn't even remember what the Chromatic Orb spell does... But going by the description it shouldn't be so hard to create.

Scriptname ParalyzeEffectScript extends ActiveMagicEffectInt Property DurationMax AutoInt Property DurationMin AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)	akTarget.SetRestrained()	RegisterForSingleUpdate(Utility.RandomInt(DurationMin, DurationMax))EndEventEvent OnUpdate()	akTarget.SetRestrained(false)	Dispel()EndEvent

So just create a spell with 9 magic effects, each using the same script. Condition the effects so that they depend on the caster's level and only apply if the target is not already afflicted with a similar effect.

EDIT: Just took a look, and it's almost an exact copy of mofomojo's script. :biggrin:
User avatar
glot
 
Posts: 3297
Joined: Mon Jul 17, 2006 1:41 pm

Post » Wed Jun 20, 2012 10:31 am

Thanks guys! Also, why did you do the whole OnUpdate thing instead of just doing a Utility.Wait(Utility.RandomInt(DurationMin, DurationMax) and then SetRestrained(false) and Dispel()?
User avatar
DeeD
 
Posts: 3439
Joined: Sat Jul 14, 2007 6:50 pm

Post » Wed Jun 20, 2012 7:44 pm

There's really not much of a difference. But my way would require you to actually put in a duration for the effect while mofomojo's way doesn't. If you have hit effect shaders for your effect, and you have 'FX persists' ticked, then the NPC will show the hit effect during the duration of the spell. If you have a 0 duration effect, then even though the script doesn't finish running instantly, I don't think the hit effects stay on the whole time.
User avatar
Cat Haines
 
Posts: 3385
Joined: Fri Oct 27, 2006 9:27 am

Post » Wed Jun 20, 2012 11:28 pm

The paralyze and stun spells are "invisible" in that no visual or sound effects are associated with them. I think I'm gonna keep it the way I have it because (with the caster just continuously casting these 0 mana invisible spells during a while loop) mostly because I made it up rather than any real elegance. I may change my mind though.
User avatar
мistrєss
 
Posts: 3168
Joined: Thu Dec 14, 2006 3:13 am

Post » Wed Jun 20, 2012 6:37 pm

Cool Il Ducey. Can't wait to see your work. I hope you showcase some of it for us! :smile:

-MM

Edit: And yeah, I didn't like the way the game's Archetype for Paralysis works. Unfortunately, as RandomNoob pointed out it stops animations too, so if you go up to someone that's paralyzed and start wacking at them it looks like you're just hitting nothing...additionally, they won't go into death animations while their AI is turned off too, but there might be ways around that. I'm not sure if actors that have their AI disabled raise events until they are enabled but if you kill one while it's disabled, they will most assuredly fall down dead when the AI is enabled.

My thought for handling that, if needed, would be to add in an OnDying event to turn the AI back on, assuming the event is raised while AI is turned off. Come to think of it, I may go do that.

-MM
User avatar
Jesus Duran
 
Posts: 3444
Joined: Wed Aug 15, 2007 12:16 am

Post » Wed Jun 20, 2012 5:59 pm

I'll definitely showcase it if Redwood_Elf or anyone else help me with dungeons, but honestly my dungeon design is so unsightly that I wouldn't show anyone as it stands.

Everything else is pretty darn cool though. Time to build the magic system.
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am


Return to V - Skyrim