Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

RPG Upgrade System?

Hello UE4 Community! I'm relatively new to the community, and to UE4 in general. I know how to do simple blueprint events and scripts, however, I can't find any tutorials on how to go more advanced, at least in the path I'm trying to head. I'm planning on making a game similar to Bioshock or System Shock 2, where you have RPG style upgrades and the like, but also FPS and puzzle elements. The problem I'm running into is the lack of RPG guides, tutorials and anything relating to the subject. I'm looking for something to help with a simple upgrade system, e.g. "When blank happens change movement speed" and "When blank happens change damage variable", things like that. A specific guide isn't needed, just something to build off of, that I could easily turn into something like "When player has picked up blank amount of XP points unlock ability to press upgrade button widget. When button is pressed, change movement speed." Obviously not that exactly, but you get the idea. If you could link me something or show me yourself, it would be very much appreciated!

Thanks everyone in advance,

Sagan (AKA MrGeeky)

Product Version: UE 4.7
more ▼

asked Nov 15 '15 at 01:33 AM in Blueprint Scripting

avatar image

IDHT King42
1 1 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I'm assuming you're only working with blueprint, so I'm going to post the easiest way to do this with that. The simplest system would be to have a "IUpgrade" interface which has two methods: OnActivate and OnDeactivate. Both of these methods should take in your game-specific pawn blueprint. Each skill will be a blueprint derived from UObject that implements this interface. OnActivate will apply the "effects" and "OnDeactivate" will remove them. Your game-specific pawn should have "AddUpgrade" and "RemoveUpgrade" both of which take in the "IUpgrade" interface.The "AddUpgrade" method will add the upgrade to your game-specific pawn's array of upgrades, if the pawn doesn't already have it and call OnActivate." The "RemoveUpgrade" should do the opposite.

more ▼

answered Nov 15 '15 at 01:42 AM

avatar image

554 27 4 26

avatar image Austinlele Apr 24 '19 at 12:57 AM

I know this is real old, but could you or someone explain this a little further? Where do the available skills get stored / how are they pulled in? Why does the interface take in the pawn blueprint, how is that used? Can you possibly post an example? Thanks!

avatar image Nebula Games Inc Apr 24 '19 at 02:53 AM

Seems like the skills are stored in the player character BP, likely initialized with a function that "sets" what skills of all possible skills the player will have available at the start. The interfaces "AddUpgrade" and "RemoveUpgrade" will add and remove abilities from the "unlocked" abilities array or whatever the OP was storing the abilities data in. The interface doesn't "take in" a pawn BP, the pawn BP (or character BP whichever you use) "implements" the interface. So you create an interface in the content browser and then you will "add" the interface in the class defaults of the player character/pawn BP. Once it is added to the player BP you can then script logic inside the interface like you would a traditional function. If you have more questions about interfaces and how to use them check out this tutorial that goes over how to set them up. It is video #24 in the list.


avatar image Austinlele Apr 24 '19 at 02:38 PM

This is just me being slow.. but I'm still not connecting the dots. Might need an example..

"likely initialized with a function that "sets" what skills of all possible skills the player will have available at the start." - I understand what you mean, but what controls whether a skill is active or not? The UObject bit confuses me, is that where the skill logic is? If my skill is "get player pawn and set max health X 2", how does that become active or not?

"Once it is added to the player BP you can then script logic inside the interface like you would a traditional function" - What do you mean by this? Interfaces cannot contain any logic.

avatar image Nebula Games Inc Apr 24 '19 at 03:24 PM

Player A has health and speed "abilities". Health is 100, speed is 10. When the player collects a "Double HP" token the token will use an overlap event to call an interface. The interface will be the "Health PickUp" interface implemented in the player character. Once the interface is called the "logic" inside the interface within the player character will do something like this:

  1. Get player Health

  2. Multiply player health x2

  3. Set Player health

Player now has 200 health points instead of 100. As for what skill are "active" normally something like health I would expect to be "active" always, but something like a "flying" ability may be temporary. So when the player picks up a "flying token" that can fire off a different interface that instead of doubling health like we did in the prior example it instead sets the character movement state to "flying" from "walking", waits for 10 seconds and then sets it back to "walking". Now you have a "temporary" ability. Honestly there are a million ways to do a "skill system". This is all theory, I have no idea what specific skills you want, what their effect will be, permanent or temporary etc so it is hard to explain with so little info. It is highly variable based on your game and its mechanics.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question