Jump to content

Remaking the "furniture entry points"?


Recommended Posts

 

The thing is the animation.

It is set up to go from the "furniture entry point" to "the character is sitting in that chair".

Unless that is generated "dynamically" by the game, moving that entrypoint would require to also remake the animation.

 

As far as I know, the entry point and the furniture marker (where the character actually sits on the static chair mesh) are "one thing" and you can't move one without the other.

 

 

I guess that is how it works ...

 

It wouldn't bother me to not have that "character going from standing there to sitting down" - animation if I could somehow change the location of the entry points ...

You might get/be lucky.

In most cases the animations are done using relative positions. Like I did for rotating my levers and such. (this is done by moving the niNode, instead of the ni/bsTriShape).

Another often used method is by using a "skeleton".

 

If its a gamebryo animation, you can change just about anything using nifSkope. If its a havok animation, well, thats somewhere between hard and impossible. (unless you have the 3DS Max source, of course)

 

I am not sure if we are talking about the same thing here....

 

i am talking about this:

When you activate a chair to sit in it, the player character will move to a certain spot (left, right, behind, in front of the chair) and then start the "sitting down" animation.

There is a specific animation that plays for each "entry point".

I don't think if I could somehow just move the entry points that the animations would "update to that change" by themselves ...

You would probably have to make completeley new animations ...

Link to comment
Share on other sites

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

Animations on furnitures are defined by Keywords (and optionally Marker models). These keywords start with "AnimFurn" (like "AnimFurnChairSitAnims"). If you change this keyword, another animation would play. To change the XYZ coordinates of the animation marker, click on the "Interaction Point" and change the values (as niston suggested). NpcChairVaultSit01_Barber [FormID: D3FBD] has marker model and keyword too.

Edited by LarannKiar
Link to comment
Share on other sites

No, this does not work:

 

73722383-1625948557.png

 

See, the "sitting marker" moves with the entry points if I try to move them in that way.

 

I want to move the entry points closer to the chair, but keep the acutal "character will sit here" part (the blue guy sitting) where it is.

Link to comment
Share on other sites

 

Ask yourself what type of object you are calling it from, and what script snapintointeraction is member of.

 

It is used for actors.

 

So how would I get this to work with attaching a script on the furniture object?

 

 

 

 

 

PS: object as an OOP language object, not the base object (ObjectReference akActionRef).

What?

 

 

If you want to use snapintoiteraction, which is function from actor script, on akActionRef, which is an ObjectReference script, you would need to... ¿? come on dude, give it some thinking. Is not that complicated.

Link to comment
Share on other sites

 

 

Ask yourself what type of object you are calling it from, and what script snapintointeraction is member of.

 

It is used for actors.

 

So how would I get this to work with attaching a script on the furniture object?

 

 

 

 

 

PS: object as an OOP language object, not the base object (ObjectReference akActionRef).

What?

 

 

If you want to use snapintoiteraction, which is function from actor script, on akActionRef, which is an ObjectReference script, you would need to... ¿? come on dude, give it some thinking. Is not that complicated.

 

 

IDK ...

I think functions that work on actors can only be used in scripts attached to actors, right?

 

So the "furniture script" would need to attach a "snap this actor into the furniture" script to whatever actor activated it.

I don't know ...

 

I am (apparently) not that good with scripting.

I can get simple stuff done, but trying to use functions that are intended for one thing for antoher thing is a bit over my skill level ...

Link to comment
Share on other sites

Doesn't have to do with the script you are working on, since you're not calling it directly on the object script like this:

 

SnapInToInteraction(Self)

 

Which would be the same than

 

Self.SnapInToInteraction(Self)

 

But you are calling it on akActionRef which, as we can deduce by the argument ObjectReference akActionRef, it is an ObjectReference.

That means that any function that you call from akActionRef must be in ObjectReference or one of its parent scripts, ObjectReference Script extends Form Script, and Form Script extends ScriptObject.

Therefore, on akActionRef you only can call functions from ObjectReference, Form and ScriptObject script.

 

Actor Script is not parent of ObjectReference Script, but ObjectReference Script is parent of Actor Script, therefore you can cast an ObjectReference Script As an Actor Script:

 

Like this:

 

Actor akActionActorRef = akActionRef As Actor

 

Then call SnapInToInteraction on it. Or you can do the cast and the function call all at once (ref As Actor).FunctionToCall()

Edited by DieFeM
Link to comment
Share on other sites

Doesn't have to do with the script you are working on, since you're not calling it directly on the object script like this:

 

SnapInToInteraction(Self)

 

Which would be the same than

 

Self.SnapInToInteraction(Self)

 

But you are calling it on akActionRef which, as we can deduce by the argument ObjectReference akActionRef, it is an ObjectReference.

That means that any function that you call from akActionRef must be in ObjectReference or one of its parent scripts, ObjectReference Script extends Form Script, and Form Script extends ScriptObject.

Therefore, on akActionRef you only can call functions from ObjectReference, Form and ScriptObject script.

 

Actor Script is not parent of ObjectReference Script, but ObjectReference Script is parent of Actor Script, therefore you can cast an ObjectReference Script As an Actor Script:

 

Like this:

 

Actor akActionActorRef = akActionRef As Actor

 

Then call SnapInToInteraction on it. Or you can do the cast and the function call all at once (ref As Actor).FunctionToCall()

Oh ...

I thought that "akActionRef" was of the type actor, because of this example script from the CK wiki that does something when the player activates something:

; Have the event run if the triggering objectreference is the player.
Event OnActivate(ObjectReference akActionRef)
   if akActionRef == Game.GetPlayer()
      ; your code here.
   endif
EndEvent

So I thought that "akActionRef" was "whoever activated this thing" and thus could be used for the snapping-to-the-furniture.

Link to comment
Share on other sites

Sooooo ...

 

This works!

(for the player, at least, I need to do some testing with NPCs ...)

 

I also added a "move the player to an XMarkerHeading when exiting" - thing to that script.

So I can place an XMarkerHeading and have the player "pop out to there" when exiting the chair.

 

So far so good!

Link to comment
Share on other sites

 

Oh ...

I thought that "akActionRef" was of the type actor, because of this example script from the CK wiki that does something when the player activates something:

 

 

It 100% must be an actor, I doubt any other type of object could activate something, but the event is passing the reference of the actor instead of the actor. Maybe there's an use case where an activation can be done by something which is not an actor.

 

 

 

So I thought that "akActionRef" was "whoever activated this thing" and thus could be used for the snapping-to-the-furniture.

 

Yes, it is "whoever activated this thing" or, to be a bit more accurate, "whatever activated this thing", therefore you need to cast to whatever script it is supposed to be activating this thing, in this case an actor, then you need to cast it to Actor Script.

 

That's the same you would do if you receive a Form from an event, for example form OnItemRemoved, and such object must be a weapon, you would cast the form to a weapon (akForm As Weapon), if the resulting object returns as None it means that the cast was incorrect because the Form is not a weapon. So after you do any type of cast you should check if the returned object is not none:

 

If CastObject != None

 

Or the short version

 

If CastObject

 

In runtime the CastObject will be its actual value, therefore it will be None, which evaluates as false, or will be the object, which evaluates as true, no need for comparisons.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...