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 Would I Spawn in 10 of the same actor but with a random delay for each spawn?

So i'm trying to recreate one of my favorite skills from an old game i used to play, Battlefield Play4free. I'm trying to recreate the Mortar Strike Skill which allowed the player to use a pair of binoculars and target a random point on the map, but with in a certain range of the player. I've got it so that it spawns in the number i want but their all at once. I'm trying to figure out a way to have it kind of random in terms of spawning them in. like between (half=0.5 seconds) and a (full=1 second).alt text

Product Version: UE 4.13
Tags:
question.jpg (604.6 kB)
more ▼

asked Oct 22 '16 at 09:10 AM in Blueprint Scripting

avatar image

RytenGaming
1 1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

If I see this correctly, the SpawnMortarFunction spawns one mortal per call.

So you could just add a "delay" node in front of it with a "RandomFloatInRange" node in Front of it. Then the air strike is between 5 and 10 secounds.

Or do you want them all 10 spawned between 0.5 and 1 sec, so the air strike take maximum 1 sec?

Then you could ad a delay of 0.5 secs in front of the loop.

After that you need a new variable called "Maximum Remaining Time" or so, set it to 0.5 secs default.

Now you place a delay node in front of the MortarCall with a random float in range from 0 to MaximumRemainingTime. Of course you have to substract this random value from the MaximumRemTime float.

Is this what you are looking for?

more ▼

answered Oct 22 '16 at 09:27 AM

avatar image

Speckulous
525 22 10 34

avatar image RytenGaming Oct 22 '16 at 10:02 AM

alt text

So you mean Something Like this?

question.jpg (615.6 kB)
avatar image Speckulous Oct 22 '16 at 10:04 AM

yes, does it work?

avatar image RytenGaming Oct 22 '16 at 10:14 AM

Sadly no, I tried that earlier and it won't even spawn the mortars then. Unless i'm missing something? The way i want them to spawn, the total time would be like 5 seconds or so to drop all 10. i just don't want them all to fall at the same time. And not in 1 sec that's for sure. haha

avatar image Speckulous Oct 22 '16 at 10:26 AM

Hmm.. try to print a lot of things between the delay and the spawn, like the current number of mortars, their location, the result of the random float, I dont know, just everything, somewhere should be an unexpected value

(comments are locked)
10|2000 characters needed characters left
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