Jump to content

Multiple "playable characters" possible?


Recommended Posts

Good evening everybody!

 

Would it be possible to have the player "switch" between different "actors"?

 

If any of you have ever played GTA 5, you will know what I mean.

(Basically, there are 3 protagonists in that game that the player can switch between)

 

I remember seeing a mod that allowed you to "control" other NPCs for Skyrim, but I think it never got finished ...

 

 

And would it be possible to have individual "level up menus" for each character?

So that one character could be at level 4, another at level 7 for example ...

 

 

I guess the "individual inventory for each actor" would be the easy part.

(move the stuff in the players inventory from / into a "hidden chest" to / from the player's inventory)

 

 

Does anybody has any advice on how to implement this?

 

 

I am thinking about using quest stages to determine what character the player currently "controls".

Like, if the quest stage is 10, the player controls actor A, if it is 20 the player controls actor B and so on ...

 

 

Does anybody know how well the SetPlayerControls() thing actually works?

 

 

 

The reason why I want to do this:

To me, it always felt a bit weird that "the player" was the guy/girl that did ALL THE THINGS.

With something like this, you could "spread things out" a bit onto multiple characters, so that the player character is not like a god who can do all things and complete all quests.

But you would still retain the whole "the player (as in, the person in front of the PC) does all the cool stuff" - aspect that makes the game fun.

Link to comment
Share on other sites

Ok, so I played around with this a bit and it seems like the setPlayerControls thing is not working at all.

 

This is the script that I made:

Scriptname MPASwitchActor extends Actor
{The script that brings up the "Character Selection menu" when pressing a key.}

Message Property MessageToShow Auto
{The message that will be shown.}


Actor Property ActorA Auto
{Character A}

Actor Property ActorB Auto
{Character B}

Actor Property ActorC Auto
{Character C}

Keyword Property PlayerKeyword Auto
{The "player" keyword that gets added when the player switches to that actor.}

Actor Property NormalPlayer Auto
{The Noramal Player}





Event OnInit()
      RegisterForKey(165)  
endevent

Event OnKeyDown(int keyCode)
	if (keyCode == 165 )
		int selectedvar = MessageToShow.show()
		if selectedvar == 0
			;Player selected Character A
			ActorA.AddKeyword(PlayerKeyword)
			NormalPlayer.RemoveKeyword(PlayerKeyword)
			NormalPlayer.setPlayerControls(false)
			ActorA.setPlayerControls(true)

		endif

		if selectedvar == 1
			;Player selected Character B
			ActorB.AddKeyword(PlayerKeyword)
			NormalPlayer.RemoveKeyword(PlayerKeyword)
			NormalPlayer.setPlayerControls(false)
			ActorB.setPlayerControls(true)
		
			
		endif

		if selectedvar == 2
			;Player selected Character C
			ActorC.AddKeyword(PlayerKeyword)
			NormalPlayer.RemoveKeyword(PlayerKeyword)
			NormalPlayer.setPlayerControls(false)
			ActorC.setPlayerControls(true)

		endif
	endif
EndEvent

The menu for selecting the character works, it appears when I hit the key, but when I select on of the actors, nothing happens.

The "control" of the "normal player" gets disabled, but the camera is still "stuck" on the "normal player" and I also can't get the selected Actor to "move".

 

I tried to attach the "PlayerKeyword" to the selected NPCs because I thought that that would fix this, but no ...

 

EDIT:

I also tried to attach the AnimationArchetypePlayer keyword (or whatever it was called) to the "controlled NPC", but that didn't help either ...

Is there anything like "attach camera to actor" or something like that?

(I already looked on that CK wiki page with all the scripting functions and couldn't find anything that might do something like this ...)

 

Does anybody know how to work with this "setPlayerControls" - thing?

Edited by YouDoNotKnowMyName
Link to comment
Share on other sites

Or does anybody have another idea on how to implement this, because the s2etPlayerControls" isn't working at all.

I think that that function is supposed to be used to disable the player control, like when the player character is in the freezer in Vault 111 during the Kellog "cutscene" and that this isn't to actually "control" other NPCs.

Link to comment
Share on other sites

Wow, thanks!

Actually there is targetID.ToggleControlsDriven, that should do what I want ....

(I'll have to disable the "normal" player control first or otherwise both will move, but that's not a problem).

 

Thank you very much!

 

I don't really use console commands much (besides TCL, TGM, placeatme, additem and TFC), so that's why I didn't think about this ...

 

 

I had a quick look on the "scripting" page on the CK wiki and couldn't really find any scripting - equivalent for that there ...

So I think I am yet again stuck ....

Link to comment
Share on other sites

  • 1 month later...

I know this is an old topic, but anyway:

 

There is a mod for Skyrim that lets you "switch between" characters. (called "Alternate Actors")

I had a look at it to see how it worked:

As far as I understand it, the script that controls the "character swapping" kind of "reads" all the "character morph values" (you know, those sliders you can adjust when creating a character) of the "target NPC" and applies them to the player. The values of the players original character get saved and applied to that other character.

And it transfers the inventory and all of that.

 

So the player is actually still the player.

Of course that does not support character creation mods like Looksmenu and stuff like that.

And things like perks and levels are "the same" for the controlled actor as they are for the player (because the player is still the player, technically).

 

So that approach won't work for me.

 

There is also no "script equivalent" to the console command "targetID.ToggleControlsDriven".

(I couldn't get that console command to work anyway ...)

 

Please, if anybody has any ideas how to implement this, let me know here.

Link to comment
Share on other sites

I don't have a good anwser for you but look into how the character generation works. In the end those are just two seperate NPCs from which one you can overtake.

Yes, but with mods like Looksmenu things get complicated ...

For "just vanilla" something like the approach used for that skyrim mod would work.

Link to comment
Share on other sites

How about this:

 

Game.SetPlayerAIDriven(true)

Game.SetCameraTarget(targetActor)

targetActor.EnableAI(false)

targetActor.SetPlayerControls(true)

 

 

and

 

targetActor.SetPlayerControls(false)

targetActor.EnableAI(true)

Game.SetCameraTarget(refPlayer)

Game.SetPlayerAIDriven(false)

Link to comment
Share on other sites

Mmmmhhhh ...

That kind of works ...

 

The camera gets "atached" to the target actor in "third person mode", can't switch to first person view.

But I can't move at all and when I hit JUMP (space bar) the original player character jumps.

Also, when I "turn the view", the original player turns as well.

VATS somehow gets "used" from the original character as well ...

 

But it is a start ...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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