Spaceship Building Game

Thank u so much. That worked.
Im so happy about your help.
And i think that wasnt my last question :sweat_smile:

1 Like

I have the pathfinding behavior on the hitbox and the obstacle behavior on the asteroids but the hitbox dosnt avoid the asteroids right. sometimes the hitbox touches the asteroids. tryed to change the extra border but that do not change anything dont matter wich value i take for the extra border

The empty event is already deleted

Yeah. I tested it with mixed results. IDK how large your ship would be compared to my test ship. So, IDK if you’d have a similar experience.

Try playing with the pathfinder grid size. Try larger and smaller numbers. I’ve never played with the turn speed. I’d try that as well. It’s not always precise and makes weird turns.

If I play with it later, I’ll post any fixes. You might need a different strategy for the movement.

Yeah playing with the Pathfinder grid size works well. Didnt found the perfekt value yet but i think that works.

Thank you again. :slight_smile:

1 Like

I need your help again.

I want to save the builded Ship so i can load it next time i start the game ive watched the tutorial for saving and loading but i dont get it really how to do it.

I want to save it if i click the SaveShipButton

And when i click the LoadShipButton the next time i open the game the ship should get loaded.

Im not going to be on my PC for awhile. You have most of the needed things. It’s just a matter of saving and loading the ShipData variable.

This is from a different thread. There’s not much info in that thread, that’s why I’m not adding a link to it . You don’t necessarily need to use the in the beginning condition that was just part of the example . The lines wouldn’t also be sequential. Theyd be in the appropriate section.
.

I think the toughest part is going to be finding the actions. They’re mostly in the other action section.

You need to make sure you’re using the right actions that match the variable meaning global or scene.

To save:
You need to convert the ShipData into a Json and put in a string variable. Then put that string variable into storage.

To load:
You set a string variable to the string saved to storage and then covert the string from Jaon to the ShipData variable.

This should point you in the right direction. If you get stuck, someone can help or I can check the forum later tonight.

This is how i set the saving and loading up but it didnt work

I’m still not at my PC. Make sure the variables match the save looks like a mix of scene and global.

I think it should be
write GlobalVariableString(tempShipData) …

I can’t really tell if the read events all match. The little icons for scene and global are so small.

How did you make out? I’m finally on my PC. I converted everything in my test project to use storage.
I combined the save event to 1 line. There’s no reason to use an extra variable except that it makes it easier to understand.

To save:
image

I used Ship1 because I envisioned saving multiple ships or slots.

To load from storage
image

I used nothing but scene variables to keep it simple for me.

I changed all reference form reactor to the Hitbox. I added the reactor to the group object and it’s treated like an ordinary block.

Just tryed it out. So when im in Game the saveing and loading works. But when i Close the Game and want to load the Blocks didnt Show Up. Maybe this could be because im at the mobile Version atm. I try it again when im back from work

I don’t know how the mobile version works. Maybe for mobile it needs to be published. You would also lose everything if the cache was cleared. You might need a different storage system. IDK. This is the only one I’ve used.

This is my current version. I think it can be optimized a bit since it was switched to use storage.

Project:

How can i open that? Just Download the json and the Asset file ?

Maybe because of this Part i have to force the reactor block to load at First?

At your Version the loading works also on my Phone.

At mine not. It only loads the reactor block. And i dont know why the camera jumps at loading.

Click the green code button and click download zip. Then exact it and open the json file with Gdevelop.

I reworked my version to make everything stick to the hitbox. I left it visible to make it easier to test it.

Okay i’ll take a Look on it when im back on my pc

Just found out If i click the Delete Ship Button first and then load the ship it works.

But i dont know why it dont work when i only click the load Button because it also delete the Blocks first.

Okay when the delete actions are a subevent of the Load Button it works

1 Like