Multi Question Thread

Alright, I Put off asking this as long as I could, after trying to figure it out on my own, with not as much direction as I’d like beyond wiki.

I feel like I need to ask how I achieve my objective.

Break down: When the player harvests a resource or item, I want it reflected on a gui element, rts style.

So if you’re harvesting a rock, I want the amount of owned to increase by x amount, and be shown on screen for example start with 2500, harvest resource the screen will show 2501.

In all honesty, I have probably overlooked something, or missed something. Thank you for reading and help.

To prevent Spamming, I intend on making new posts in this thread when ever something comes up that i might need help with.

Do you mean to create something like the “Targets Eliminated” element of this tutorial (scroll down towards the end)?

~ Jason

What i’m trying to make happen is your part of script where it will draw the numbers of enemies to the hud, and as you kill them, reduce them, 3,2,1,0, The exception being, when my player interacts with this world object, the amount he already has, get’s updated. player starts with 200 cubes, then player picks up a cube in the world, he now has 201 cubes shown on his hud, and the world object has reduced it’s count by 1.

So my overall goal is
spawn world object, with 5 resources
player interacts with world object, his resources are then increased or deceased accordingly
player’s amounts drawn to hud, and updated as world object is interacted with, having it’s resources reduced.

hopefully i have not over complicated this. I am still trying to understand how to make blueprints talk to each other.

@Tallahlf:

I have to go to sleep now, but I made a quick video (without sound) to show you, how you could possibly set it up.

Note: I just dragged my resource actor into the level. If you want to spawn it, just use the “Spawn actor from class” node and it should be useful to you :).

Hope I could be of some help.

Thank you so much for making the video, it’s more than I ever expected, I will give it a long studious watch and see if i can learn what you was trying to teach.

@DarkGodsLair

So far it has seemed to work with my implimentation, I really appreaciate your help, I’ll post gifs later of things working.

On an unrelated note

Regarding storing variable values, I read some where that if you were to store all your values on your character blueprint, then if that character dies, then their values are reset, I’m curious about what the best approach to handeling values persisitng on character death. Would I want to make a save game situation, or would i store my relevant values in gui widget at all times or what would a solution be for the future.

I’m thinking some kind of quick load data approach, The game makes a save at the death event, then reloads it on respawn, and deletes the last values stored so it’s always fresh. Not sure How I would approach this, will research it further though.

http://imgur.com/a/YuJS8 Imgur Gif

Thanks
~

Or I think you can set them in GameInstance

@Raidance37k

I didn’t think about game instance. Thank you for the idea, I’ll see what I can tinker with and see what comes out.

Hey guys, been a few days since I posted, I’m back at it, and seem to be having a common problem with all the project i create, and that is making blue prints talk to each other. I use the cast function as often as I can, How ever, I’m always hit with the object wild card “What is casting to what” essentially. In this instance I want a workshop to talk to a hud and say “I’m spawned, I have a worker, I’m making this” then as the widget gets that message, if all of them are true, then I want the widget to update accordingly. Tricks? Advice? I’m thinking I should create self references? Though that bring the potential of “this does not inherit from this, and will always fail”