Jump to content

Home

Script to make a character do a feat during dialogue??


mgnails

Recommended Posts

I am setting up a fight sequence right now, but i want to know what the script is that makes a character attack something while in dialogue. Like bastilla useing the lightsaber throw feat on malak at the leviathan just before she was captured.

Link to comment
Share on other sites

The following .ncs files use that function:

 

K_END_CUT2_FGHT.NCS: 1

K_END_PLOT.NCS: 1

K_KAS_XORDIEJUHA.NCS: 1

K_PDAN_ROMANCE46.NCS: 1

K_PEND_CAMERA.NCS: 2

K_PEND_CUT1_1.NCS: 3

K_PEND_CUT1_2.NCS: 2

K_PEND_CUT1_3.NCS: 3

K_PEND_CUT2_1.NCS: 2

K_PEND_CUT2_2.NCS: 3

K_PEND_CUT2_3.NCS: 2

K_PEND_EXPLOSION.NCS: 2

K_PEND_JUMP.NCS: 6

K_PEND_ROOM5_02.NCS: 2

K_PEND_UD_CUT2.NCS: 1

K_PLEV_BASTATK.NCS: 1

K_PLEV_CARTHATK.NCS: 1

K_PLEV_FINALE2.NCS: 1

K_PLEV_JUCS2.NCS: 1

K_PMAN_27_SITH_D.NCS: 3

K_PMAN_PLAYER42.NCS: 1

K_PSTA_BASTATK.NCS: 1

K_PSTA_PCATK.NCS: 1

K_PTAR_BASTESC0.NCS: 1

K_PTAR_GANGCS1.NCS: 1

K_PTAR_GANGCS1A.NCS: 1

K_PTAR_GANGCS1B.NCS: 1

K_PTAR_MALAK2CS1.NCS: 1

K_PUNK_FIGHT03.NCS: 1

K_PUNK_FIGHT05.NCS: 1

K_PUNK_RAKATK2.NCS: 1

K_PUNK_RANCOR_UD.NCS: 3

K_STA_BASTEXE.NCS: 1

Link to comment
Share on other sites

That CutsceneAttack is pretty sensitive. Like the documentation says, you have to make sure that you call the right animation. Combat animations are found in animations.2da and referenced again in both combatanimations.2da and weaponsdischarge.2da. If you get the wrong animation, the NPC will perform an attack animation, but not a real attack.

 

I was able to get Trask to shoot me during the Endar Spire dialog.

 

To try this out, download these files. Start a new game and after the opening dialog, before you put on your clothes, talk to Trask again and ask him to repeat himself.

Link to comment
Share on other sites

This is an example of force lightning with damage. You can control the duration and the amount of damage that is caused - this one should kill the npc you are talking to-. There is certainly a more simple (and better) way to make this script (you tell me where i can cut TK) but it works.

 

void main()

{

ActionPauseConversation();

 

AssignCommand(GetFirstPC(), ActionCastFakeSpellAtObject(FORCE_POWER_LIGHTNING, OBJECT_SELF));

 

float fDuration = 5.0f;

float fSpeed = 1.0f;

ActionPlayAnimation(ANIMATION_LOOPING_DEAD, fSpeed, fDuration);

 

object oPC = GetPCSpeaker();

 

effect eEffect;

eEffect = EffectDamage(200, DAMAGE_TYPE_DARK_SIDE, DAMAGE_POWER_PLUS_FIVE);

 

ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, OBJECT_SELF);

 

object oTarget;

oTarget = OBJECT_SELF;

 

int nInt;

nInt = GetObjectType(oTarget);

 

if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_PRO_LIGHTNING_L), oTarget);

else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_PRO_LIGHTNING_L), GetLocation(oTarget));

ActionResumeConversation();

}

Link to comment
Share on other sites

Heh heh heh. Kill 'em all Darth333!

 

Yes that script should work fine. At your request it could be slimmed to this:

void main() {
ActionPauseConversation();
object oPC=GetPCSpeaker();
effect eDamage= EffectDamage(200, DAMAGE_TYPE_DARK_SIDE, DAMAGE_POWER_PLUS_FIVE);
AssignCommand(oPC, ActionCastFakeSpellAtObject(FORCE_POWER_LIGHTNING, OBJECT_SELF));
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_PRO_LIGHTNING_L), OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, OBJECT_SELF);
ActionPlayAnimation(ANIMATION_LOOPING_DEAD, 1.0, 5.0);
ActionResumeConversation();    // yeah right :-)
}

Link to comment
Share on other sites

I think it would depend on the feat. CutsceneAttack would be used for general attacks and ActionCastFakeSpell would be used for casting spells. If your feat has a specific animation, you could use ActionPlayAnimation and ApplyEffectToObject as necessary.

Link to comment
Share on other sites

After a quick look to the nwscript.nss i found these animations:

ANIMATION_FIREFORGET_THROW_HIGH

ANIMATION_FIREFORGET_THROW_LOW

 

Haven't tried them but i guess from the title that it's saber throw.:rolleyes:

 

There maybe some more.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...