Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Script issue with ActionCastSpellAtObject()

Page: 1 of 1
 JoFlashStudios
05-10-2011, 9:52 PM
#1
I'm having some issues with a script I'm trying to make. I want to activate a number of force powers on the current character, but I'm getting some very strange behavior. After casting each spell, my character attacks itself once or twice.

http://www.largedocument.com/3c8e0a49/Untitled.png)

Does anyone know how to cast a friendly spell on yourself without becoming suicidal? :p

Here's the code:

object me = GetPartyMemberByIndex(0);
ActionCastSpellAtObject(FORCE_POWER_FORCE_ARMOR, me, 0, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
ActionCastSpellAtObject(FORCE_POWER_FORCE_IMMUNITY , me, 0, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
ActionCastSpellAtObject(FORCE_POWER_KNIGHT_SPEED, me, 0, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
 TimBob12
05-11-2011, 2:26 AM
#2
Don't know if this will affect it or not but it is better to use


object me = GetFirstPC();
 JoFlashStudios
05-11-2011, 7:44 AM
#3
I've changed it to GetFirstPC() for convention as you said, but there's no effect on the suicide attempts.
Page: 1 of 1