How do I Select a Range of Array Values

Get help using Construct 2

Post » Wed May 21, 2014 10:26 am

Hey there, I am trying to setup my maps so that they will select certain values along X and spawn enemy monsters accordingly. I just cant figure out how to select a value 10 through 15 along X and then spawn and load their instance variables based on the values in Y for each X. If that makes sense.

Basically, I just wanna be able to control which monsters spawn from my array. Can anyone point me in the right direction?

Thank You,
Stephen
B
56
S
15
G
13
Posts: 826
Reputation: 17,665

Post » Wed May 21, 2014 2:51 pm

You need a basic "for loop", with the starting and ending indexes set to something like 10 and 15. Then you create your monster instances, and set there variables using the Array.At expression. (Array.At(loopindex, 0), Array.At(loopindex, 1), Array.At(loopindex, 2), etc.)
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Wed May 21, 2014 11:12 pm

@Magistross This is what I am trying to make work so far. Unfortunately it just keeps spawning the same monster over and over again.
You do not have the required permissions to view the files attached to this post.
B
56
S
15
G
13
Posts: 826
Reputation: 17,665

Post » Thu May 22, 2014 12:11 am

Finally got it working. I'm going to nap now, my brain is fried.
B
56
S
15
G
13
Posts: 826
Reputation: 17,665


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Jackriduk and 25 guests