Checking if Function.Param is the start/end of an Array

Get help using Construct 2

Post » Sat Apr 05, 2014 10:09 am

I'm trying to create a Random Dungeon, and I'm failing at the first step.

I've got an array that represents the Dungeon and the cells are the Rooms. When I place a Room, I check to see if I should put an exit in that direction (the value of the adjacent cell is 0 and we aren't at the start/finish of the row/column). If the conditions are met, I modify the Room value at bit level so that the room has an exit on that direction.

I think I'm doing it right, but I'm clearly not. I've tryed introducing some values at hand on the array and calling the function to check the surrounded cells, and if the start/finish conditions are commented, it works.

The .capx is commented and the names are self explatanatory. I'd appreciate if someone could check the .capx and let me know what I'm doing wrong.

Thanks in advance.
You do not have the required permissions to view the files attached to this post.
B
7
S
2
G
2
Posts: 25
Reputation: 1,910

Post » Sat Apr 05, 2014 2:41 pm

In the 'Function: Compare parameter' condition you just need to use the index of the parameter (0 or 1) and not 'Function.Param(0)'.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Sat Apr 05, 2014 5:00 pm

Thanks, I knew it was going to be some stupid mistake.
B
7
S
2
G
2
Posts: 25
Reputation: 1,910


Return to How do I....?

Who is online

Users browsing this forum: stevenode and 11 guests