Jump to content

Recommended Posts

I'm wondering if the Scripts fields can be used to directly add a command to the game, like we do using the console or if that function is disabled cuz no-one ability have this field compiled.

 

My purpose is add an ability/status effect that add disposition points, so surfing inside the game docs i found that about script

 

disposition.png

 

could i add that to an ability? And which is the correct syntax?  Because reading the docs i'm a little confused about ChangeStrenghtComponent . Which is the parameter to refer about it? Average, Major?

Cuz i wanna add just few points not a whole disposition rank.

Thnks in advance

 

Void DispositionAddPoints(Guid, Guid)

 

DispositionComponent

 

ChangeStrengthComponent

 

EDIT

 

I found the StrenghtComponent, but an answer about scripts  in ability components is always welcome :)

 

 

EDIT 2

 

Something like that? Could it works?

                "Scripts": [{
        "$type": "OEIFormats.FlowCharts.ScriptCallData, OEIFormats",
         "Data": {
             "FullName": "Void DispositionAddPoints(Guid, Guid)",
             "Parameters": ["c7d9588c-bc62-4c0c-a2e3-76a970e7b7d4", "54772c0d-cf3f-4589-8cab-9f3601d575c2"],
             "UnrealCall": "",
             "FunctionHash": 0,
             "ParameterHash": 0
            }

Edited by kilay
Link to comment
Share on other sites

It doesn't look like we currently provide a way on abilities, attacks, or status effects to execute a script call.  Your script call looks correct, though.

 

Thnks for reply.

So from what i've seen  disposition points  can be changed only via convos or scripted interactions, right?

If the answer is affermative , can i call a scripted interaction to trigger this disposition change (like soulbound weapons)?

Edited by kilay
Link to comment
Share on other sites

Or if it isn't doable, is there  some other way to add disposition points using an item ?

Link to comment
Share on other sites

You can call the script from anywhere that has a "ScriptsOnly" or "ConditionalAndScripts" property in the documentation (search the Components and Structures pages).  Soulbound items can directly fire scripts when they level up - you wouldn't even need a scripted interaction.

  • Like 1
Link to comment
Share on other sites

You can call the script from anywhere that has a "ScriptsOnly" or "ConditionalAndScripts" property in the documentation (search the Components and Structures pages).  Soulbound items can directly fire scripts when they level up - you wouldn't even need a scripted interaction.

 

I would just say thnks, cuz i figured out the problem, i made my first soulbound weapon and it add disposition points when levels...

Many thnks again

Edited by kilay
Link to comment
Share on other sites

  • 3 weeks later...

No, that component can only trigger scripts on the events available in the DataScriptEvent enum (which would only be OnInspected for an Attack).

 

So would this be a valid declaration of the DataScriptEventComponent for an attack?

{
		"$type": "Game.GameData.AttackMeleeGameData, Assembly-CSharp",
		"DebugName": "Benediction_of_Restoration_Melee",
		"ID": "b0dc0e1a-0b99-4a7a-5a3c-59486bb60243",
		"Components": [{
			"$type": "Game.GameData.AttackBaseComponent, Assembly-CSharp",
			"KeywordsIDs": ["d5e4e9b4-9565-4654-9e2e-2d68d8847c20"],
			"AttackDistance": 5,
			"MinAttackDistance": 0,
			"AttackVariationID": "7439b86f-785c-4551-8851-95b375a02792",
			"UseParentEquippableHand": "false",
			"CastSpeedID": "e4c738a7-4d3f-407f-b035-cc76191fe26b",
			"RecoveryTimeID": "2065a64b-0d53-48b8-9cfd-600992c389fd",
			"ImpactDelay": 0,
			"ForcedTarget": "None",
			"AffectedTargetType": "Friendly",
			"AffectedTargetConditional": {
				"Conditional": {
					"Operator": 0,
					"Components": []
				}
			},
			"AffectedTargetDeathState": "Alive",
			"HostilityOverride": "Default",
			"PushDistance": 0,
			"FaceTarget": "true",
			"AccuracyBonus": 0,
			"PenetrationRating": 0,
			"DamageData": {
				"DamageType": "None",
				"AlternateDamageType": "None",
				"Minimum": 0,
				"Maximum": 0,
				"DamageProcs": []
			},
			"Require****Object": "true",
			"StatusEffectKeywordsIDs": ["d5e4e9b4-9565-4654-9e2e-2d68d8847c20"],
			"StatusEffectsIDs": [],
			"RandomizeStatusEffect": "false",
			"CanGraze": "false",
			"CanCrit": "true",
			"DefendedBy": "None",
			"AfflictionsDefendedBy": "None",
			"AfflictionApplicationModifier": "None",
			"SubstituteHitVisualEffect": "",
			"VisualEffects": [{
				"VisualEffect": "prefabs/effects/abilities/cast/fx_cast_priest_hand.prefab",
				"AttachPoint": "LeftWeapon",
				"AttachObject": "Caster",
				"AttachMode": "Attach",
				"MeshType": "None",
				"Event": "OnAnimEvent",
				"AnimEventID": 2,
				"Loop": "true",
				"Scale": "false"
			},
			{
				"VisualEffect": "prefabs/effects/abilities/cast/fx_cast_priest_hand.prefab",
				"AttachPoint": "RightWeapon",
				"AttachObject": "Caster",
				"AttachMode": "Attach",
				"MeshType": "None",
				"Event": "OnAnimEvent",
				"AnimEventID": 2,
				"Loop": "true",
				"Scale": "false"
			},
			{
				"VisualEffect": "prefabs/effects/abilities/cast/fx_cast_priest_finish.prefab",
				"AttachPoint": "RightWeapon",
				"AttachObject": "Caster",
				"AttachMode": "Attach",
				"MeshType": "None",
				"Event": "OnLaunch",
				"AnimEventID": 0,
				"Loop": "false",
				"Scale": "false"
			},
			{
				"VisualEffect": "prefabs/effects/abilities/cast/fx_cast_priest_finish.prefab",
				"AttachPoint": "LeftWeapon",
				"AttachObject": "Caster",
				"AttachMode": "Attach",
				"MeshType": "None",
				"Event": "OnLaunch",
				"AnimEventID": 0,
				"Loop": "false",
				"Scale": "false"
			}],
			"AttackOnImpactID": "00000000-0000-0000-0000-000000000000",
			"ExtraAttackID": "00000000-0000-0000-0000-000000000000",
			"LaunchBone": "LeftWeapon",
			"HitBone": "Chest",
			"OnHitShakeDuration": "None",
			"OnHitShakeStrength": "None",
			"NoiseLevelID": "82bc1ce9-3a81-41ca-a61a-cc1f73a53de7",
			"AllReactNoise": "false",
			"InterruptsOn": "None",
			"InterruptType": "Normal",
			"TargetAngle": 0,
			"ApplyOnceOnly": "false",
			"PathsToTarget": "true",
			"HideFromCombatLog": "false",
			"AdditionalAttackOnTooltip": "false",
			"DoesNotApplyDamage": "false",
			"TreatAsWeapon": "false",
			"BounceData": {
				"Bounces": 0,
				"Multiplier": 0.5,
				"Range": 10,
				"InRangeOrder": "false",
				"NoRepeatTargets": "false",
				"AlwaysBounceAtEnemies": "false",
				"Delay": 0,
				"NeverBounce": "false"
			}
		},
		{
			"$type": "Game.GameData.AttackMeleeComponent, Assembly-CSharp",
			"EngagementRadius": 1,
			"IsUnarmed": "false"
		},
		{
			"$type": "Game.GameData.DataScriptEventComponent, Assembly-CSharp",
			"Scripts": [{
				"Event": "OnInspected",
				"Script": {
					"Conditional": {
						"Operator": 0,
						"Components": []
					},
					"Scripts": [{
						"Data": {
							"FullName": "Void RemoveAllInjuries(Guid)",
							"Parameters": ["1a26e100-0000-0000-0000-000000000000"],
							"UnrealCall": "",
							"FunctionHash": 0,
							"ParameterHash": 0
						},
						"Conditional": {
							"Operator": 0,
							"Components": []
						}
					}]
				}
			}]
		}]
	}
  • Like 1
Link to comment
Share on other sites

I think I accidentally misled you. That particular event (OnInspected) doesn't fire when the attack is launched. It fires when the attack is opened in the inspection window. DataScriptEvent doesn't currently provide an event for when the attack is launched.

  • Like 1
Link to comment
Share on other sites

You can call scripts, if and when you can apply StatusEffect to a character with a quick slot. First make a dummy item. It can be completely empty (it still needs an ItemComponent) and add a DataScriptEventComponent with OnItemCollected event to it. Attach the scripts you want to call here. Make two StatusEffectGameData one with BonusQuickSlots ("BaseValue": 1, "DurationType": "Instant") and another with SummonConsumable ("DurationType": "Instant", "ItemValueID": "Dummy item Guid"). Make sure you always apply them one after the other, first the BonusQuickSlots then SummonConsumable. Once the summoning is completed (in an instant) both the BonusQuickSlots and the SummonConsumable will be removed, but the script on the dummy item will be called.

 

It works, because the SummonConsumable calls a function that triggers the OnItemCollected event (for example the SummonWeaponPrimarySlot does not). Also the max quick item number can go over 6, the overflow is simply inaccessible, but not for the SummonConsumable status effect.

 

The BonusQuickSlots and the SummonConsumable can be applied from an attack as well. The downside: the attack has to originate from a charater with a quick slot. Make a KeywordGameData for the attack and add it to the "KeywordsIDs" of said attack. Apply a StatusEffectGameData with ApplyStatusEffectOnEvent ("AttackFilter": {"KeywordsIDs": [KeywordGameData attack Guid]}, "StatusEffectsValueIDs": [BonusQuickSlots Guid, SummonConsumable Guid], "EventValue": "OnScoringGrazeHitOrCriticalHit") to the character. Whenever the character hits with the attack, the script will be called as well.

  • Like 4
Link to comment
Share on other sites

You can call scripts, if and when you can apply StatusEffect to a character with a quick slot. First make a dummy item. It can be completely empty (it still needs an ItemComponent) and add a DataScriptEventComponent with OnItemCollected event to it. Attach the scripts you want to call here. Make two StatusEffectGameData one with BonusQuickSlots ("BaseValue": 1, "DurationType": "Instant") and another with SummonConsumable ("DurationType": "Instant", "ItemValueID": "Dummy item Guid"). Make sure you always apply them one after the other, first the BonusQuickSlots then SummonConsumable. Once the summoning is completed (in an instant) both the BonusQuickSlots and the SummonConsumable will be removed, but the script on the dummy item will be called.

 

It works, because the SummonConsumable calls a function that triggers the OnItemCollected event (for example the SummonWeaponPrimarySlot does not). Also the max quick item number can go over 6, the overflow is simply inaccessible, but not for the SummonConsumable status effect.

 

The BonusQuickSlots and the SummonConsumable can be applied from an attack as well. The downside: the attack has to originate from a charater with a quick slot. Make a KeywordGameData for the attack and add it to the "KeywordsIDs" of said attack. Apply a StatusEffectGameData with ApplyStatusEffectOnEvent ("AttackFilter": {"KeywordsIDs": [KeywordGameData attack Guid]}, "StatusEffectsValueIDs": [BonusQuickSlots Guid, SummonConsumable Guid], "EventValue": "OnScoringGrazeHitOrCriticalHit") to the character. Whenever the character hits with the attack, the script will be called as well.

 

Fantastic work-around!  Do you know if this works if the character in question has all quick slots unlocked?  

Edited by SiliconMage
Link to comment
Share on other sites

Yes, the BonusQuickSlots can go above 6. It's a simple addition, but there are two stacking rules:

  1. If the character has BonusQuickSlots from multiple sources (for example Deep Pockets) they stack with each other.
  2. The "MaxStackQuantity" property of the StatusEffectComponent governs the stacking rule for applying the same StatusEffectGameData (same Guid) to a single character.

You can't access the extra quick slots beyond the theoretical max (six) from the UI, but the SummonConsumable can add an item to it just fine.

  • Like 1
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...