Jump to content

How to create a simple mount / driveable


Zorkaz

Recommended Posts

No matter what I do the test protectron or test cat gets player controlled. But the player doesn't mount it.

I've taken a look at quite a few rideable scripts but the last thing seems to elude me.

 

 

 

 

Scriptname STTestScriptScr extends Actor
Actor Property PlayerRef Auto
Actor Property ThisActor Auto
Actor Property PlayerActor Auto
InputEnablelayer NoMovementLayer




Event OnActivate (ObjectReference AkActionRef)

If AkActionRef == Game.Getplayer()

PlayerActor = Game.Getplayer() as Actor

Game.ForceThirdPerson()
Utility.wait(0.1)
Self.SetPlayerControls(true)
Self.EnableAI(True, False)
Game.SetPlayerAIDriven()
Game.SetCameraTarget(Self as Actor)
PlayerActor.SnapIntoInteraction(Self as Actor)
PlayerActor.SetVehicle(Self as Actor)

;NoMovementLayer = InputEnableLayer.Create()


Endif
EndEvent

 

 

Link to comment
Share on other sites

There needs to be a node in the Protectron/Cat NIF, for the player to snap into.

The race behavior graph determines the name of the node that the char will snap into.

 

Vertibird uses p-Attach-Something nodes for this, and it's referenced in the Human Race data subgraph (or whatever it's called). You could use the same node name(s), so you don't have to alter the subgraph.

 

I've only worked briefly with this in some silly small mod I made, but PJMail would know much more about this in detail.

 

NB: You can add nodes to a NIF in NifSkope. Just put a new NiNode, move it to where you want it (Translation/Rotation/Apply Transform) and give it a name. Furthermore, you'll have to make the new NiNode a child of the root NiNode. There is a Children property on all NiNodes. On the root NiNode, increase it's count by one, click the green arrows button and fill in the newly added entry with the number of the NiNode you added.

Link to comment
Share on other sites

Were you using the pre-existing keywords (p-attachpilot, isvertibird etc) or were you making your own new ones? If you were using your own then you need to create an additive subgraph for the human race to create the association between the sit animation, the target keyword (isvertibird for example) and the furniture attach point (p-attachpilot). Much cleaner to do that than 'hijack' the vertibird ones - but a lot of drivable just use the VB ones... If you do then remember there are already animations that will be used (good if you want to hold a minigun or control stick for example).

 

Make sure your attach point keywords are on your rocket NPC's "Attach Parent Slots" list, and the furniture target keyword (isvertibird say) in that NPC's keyword list.

Also make sure your 'pilot' attach point keyword is on the player (only the p-attachgunner is normally there) - I use a wearable to add it (as editing the player record is not a good idea).

 

As niston says, m150's skeleton nif modifications for the attach point should guide you with that part. The annoying thing is you need a new race to have a new skeleton...

Link to comment
Share on other sites

Make sure your attach point keywords are on your rocket NPC's "Attach Parent Slots" list, and the furniture target keyword (isvertibird say) in that NPC's keyword list.

Also make sure your 'pilot' attach point keyword is on the player (only the p-attachgunner is normally there) - I use a wearable to add it (as editing the player record is not a good idea).

All this done too? What Attach keyword are you using for your Rocket?

Link to comment
Share on other sites

Sry. I have abandoned the script and changed it thoroughly. I'm going with a different route for now.

Maybe I have missed a step, even though I used in the end other people's scripts out of frustration.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...