Gameplay Ability System: Difference between revisions
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Mainly learned from this page https://landelare.github.io/2024/01/15/simple-gas-tutorial.html<P> | |||
The Gameplay Ability System (GAS) Is used Primarily for its Network Prediction, It does provide other uses, however its much simpler to build your own system<p> | The Gameplay Ability System (GAS) Is used Primarily for its Network Prediction, It does provide other uses, however its much simpler to build your own system<p> | ||
Line 14: | Line 16: | ||
To resolve the issue, I opened the project folder within my UnrealProjects directory, rick-clicked on the .uproject, and clicked on “Generate Visual Studio project files”. After reopening my project in the editor and the solution in VS2017, the problem was fixed. | To resolve the issue, I opened the project folder within my UnrealProjects directory, rick-clicked on the .uproject, and clicked on “Generate Visual Studio project files”. After reopening my project in the editor and the solution in VS2017, the problem was fixed. | ||
</blockquote> | </blockquote> | ||
For me I always had to close the editor<p> | |||
Line 27: | Line 31: | ||
3. Attribute Set , Create a new c++ class in the editor and Inherit from UAttributeSet, I tried <br> | |||
Creating a new c++ class with empty, than just inheriting from it myself, however, the generated.h<br> | |||
wouldn't generate, and I couldn't use UPROPERTY because unreal couldn't find the class<br> | |||
3. | 3. | ||
==Notes== | |||
If you get the error failed: AbilityActorInfo.IsValid(), then you need to do your AbilityInit logic in the BeginPlay Function<br> | |||
and not somewhere like the constructor(like I did) as adding this line AbilitySystem->InitAbilityActorInfo(this, this); <br> | |||
to the construct will fail because your actor isn't initialized fully yet<br> |
Latest revision as of 01:07, 2 March 2025
Mainly learned from this page https://landelare.github.io/2024/01/15/simple-gas-tutorial.html
The Gameplay Ability System (GAS) Is used Primarily for its Network Prediction, It does provide other uses, however its much simpler to build your own system
1. To Start enable the Gameplay Ability System Plugin
1.1 Restart the editor, and build the project in c++(Note if you do not restart the editor you will have build errors)
1.2 I had issues building with the editor open if you have errors try keeping the editor close while building?
1.3 cannot open source file "AbilitySystemInterface.h"
I was able to resolve the issue by generating Visual Studio project files. I’m not sure why there would be a compiling issue if that’s all it took to fix things, but so it goes. Thanks to Kazuja on the reddit post for running through his steps with me:
Also thanks for starting to assist me here.
To resolve the issue, I opened the project folder within my UnrealProjects directory, rick-clicked on the .uproject, and clicked on “Generate Visual Studio project files”. After reopening my project in the editor and the solution in VS2017, the problem was fixed.
For me I always had to close the editor
2. Add it to your Games\Source\<Project>\<Project>.Build.Cs
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "EnhancedInput" , "GameplayAbilities" });
3. Attribute Set , Create a new c++ class in the editor and Inherit from UAttributeSet, I tried
Creating a new c++ class with empty, than just inheriting from it myself, however, the generated.h
wouldn't generate, and I couldn't use UPROPERTY because unreal couldn't find the class
3.
Notes
If you get the error failed: AbilityActorInfo.IsValid(), then you need to do your AbilityInit logic in the BeginPlay Function
and not somewhere like the constructor(like I did) as adding this line AbilitySystem->InitAbilityActorInfo(this, this);
to the construct will fail because your actor isn't initialized fully yet