Aller au contenu

Photo

Cutscene: Choreograph a battle


  • Veuillez vous connecter pour répondre
40 réponses à ce sujet

#26
Pompeii69

Pompeii69
  • Members
  • 153 messages
Well I tried the solution of the custom spell found here (http://social.biowar...30570/1#7738233 ), but the 2da entries are obviously different from NWN1 v.s. NWN2, and not knowing anything about 2da files to begin with, I didn't know what else to do to attempt it. As entered in that thread, there are missing columns, so it didn't work.

I still don't know about the SetCombatOverrides(), since as I stated it appears to be more geared towards damage in an actual battle v.s. attack animations.

So I'm either going to have to figure out some kind of work around, or perhaps I should give it up as an overly ambitious goal.

#27
_Knightmare_

_Knightmare_
  • Members
  • 643 messages

Pompeii69 wrote...

In my tests, I had the speaker attack the listener, but as far as I know, there doesn't seem to be a way to interrupt it to continue with the scripting out of the scene.  Dialog will continue, but they're still duking it out.  I'll look into this custom spell solution and see what it offers.

Since my group will be trading jibes with the enemy during the course of the battle, I want to maintain as much control over the battle as I can.  (Remember, this isn't a playable mod, but a machinima attempt) Also stopping it at variousd points, having the enemy flee with the group chasing, resuming, with the resulting culmination in the battle itself.  You know, like a Spider-Man and Doc Ock battle....  LOL


You might be able to have an IPointSpeaker be the owner of the conversation. This will allow you to do stuff like call a ClearAllActions(TRUE) on the attacker which will clear it's combat state (make it stop attacking). The advantage of using the IPoint is that you then have complete control over the NPCs and nothing will cause the conversation itself to be interrupted.

#28
The Fred

The Fred
  • Members
  • 2 516 messages
No, that function doesn't let you control animations I don't think - people will just use their default ones. However, if you want, say, one guy cleaving his way through a bunch of enemy minions, it could be effective for making sure that while his attacks appear natural, they always kill his foes in one hit (as in most movies where the good guy takes 200 hits to die but can chop off all the baddies' heads just like that). I probably wouldn't use it outside of cutscenes unless you were doing something like the encounter in BG1 where Drizzt runs around killing all the gnolls in a single hit.

#29
JasonNH

JasonNH
  • Members
  • 237 messages

Pompeii69 wrote...

However, there doesn;t appear to be basic attack animation available, so staging or choreographing an entire fight sequence doesn;t seem likely. Unless there's something I'm missing (more than possible)


I realize that you have taken a different route at this point, but for future reference, you are not limited to the animations enumerated in the list that you gave. You can, in fact, play any animation that occurs in the game using the PlayCustomAnimation function. It can take a lot of trial and error to get the timing right in a scripted sequence, but good to know that you are not limited to those predefined constants.

#30
Pompeii69

Pompeii69
  • Members
  • 153 messages

JasonNH wrote...

Pompeii69 wrote...

However, there doesn;t appear to be basic attack animation available, so staging or choreographing an entire fight sequence doesn;t seem likely. Unless there's something I'm missing (more than possible)


I realize that you have taken a different route at this point, but for future reference, you are not limited to the animations enumerated in the list that you gave. You can, in fact, play any animation that occurs in the game using the PlayCustomAnimation function. It can take a lot of trial and error to get the timing right in a scripted sequence, but good to know that you are not limited to those predefined constants.



I can live with trial and error on the timing, since a cutscene (or machinima in my case) is all about timing anyway.  During a conversation, I've been using the built in event actions (ga*).  Am I correct in assuming I'm not limited to those, that I could write a script that would also be callable from within the conversation screen?

I clicked the link for PlayCustomAnimation, but is there a master list somewhere of the animations themselves?

Modifié par Pompeii69, 28 juin 2011 - 02:20 .


#31
Pompeii69

Pompeii69
  • Members
  • 153 messages

_Knightmare_ wrote...

Pompeii69 wrote...

In my tests, I had the speaker attack the listener, but as far as I know, there doesn't seem to be a way to interrupt it to continue with the scripting out of the scene.  Dialog will continue, but they're still duking it out.  I'll look into this custom spell solution and see what it offers.

Since my group will be trading jibes with the enemy during the course of the battle, I want to maintain as much control over the battle as I can.  (Remember, this isn't a playable mod, but a machinima attempt) Also stopping it at variousd points, having the enemy flee with the group chasing, resuming, with the resulting culmination in the battle itself.  You know, like a Spider-Man and Doc Ock battle....  LOL


You might be able to have an IPointSpeaker be the owner of the conversation. This will allow you to do stuff like call a ClearAllActions(TRUE) on the attacker which will clear it's combat state (make it stop attacking). The advantage of using the IPoint is that you then have complete control over the NPCs and nothing will cause the conversation itself to be interrupted.


I've never heard of an IPointSpeaker, I'll do some research.  Thanx.

#32
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Yes, you can pretty much fire off any script from the conversation node, the ga_* ones are just the pre-built ones that come with the game. There are some additional community written ones here, most people name their new ones in the ga_* fashion just to be consistant, but that is not required in any sort of way: http://nwcitadel.for...read.php?t=1785

The IPointSpeaker is listed under the Placeables -> MISC blueprint tab and is specifically meant to be used to fire off/hold conversations.

#33
JasonNH

JasonNH
  • Members
  • 237 messages

Pompeii69 wrote...
I clicked the link for PlayCustomAnimation, but is there a master list somewhere of the animations themselves?


Yes, at bottom of said page where it says PlayCustomAnimation: List of animations   ;)

#34
Pompeii69

Pompeii69
  • Members
  • 153 messages
One more question, hopefully I'll be running out of questions soon...

So I have a character casting a spell, fireball, butall that happens is the character goes through the motions, but the actual fireball doesn;t fire. I assuming I'll have to script in the VFX of the fireball? Will I also have to script the impact?

#35
JasonNH

JasonNH
  • Members
  • 237 messages

Pompeii69 wrote...

One more question, hopefully I'll be running out of questions soon...

So I have a character casting a spell, fireball, butall that happens is the character goes through the motions, but the actual fireball doesn;t fire. I assuming I'll have to script in the VFX of the fireball? Will I also have to script the impact?


Ah, for that, take a look at CastFakeSpellAtObject(). It will make your life easier.

#36
Pompeii69

Pompeii69
  • Members
  • 153 messages

JasonNH wrote...

Pompeii69 wrote...

One more question, hopefully I'll be running out of questions soon...

So I have a character casting a spell, fireball, butall that happens is the character goes through the motions, but the actual fireball doesn;t fire. I assuming I'll have to script in the VFX of the fireball? Will I also have to script the impact?


Ah, for that, take a look at CastFakeSpellAtObject(). It will make your life easier.



Will do... Thanx!

#37
Pompeii69

Pompeii69
  • Members
  • 153 messages

JasonNH wrote...

Pompeii69 wrote...

However, there doesn;t appear to be basic attack animation available, so staging or choreographing an entire fight sequence doesn;t seem likely. Unless there's something I'm missing (more than possible)


I realize that you have taken a different route at this point, but for future reference, you are not limited to the animations enumerated in the list that you gave. You can, in fact, play any animation that occurs in the game using the PlayCustomAnimation function. It can take a lot of trial and error to get the timing right in a scripted sequence, but good to know that you are not limited to those predefined constants.



I'm curious... is there a difference between ga_play_custom_animation and PlayCustomAnimation()?  I'm asking because it says in the description for ga_play_custom_animation:  Conversation script wrapper for PlayCustomAnimation() command.  I used the ga_play_custom_animation, and it did indeed play the *1attack01 animation as the PlayCustomAnimation() was said to.

Where this really is making me curious though, was in a later response, when it came to casting a FireBall, where the fireball actually fired, to use CastFakeSpellAtObject, and thinking this too (BTW, couldn't find that but did find ActionCastFakeSpellAtObject) was the same, tried using ga_cast_fake_spell_at_object, but it didn;t seem to work at all.  Are they not the same like the ga_play_custom_animation and PlayCustomAnimation() are the same?

Assuming they're not the same, and I do have to use the actual ActionCastFakeSpellAtObject, any ideas where I can find some examples of it's call.  I know the code snippet has a description of the parameters, but studying some working examples would help me a bit (I kinda learn better by example as opposed to reading descriptions...)  I assume I'm gonna need an object that defines the speaker (or who I want to cast the spell), some kind of location object I should be able to get somehow based on the location of the waypoint I'm targeting, etc...

Modifié par Pompeii69, 30 juin 2011 - 01:53 .


#38
JasonNH

JasonNH
  • Members
  • 237 messages

Pompeii69 wrote...

I'm curious... is there a difference between ga_play_custom_animation and PlayCustomAnimation()?  I'm asking because it says in the description for ga_play_custom_animation:  Conversation script wrapper for PlayCustomAnimation() command.  I used the ga_play_custom_animation, and it did indeed play the *1attack01 animation as the PlayCustomAnimation() was said to.


The ga_play_custom_animation script ultimately calls the PlayCustomAnimation() function and adds an optional delay command before assigning the action. Any actions that you assign to a command queue have to return void,so the ga script puts that wrapper around the function for you and embeds it inside of a DelayCommand() if you specify a non-zero value for the delay.

Where this really is making me curious though, was in a later response, when it came to casting a FireBall, where the fireball actually fired, to use CastFakeSpellAtObject, and thinking this too (BTW, couldn't find that but did find ActionCastFakeSpellAtObject) was the same, tried using ga_cast_fake_spell_at_object, but it didn;t seem to work at all.  Are they not the same like the ga_play_custom_animation and PlayCustomAnimation() are the same?


Yes, you're right, I forgot the Action prefix to the name, sorry. I just took a look at the ga_cast_fake_spell_at_object script and it looks broken to me. It's simply calling the ActionCastSpellAtObject() function instead of ActionCastFakeSpellAtObject(). If you took that script and simply replaced the function appropriately, you would have your example of what you need to do.


// ga_my_cast_fake_spell_at_object(float fSecondsDelay, string sCaster, int nSpell, string sSpellTarget, int nProjectilePathType)
/*
    Description:
    Has sCaster appear to cast a spell at sSpellTarget, but with no resulting effects.
   
    Parameters:
        float fSecondsDelay - Delay before casting
        string sCaster      - The caster's tag or identifier, if blank use Dialog Owner. see "ginc_param_const" for TARGET_* constants
        int nSpell            - spell ID. see NWSCRIPT.nss for SPELL_* constants
        string sSpellTarget    - The caster's tag or identifier, if blank use PC Speaker. see "ginc_param_const" for TARGET_* constants
        int nProjectilePathType - 0 = PROJECTILE_PATH_TYPE_DEFAULT. see NWSCRIPT.nss for PROJECTILE_PATH_TYPE_* constants
   
*/
#include "ginc_param_const"

void main(float fSecondsDelay, string sCaster, int nSpell, string sSpellTarget, int nProjectilePathType)
{
    object oCaster = GetTarget(sCaster, TARGET_OWNER);
    object oSpellTarget = GetTarget(sSpellTarget, TARGET_PC_SPEAKER);
   
    AssignCommand(oCaster, DelayCommand(fSecondsDelay, ActionCastFakeSpellAtObject(nSpell, oSpellTarget, nProjectilePathType)));
}

Take that script, rename it to ga_my_cast_fake_spell_at_object (or whatever you want), compile it, and then use it in the same place you were trying the original one in your conversation. Assuming you got the tags right and all, I should think it would work.

Modifié par JasonNH, 30 juin 2011 - 02:50 .


#39
Pompeii69

Pompeii69
  • Members
  • 153 messages
Thank you jason... I have to say, the people here are far more helpful and civil than what I've experienced in other forums (not specific to NWN2, just forums in general). I've asked question in other forums, and people there are not helpful and jump at the first chance to flame a person about anything. Thank you again, one and all.

Although I will try to refrain froms asking overly simple questions... :)

#40
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Yeah the people here are great.

Ask any questions you want, no matter how simple. You wouldn't believe some of the idiotic questions I've asked here. :)

#41
JasonNH

JasonNH
  • Members
  • 237 messages
I've always found the NWN/NWN2 communities to be very helpful and, by and large, full of people who support each other and want to see each other succeed. We all win in that process and it helps to keep it fun. Good luck.