Executing blueprint/c++ without placing in world

Is there any way to execute blueprints/code without it running in the world? For instance, if I wanted to read from a file and store settings or information, what would be the best way of doing that?

For writing file I/O add a code (.h & .cpp) to your project and create a static function that is blueprint callable. Then you could call it almost anywhere in other blueprint, like this answer.

For running a blueprint without putting it in the world, you can use the “SpawnActorFromClass” for calling a blueprint to be run.

Inside your BP you can use a the SaveGame Nodes. It’s something like
“Save Game To State”. It’s really easy to set this up and you can find
a short Tutorial on Youtube. Please search this yourself. (:

For c++ you can use the thing yRezaei posted.
Although i think spawning an Actor is adding him to the scene.

I don’t know if there is another way. You could set the lifespawn of the
spawned actor direct to 0.1, so that it is destroyed right after it was
spawned and used. But i don’t think that this is what you are searching for.

Alright. So I basically just need to call my functions from other existing actors in the world. That makes sense for how UE is structured. Thanks.