eNoodles

Sitting Placeables

Recommended Posts

For some reason when I add sitting npc placeables into a module (like plc_sitrodian for example), they're t-posed in-game. I've tried messing around with the Animation State field, but nothing changes. I haven't noticed anything else on the sitting placeables in vanilla modules that could affect this. Any ideas?20180806125952_1.thumb.jpg.52f68a85e1d8ebea4f5cf50f20f8b74c.jpg

  • Thanks 1

Share this post


Link to post
Share on other sites

You'll probably need to add to the module's on-enter script. Something like this:

	sub3(OBJECT_SELF);
	oAreaObject = GetFirstObjectInArea(OBJECT_INVALID, 64);
	while (GetIsObjectValid(oAreaObject)) {
		if ((GetTag(oAreaObject) == "ptar_pazplayer")) {
			AssignCommand(oAreaObject, ActionPlayAnimation(206, 1.0, 0.0));
		}
		if ((GetTag(oAreaObject) == "ptar_sitter")) {
			AssignCommand(oAreaObject, ActionPlayAnimation(204, 1.0, 0.0));
		}
		if ((GetTag(oAreaObject) == "ptar_drinker")) {
			AssignCommand(oAreaObject, ActionPlayAnimation(205, 1.0, 0.0));
		}
		oAreaObject = GetNextObjectInArea(OBJECT_INVALID, 64);
	}

Check the on-enter scripts of other modules with sitting placeables to see what they do.

Edit: The 64 in the oAreaObject statement equates to OBJECT_TYPE_PLACEABLE. The 204/205/206 in the ActionPlayAnimation statements equate to ANIMATION_PLACEABLE_ANIMLOOP01/02/03, respectively. You'll want to check the model to see what animations it has to determine which you want to play.

Edit 2: Ah, that's right, the placeable sitters are actually just standard character models. The animations are on the S_Male02 supermodel. Looking at it in Max, ANIMLOOP01 is a static sitting pose, ANIMLOOP02 is sitting and drinking, ANIMLOOP03 is sitting playing pazaak.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks DP, all working. There aren't source scripts for the on-enter scripts for vanilla modules, but yours works fine.

Share this post


Link to post
Share on other sites

You have to decompile the scripts yourself. That snippet is from the decompiled on-enter for TAR_M03AE (Javyar's Cantina). You'll want DeNCS for that - http://www.starwarsknights.com/mtools/DeNCS.zip

I would suggest creating a duplicate copy in a separate folder and using K1's nwscript.nss for decompiling K1 scripts.

  • Like 1

Share this post


Link to post
Share on other sites
Guest Qui-Gon Glenn

Just to add to DP's good instructions... You don't need to decompile any area on_enter, you only need to know the name of the script so you can inject it into your new on_enter, using ExecuteScript.

There are many tutorials for this.

 

 

Share this post


Link to post
Share on other sites
1 hour ago, Qui-Gon Glenn said:

Just to add to DP's good instructions... You don't need to decompile any area on_enter, you only need to know the name of the script so you can inject it into your new on_enter, using ExecuteScript.

There are many tutorials for this.

 

 

Yeah I know that, that's what I've been doing. We just needed to decompile to see how they work (for the sitting placeables).

Share this post


Link to post
Share on other sites
On 8/6/2018 at 5:08 PM, eNoodles said:

...add sitting npc placeables into a module (like plc_sitrodian for example), they're t-posed in-game. I've tried messing around with the Animation State field, but nothing changes.

Thank you for brought the topics up! I have been fiddling with the sitting NPC placeables recently and stumbled to the exact problems as yours - I am thankful for this.

On 8/6/2018 at 5:48 PM, DarthParametric said:

The 204/205/206 in the ActionPlayAnimation statements equate to ANIMATION_PLACEABLE_ANIMLOOP01/02/03, respectively... ANIMLOOP01 is a static sitting pose, ANIMLOOP02 is sitting and drinking, ANIMLOOP03 is sitting playing pazaak.

Much thanks for the insight! They works for me. :cheers:

Anyway, about this -

On 8/6/2018 at 5:48 PM, DarthParametric said:

...probably need to add to the module's on-enter script.

I've found the alternative that is as effective but with less effort as we don't have to inject or reconstruct the module's OnEnter. We can use the NPC placeables' OnHeartbeat to signal the sitting animation with something like this -

//:://////////////////////////////////////////////////////////////
//:: Sitting and Drinking Animation for NPC Placeables
//:://////////////////////////////////////////////////////////////
/*
	Fired by NPC placeables' *OnHeartbeat* for them to routinely
	does the *sitting and drinking* animation.
*/
//:://////////////////////////////////////////////////////////////
//:: Constructed By: ebmar
//:: Constructed On: November 12, 2019
//:://////////////////////////////////////////////////////////////

void main()
{
	// Play the looping *sitting and drinking* animation with the NPC placeables
	PlayAnimation(ANIMATION_PLACEABLE_ANIMLOOP02);
}

I have found no issue so far using that, as far as the sitting animation does looping forever - uninterrupted.

  • Like 1

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.