Shared stats for player and npc?
Hello all, Firstly, my apologies if this has been asked before but i haven't been able to find any info on this specifically.
In my mind and through my sketching I envision being able to create a core set of rules that all characters (enemy, npc, player) could pull from and use. I would break this up into sections that would be used or not used depending on the character. Let me explain.
All characters would have health. Player, npc & enemy. So this would be in a base universal set of variables (not sure where it would be stored) Next would be stats like strength, agility and charisma. These would be held in another pace but useable by npcs and player not needed for enemies.
Then there might be a few variables that are only needed for the pc such as reputation or faction like/dislike.
I would love to set up a check box or select variable (is pc, is npc, is enemy) to derermine what other variables are needed.
So my question is, what would you recommend as the best method to store this info and how would i retrieve it for the different pc,npc, enemies etc.
In a perfect world i see it as being able creating a new npc as a duplicate pawn then edit there variables to what is suitable (warrior had more strength than a wizard etc.)
It would be a great template system to easily create many npcs and enemies that are needed in an rpg. If anyone is familiar with the elderscrolls construction kits you may know what I mean.
If anyone can point me in the right direction I would be very grateful.
Thank you all.
asked Sep 27 '17 at 11:47 PM in Blueprint Scripting
What you've described is the very core of OOP.
Start with a base class that has all the shareable functionality, you can extend from that class to create children with unique variables and functions.
answered Sep 28 '17 at 09:00 AM
Ha ha, sorry Everynone. I thought your handle was newest but obviously that's post related.
answered Sep 30 '17 at 02:16 PM
Hmmm, I think I'm doing it wrong. As a test I set my Player Name to a variable
Then in my CorePlayer_Behaviour Actor Componant I tried to add the set text node but when I add the playername variable it requires a target. I thought that would be the player character but nothing I put there works.
Is that because I need a function like you put in the UMG? or do you think it is because I'm trying to call it from the actor componant and not the player BP?
answered Oct 01 '17 at 12:58 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here