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"

Using a for loop with a number of triggers

Is it possible to create a number of triggers and then use a for loop to select through them, referencing them by the index number? Or use a random integer to select a trigger. I want to spawn objects randomly from about 10 points at different times. Should i even use triggers for this? Thanks ^_^

Product Version: Not Selected
Tags:
more ▼

asked Apr 08 '14 at 05:50 PM in Blueprint Scripting

avatar image

KaladinRahl
48 6 13 13

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

2 answers: sort voted first

Hey KaladinRahl,

I would have to ask. What is the Triggers for? Initializing the spawn or does it have an effect on the location where the objects randomly spawn?

Peace

more ▼

answered Apr 08 '14 at 06:00 PM

avatar image

PeterLNewton
2.1k 75 37 111

avatar image KaladinRahl Apr 08 '14 at 06:43 PM

Initializing the spawn.

avatar image PeterLNewton Apr 08 '14 at 07:38 PM

So once the player enters a trigger volume, you then want to spawn Objects around the area of the player. You also say at different times, so did you want this to be sequential or randomly after the time they enter the volume.

avatar image KaladinRahl Apr 08 '14 at 08:00 PM

sorry, i read your question wrong. I am using them for the location of where they spawn. I want the a random amount of objects of varying quantity to spawn within a certain time frame, say 10 seconds, but at random times during that time frame until they have all spawned.

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

My suggestion is using the Get All Actors of Class node and then pull out the Trigger class you used. Use a ForEachLoopWithBreak node and that will get you the Triggers. Break when you want to stop. If you want it to be random, you can use the Length array node, link that to Random Integer node. Link that Get array node and get Actors Location node then spawn the others Actors from there.

Here is a quick snippet from my Spawn Player Blueprint Function. alt text

more ▼

answered Apr 10 '14 at 07:35 AM

avatar image

PeterLNewton
2.1k 75 37 111

(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