PDA

View Full Version : Scripting a Force Power Check


Exile007
02-28-2009, 10:50 PM
I've been looking at some of the files in the K1 Star Forge Observation Platform to see what scripts were used to create the check in which the player casts a Force Power at one of the Captured Jedi. The game then checks if the force power was a strong one (Lightning, Drain Life, etc.) and if so, destroys the Captured Jedi.

Unfortunately, DeNCS is not able to decompile the script (k_psta_castat). So I was wondering if anyone here could possibly re-create the script or suggest some methods of creating a similar effect.

Thanks in advance for any help give. :)

Star Admiral
03-01-2009, 02:18 AM
You could try something like this:

void main() {
int nSpell = GetLastSpell();
if( nSpell == xxx ) {
AssignCommand( OBJECT_SELF, ClearAllActions() );
DestroyObject( OBJECT_SELF, 0.00, FALSE, 0.00 );
}
}

xxx refers to the RowIndex of the spell, which can be found in the spells.2da file. You will need to add several of them to check for different spells. Put this script in the OnSpellCastAt category of the NPC/placeable.

- Star Admiral