the cast function

Post » Sat May 28, 2011 12:28 pm

The wiki says using cast on the player for a target or self spell can crash the game. Would it work to make the player cast a spell with both self and target effects on themselves to fire where they look, or would it hit them or crash? I need to force the player to perform the casting animation, but without the problems associated with playgroup on the player.
User avatar
u gone see
 
Posts: 3388
Joined: Tue Oct 02, 2007 2:53 pm

Post » Sat May 28, 2011 10:30 am

Well, you might be able to set up a script that when the player casts the particular Self spell, a dummy target is created at where he is looking, not far from the player, and a dummy caster is created just in front of the player that shoots the target. Might be an easier way to do it, though.
User avatar
Shae Munro
 
Posts: 3443
Joined: Fri Feb 23, 2007 11:32 am

Post » Sat May 28, 2011 1:03 pm

Thats similar to what I'm already doing, actually. What I want is to make an item which, as long as it is in your inventory, will make you cast a lesser power that you don't have, on target, when a certain key is pressed. What I had before would make the spell cast from in front of the player when the key is pressed, but I want it to look like the player is doing it. I could just force the player to do the cast animation,but that can get buggy, and may not line up with the actual casting.
User avatar
Cash n Class
 
Posts: 3430
Joined: Wed Jun 28, 2006 10:01 am

Post » Sat May 28, 2011 5:32 pm

Create an idle animation using the cast animation KF file.


I need to force the player to perform the casting animation, but without the problems associated with playgroup on the player.

User avatar
Ann Church
 
Posts: 3450
Joined: Sat Jul 29, 2006 7:41 pm

Post » Sat May 28, 2011 1:00 pm

good idea. how do i do that? i've never really done any modding outside the cs and obse.
User avatar
STEVI INQUE
 
Posts: 3441
Joined: Thu Nov 02, 2006 8:19 pm

Post » Sat May 28, 2011 1:31 pm

Another method you can try: when you press that certain key, you
give the power to the player (addspell or addspellns),
make it the player's current spell (selectplayerspell),
make the player cast (with tapcontrol instead of cast),
remove the power

I think the game will automatically set the player's spell to the starter healing spell if you remove the spell they have selected. In that case, you could record what spell they had active and then set it back after you do your special cast thing.
User avatar
Chris Cross Cabaret Man
 
Posts: 3301
Joined: Tue Jun 19, 2007 11:33 pm

Post » Sat May 28, 2011 8:50 am

Another method you can try: when you press that certain key, you
give the power to the player (addspell or addspellns),
make it the player's current spell (selectplayerspell),
make the player cast (with tapcontrol instead of cast),
remove the power

I think the game will automatically set the player's spell to the starter healing spell if you remove the spell they have selected. In that case, you could record what spell they had active and then set it back after you do your special cast thing.

This was my first thought as well. Pretty easy and foolproof to script. Am I misunderstanding the problem?
User avatar
KIng James
 
Posts: 3499
Joined: Wed Sep 26, 2007 2:54 pm

Post » Sat May 28, 2011 7:09 pm

No. you misunderstood, you copy the cast animation file that already exists in the game into an IDLE animation in the CS (call it MyCastAnimation or some such name).
Use a condition on the idle that is a variable (myVar) in your script.


Then you use this in your script:

if MyVar == 1
Player.pickidle 1
set MyVar to 2
elseIf player.AnimPathIncludes "MyCastAnimation" == 1 && MyVar == 2
set myVar to 0
endif


Thus as your post first requested, anytime you set your script MyVar to 1
the player will run the cast animation with no issues like with player.cast spell.


Create an idle animation using the cast animation KF file.

User avatar
Anne marie
 
Posts: 3454
Joined: Tue Jul 11, 2006 1:05 pm


Return to IV - Oblivion