Sign in to follow this  
spideyseth

fight scene script

Recommended Posts

I'm attempting to script a fight scene between two npc's in a dlg file. The npcs don't fight, however and the screen just vibrates for no reason and they just stare at each other.

Here is my source script:

void main()

{

object roland = GetObjectByTag("n_roland", 0);

object oron = GetObjectByTag("orontag", 0);

 

ChangeToStandardFaction(roland, 2);

ChangeToStandardFaction(oron, 4);

 

 

}

Share this post


Link to post
Share on other sites

You changed them to two factions that aren't hostile to one another (STANDARD_FACTION_FRIENDLY_1 and STANDARD_FACTION_FRIENDLY_2). They won't automatically fight. You can try something like:

DelayCommand(0.1, AssignCommand(oMook1, ActionAttack(oMook2)));

If you want them to fight with no further input, change them to two factions that are hostile to each other but neutral to the player, like STANDARD_FACTION_PREDATOR and STANDARD_FACTION_PREY.

Share this post


Link to post
Share on other sites

I changed the code but they still are doing the same thing. I forgot to mention this is in a cloned module so maybe that has something to do with it? 

 

void main()

{

object roland = GetObjectByTag("n_roland", 0);

object oron = GetObjectByTag("orontag", 0);

 

ChangeToStandardFaction(roland, STANDARD_FACTION_PREDATOR);

ChangeToStandardFaction(oron, STANDARD_FACTION_PREY);

 

 

}

 

Or maybe I messed up with the syntax or something?

Share this post


Link to post
Share on other sites

Double checked yeah there correct it has to be something with the script syntax wise then.

Or do you think its an issue with the module?

Since its cloned via the holocron toolset.

Share this post


Link to post
Share on other sites

Fixed the problem it was holocron toolset that was the issue I compiled the scripts there but then I switched to kotor scripting tool and it worked!

Share this post


Link to post
Share on other sites

Last thing I want to ask is how to delay the conversation while they are fighting because it instantly exits the dialogue when they fight?

Share this post


Link to post
Share on other sites

You should look at some vanilla scenes for examples of how to do things like this. You can find most of the source code for the game's scripts here. Also peruse nwscript.nss which holds all the script functions.

In this case, you want the functions ActionPauseConversation and ActionResumeConversation. For example:

void main() {

    ActionPauseConversation();

    // Insert whatever commands you want for this node.

    DelayCommand(2.0, ActionResumeConversation());
}

You can change the delay to any value you want, as long as it is a float not an integer (i.e. 2.0 not 2, 1.0 not 1, etc.).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this