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 a Force Power Attack on PC and partymembers

Page: 1 of 1
 Miltiades
07-09-2007, 5:30 PM
#1
I want an NPC to stun my PC and partymembers using a script. I found this (http://www.lucasforums.com/showthread.php?t=178654&highlight=script+force+power) thread, but the script needs some adjustments so that the NPC attacks the PC and the custom partymembers. Could someone help me with that?
 stoffe
07-09-2007, 6:23 PM
#2
I want an NPC to stun my PC and partymembers using a script. I found this (http://www.lucasforums.com/showthread.php?t=178654&highlight=script+force+power) thread, but the script needs some adjustments so that the NPC attacks the PC and the custom partymembers. Could someone help me with that?

Do you want the NPC to actually cast one of the standard Stun/Stasis force powers on the party like if it was in combat, or do you want to make it look like they are using a force power but really apply a scripted effect instead?
 Miltiades
07-09-2007, 6:33 PM
#3
I think the latter. What I want is when the NPC and the PC are in a conversation, after the conversation, the NPC stuns the PC and the partymembers, walks away and closes the door behind him. It's just to get the idea that the PC and the partymembers can't follow the NPC.
 stoffe
07-09-2007, 6:43 PM
#4
I think the latter. What I want is when the NPC and the PC are in a conversation, after the conversation, the NPC stuns the PC and the partymembers, walks away and closes the door behind him. It's just to get the idea that the PC and the partymembers can't follow the NPC.

The scripts in the thread you linked to should do just that if I understand you correctly. What other than that are you asking for?

If it's adapting it to be used against the whole party you could just repeat applying the stasis effect for each party member, like:



void ST_StasisParty();

void main() {
object oJedi2 = GetObjectByTag("jedi2");

AssignCommand(oJedi2, ClearAllActions());
AssignCommand(oJedi2, ActionCastFakeSpellAtObject(FORCE_POWER_HOLD, GetFirstPC()));
AssignCommand(oJedi2, ActionDoCommand( ST_StasisParty() ));
AssignCommand(oJedi2, ActionDoCommand(SetCommandable(TRUE)));
SetCommandable(FALSE, oJedi2);
}

void ST_StasisParty() {
effect eStasis = EffectCutSceneParalyze();
eStasis = EffectLinkEffects(eStasis, EffectVisualEffect(VFX_DUR_HOLD));
int iIdx;
for (iIdx = 0; iIdx < GetPartyMemberCount(); iIdx++) {
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eStasis, GetPartyMemberByIndex(iIdx));
}
}
 Miltiades
07-09-2007, 6:55 PM
#5
The problem is that I want the NPC to stun the partymembers who're with the PC, whomever they are. In the module I'm working in, you can choose who you take with you. So I can't just fill in a name if (s)he isn't with the PC.

For example, if I fill in Atton and Visas as the tags in the script, and I haven't chosen them for this trip, then the partymembers I did took with me won't be stunned.

Edit: Ah, I'll try that script you added.
 Miltiades
07-09-2007, 7:22 PM
#6
It doesn't work. The NPC doesn't do anything after the conversation. I've filled in the name of the script into the script field of an empty entry node, after an entry node with text. Anything I may have missed?
 stoffe
07-09-2007, 11:00 PM
#7
It doesn't work. The NPC doesn't do anything after the conversation. I've filled in the name of the script into the script field of an empty entry node, after an entry node with text. Anything I may have missed?

Did you change the tag in the script to the tag of the NPC that should use the "force power" on the party?
 Miltiades
07-10-2007, 7:58 AM
#8
Yes, I did. Are there any other things I should do in the that specific entry node?
Page: 1 of 1