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: 825
Reputation: 17,643

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
67
S
28
G
24
Posts: 970
Reputation: 18,675

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: 825
Reputation: 17,643

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: 825
Reputation: 17,643


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Casimir, tarek2, Yahoo [Bot] and 11 guests