I have a question:
I have a formation Actor which contains several characters, and I want to customize characters positions,
Ideally I would like to drag my formation in editor then arrange the positions, but I don’t want them to spawnwhen i hit a play button, but only when a certain condition happens - lets say a trigger box triggers an event.
Is it possible ?
Hey Bizmark thanks for your answer,
Yes this is kinda a work around solution, my will is to be as generic as possible.
I don’t want to make a Formation BP for each formation on the map.
I would to have 1 formation class with Characters.
To put it’s instances on the map and arrange Characters in the editor - in multiple places - however I wouldn’t spawn them on begin play - since I have hundreds of Characters to save a performance.
I also aware that I can spawn them but just set em inactive and invisible until the Trigger event - however I don’t know if ti will save 100% of resources (well I don’t care about RAM) - when Characters are deactivated - they are still animating so it seems like - it doesn’t save resources 100%
What I have now is exactly what you described:
“However if I wanted to place them manually within the actors bounds I would create vector parameters for each that is exposed and shows it’s widget and tie the spawn points to that as you will be able to drag those around and set the location from the editor.”
I put a Cones on the map and spawning them like this → but this is quite a No-Go in terms of ease of use - since I will have a lot of levels.
And I don’t have a will of arranging Cones and then referencing each of them - But if it is the Only way → I guess I will have to live with this.
Anything is possible!
Not knowing exact behaviour you are after it’s a bit hard to tell you what to do so forgive me if this doesn’t quite answer your question.
First of all, I would do all my location setup in the construction script as it will update outside of play and you will be able to make updates within the editor view. If I was making say a regiment generator where a small group of guys will spawn within a predetermined volume, I would simply set their spawn points to a grid that is set based on bounds and math (area of the actor / number of units). However if I wanted to place them manually within the actors bounds I would create vector parameters for each that is exposed and shows it’s widget and tie the spawn points to that as you will be able to drag those around and set the location from the editor.
The second part of your question sounds like you already kind of know what to do, either through a custom event or a function that you can call externally, you can trigger the spawn to happen whenever you want. Just be aware that spawning is expensive and if you are spawning a lot of actors at once you might suffer some performance penalties.
Hopefully this points you roughly in the right direction.
If you’re starting out in game development, one of the common pieces of advice is to create a basic game. This is because it teaches you how to create simple mechanics and how objects interact with each other.