Jump to content

Looking for help with ideas on how to add abilities to player characters.


Recommended Posts

Hey there!

 

So I'm working on a mod that would add abilities/talents to the player while completely bypassing the progressiontable. The idea would be to make it as simple and non-intrusive as possible for the user. But unfortunately I'm a bit lost here.

 

I tried using consumables to deliver the ability, but couldn't get it to completely work. If it is a passive ability then I can deliver the statuseffects, but not the ability itself. (Potion -> Ability -> Statuseffect Use the potion, that activates the ability and you get the status effects.)

 

I also know that I can tie it with an itemmod, but that is not really feasible because that would take up an equipment slot and would disappear when you remove the item. Scripts also work (ModScriptHook Find player -> If found add ability), but require that you know the players uuid.

 

So here I am. Can I somehow do it with consumables, work with scripts without knowing the players uuid or some other way?

Any tips to get me to the right path would be appreciated.

Link to comment
Share on other sites

I think a good starting point would simply be the Watcher Abilities.

 

Check how the first one we get is delivered (has to be via a script or at character generation), and walk down from there ;)

Link to comment
Share on other sites

Also, here's an example from global.gamedatabundle, with a script that runs on Game Start (seems to be the Berath Blessing for the mythical adra stone)

		{
			"$type": "Game.GameData.NewGameBonusGroupGameData, Assembly-CSharp",
			"DebugName": "18_Mythical_Discovery",
			"ID": "83db9af0-fefc-4c63-b3d8-90b7124259e3",
			"Components": [
				{
					"$type": "Game.GameData.NewGameBonusGroupComponent, Assembly-CSharp",
					"DisplayString": 61,
					"DescriptionString": 62,
					"DisabledAchievementsAndChallengesIDs": [],
					"WhenToRunScripts": "OnGameStart",
					"Bonuses": [
						{
							"DisplayString": -1,
							"Cost": 30,
							"ScriptsToRun": [
								{
									"Data": {
										"FullName": "Void SetGlobalValue(String, Int32)",
										"Parameters": [
											"bb_mythical_discovery",
											"1"
										],
										"Flags": "",
										"UnrealCall": "",
										"FunctionHash": 1935477378,
										"ParameterHash": -563393718
									},
									"Conditional": {
										"Operator": 0,
										"Components": []
									}
								}
							],
							"SpriteIcon": "gui/images/ingamehud/newgamebonuses/bb_mythicaldiscovery.png"
						}
					],
					"IsChallenge": "false"
				}
			]
		},
Link to comment
Share on other sites

So I was actually rummaging around in the dialogue files before, trying to find how the watcher abilities are given and I did find that the target for that script was the Player_Debug ("b1a8e901-0000-0000-0000-000000000000"). And I did try using that in a ModScripHook "if player is in the scene -> give ability" script, but it didn't work so I abandoned that.

 

But after SiliconMage mentioned that again, I went back to it. Long story short, I was using it on new characters and had it set up as "SucceedOnlyOnce -> true", and that was the problem. It was firing the script, failing to give the ability and then turning off the script.

 

I'm now using a ModScripHook "check if player has ability, if not give it to them" script. I still can't get past character creation, but if I use it on a character already made, then I can get it to work nine times out of ten (it will still sometimes misfire!??). If I use "SucceedOnlyOnce -> false" then it will always work, but that is generally bad practice (it keeps checking every time you enter a new scene).

 

Anyhow, thanks to the both of you I finally have a reliable way to deliver my abilities/talents.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...