Hello, I am trying to make a checkpoint set the corresponding image in the main menu,
when you are selecting to LOAD GAME you would see the map u last been in.
how can I do that?
I’ve never tried this, but I’m assuming you can have an array of textures in the save game. And you write to those textures using render targets?
Ok, I just tried it. It does work. I wouldn’t put what I have up here, because it’s a total mess, but it’s along the lines of
-
I put a scene capture component in the player, attached to the camera ( I only did this to get it working, but in the long run you can spawn one, and then destroy it ).
-
You can make it take a shot, which gives you a render target
-
You save the render target in the save game
-
You can then make a widget with images which reads the save game
That last bit sounds easier than it is. To set an image in the widget you need to set the brush with a material. And that material just has a single texture connected to the output. And you can change that texture to a render target from the save game using a material instance. ( phew ).
After that, it can be quite easily generalised to use an array of textures / widgets.
Tell me if you get anywhere with it…
Thank you for the reply,
it’s not exactly what I was trying to achieve but kinda yeah.
what I meant by “you would see the map u last been in.”
as in a preselected picture…
so as an example
I have 10 Levels and 10 Images
and if I enter Level 1 I would like the " blank image " in the main menu widget to change to an image of Level 1 that I already have saved.
from your example, I understand you want me to take a screenshot from the player view.
so anyway, all I am trying to do is
Start New Game ( make a new save ) → Change the blank image in the main menu to one with that “NEW GAME” Level.
when I enter LVL 2 → Change the Image to LVL 2 Picture.
how would I go about doing this?
my current problem is that my “Save Game Object” doesn’t exist until I load into a level
then I can go back to the menu and it’s valid.
so I did make it kinda work but only once I get the save game object working.
Ok, much easier
You just pre-make the buttons in the widget and hide them.
When the player completes or starts a level, raise a counter in the save game by 1.
Next time you show the widget, you can use a loop ( up to the save game value ), to reveal the buttons.
Okay I will try that,
but I see it needs my save game object to work from start…
any idea how to make it valid from/since Main Menu?
the “is valid” checks if “SavegameObject” is Valid
when I open the game the first time it’s not Valid
Basically, I can’t read any variable from SaveGame in the MainMenu.
but
I can when I have already loaded a level before (until I Reboot game )
When you open the game first time
When you open level and return to Main Menu
I don’t know how you’ve got the save game setup there, but you can read it anywhere at anytime. I will drop a bit of code in tomorrow, but have to go now…
okay no problem, thanks for the ideas from before,
bye
I got it to work, I did it differently though… but it works,
I might leave solution here tomorrow… going to sleep lol…