x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do I make bots spawn continuously.

Hi, I'm working on a level and I want my bots to continue spawning while the level is active, but stop once a certain amount have spawned, but then spawn more once bots die so there is almost always the same amount of bots in the level.

And I want them to also spawn randomly from target points set up in the level. I have managed to set up some target points but when the spawn event starts a bot spawns at each point at the same time. this wouldn't be so bad if I had the rest working to keep spawning new bots.

Any help would be greatly appreciated, I know this is probably something really simple that I'm missing, but I just can't seem to find anything.

Product Version: UE 4.8
Tags:
more ▼

asked Aug 20 '15 at 05:46 AM in Blueprint Scripting

avatar image

dylan lindley
10 2 3 6

avatar image behrtron Aug 20 '15 at 02:48 PM

Im sorry i read your question about random spawn points incorrectly, i havent set something like that up yet but i would go in the direction of using a get random integer in range and have it be set from 0-how everany spawn points you have and have it randomly select one of them

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The way i had gone about this, is going into the level blueprint of the world you want them to spawn, and dragging off event tick, if you want some time before they spawn put a delay first then, use spawn actor from class functions so every frame the actors are spawn, which gets overwhelming so i suggest using a delay

more ▼

answered Aug 20 '15 at 01:19 PM

avatar image

behrtron
57 1 3 6

avatar image behrtron Aug 20 '15 at 01:24 PM

To make them randomly spawn you get "actor location" then drag off that and get "random float in range" and plug that into a the vector location, i usually use 1-800, you make integer variables for the spawn limiting, like "current wave" "amount spawned" "max per wave" and use truenor false statements to judge whether they should continue spawning, " if amount killed is equal to or greater than maxperwave then dont spawn if true, set amount spawned and amount killed back to zero and current wave to current wave plus 1.

avatar image dylan lindley Aug 21 '15 at 02:47 AM

hey thanks for helping. can you show me a screenshot of how you do the spawn limiting? i cant quite figure it out without a graphic of some kind.

avatar image behrtron Aug 21 '15 at 03:00 AM

Sure ill take one as soon as im able to

avatar image dylan lindley Aug 21 '15 at 03:35 AM

thanks so much :)

avatar image behrtron Aug 26 '15 at 04:02 AM

So, you need 3 Integer Variables, i named mine, "Enemies Spawned" "MaxEnemiesperWave" and "WaveNumber" in the beginning of the event tick i set enemies spawned to however are spawning in each tick, so if you have 6 spawning every tick like i do, then set enemies spawned to 6 every time, and then i have a branch true or false statement, if the amount spawned is equal to max amount then, set next wave which is when i set the enemies spawned back to 0, increase the allocated amount per wave, and set wave number to "wave number + 1" i also add a 40 second delay because i want to give the player some time to kill the remaining enemies before more are going to be spawned, but if its false and the max amount is not reached yet then you drag off the false pin and hook up your spawners. be sure when you do the true or false you use >= and not == because if you spawn more than the allocated amount on == then the event will not register because its not perfectly equal, i hope this helps and if you have any more questions feel free to ask, i'm not a pro and this isn't the only way to do it, this is just how i managed to.

Spawn Limit Screen Shot

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question