Endless flight game

Get help using Construct 2

» Sun Feb 02, 2014 1:28 pm

@LittleStain
[QUOTE=me]Now the next step is to make many tilemaps and bring some random tilemap as I mentioned on the earlier thread.I can't seem to find how pick a random tile map and get its name or UID.[/QUOTE]

:)
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

» Sun Feb 02, 2014 1:36 pm

The next step seems to be asking someone else to do it for you.. :P
This can be done in faster ways but just so you can learn I'll explain it in a way you can understand.

Create a global variable, let's call it NextMap

Event:
map1 <-240
or
map2 <-240
or
map3 <-240

etcetera

action:
set global variable NextMap to floor(random(0,10))
subevent:
if global variable = 0
- create map0
if global variable = 1
- create map1

etcetera.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

» Sun Feb 02, 2014 3:21 pm

@littleStain
Before proceeding to multiple tilemaps,There's something left;
Tile maps of different widths.
I have made a capx and it's working,thanks to you.
https://dl.dropboxusercontent.com/u/260388836/My/test.capx
I just replaced the numbers with self.width etc variables.

So your code above may need some changes.Could it be replacing the -240 with self.width?
What is the floor thing? and why did you choose o and 10?
Doc Ai2014-02-02 15:24:30
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

» Sun Feb 02, 2014 3:27 pm

0 and 10 are just numbers I chose, they would mean you have 10 maps.

floor means rounding down. 5.4 = 5 , 6.7 = 6 etcetera.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

» Mon Feb 03, 2014 4:44 pm

@LittleStain
Your method does not work for tiles having different widths.
Here's an example:
https://dl.dropboxusercontent.com/u/260388836/My/Harrypotter.capx

3maps of different widths

I picked a random map from map1 and 2,(Starting map is 0)
And kept it at the end of map0.So map zero is now dead,I don't want it to come ever again. :) -Just starting map-

Now the main problem.Please have a look at the capx file.I have tried using functions in vain.Doc Ai2014-02-03 16:44:56
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

» Mon Feb 03, 2014 4:54 pm

Ok, you've kind of made a mess out of it..

I'll see if I can fix it in a way that you can actually understand what the events are doing..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

» Mon Feb 03, 2014 5:18 pm

Ok got it working. Changed random with choose, so in the future you can have some maps happen more often than others.

This should work
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

» Mon Feb 03, 2014 5:28 pm

@LittleStain You are using the beta version while I am using the stable version,cannot open it :(
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

» Mon Feb 03, 2014 5:32 pm

I always use the last beta, because I want to be able to open every file on this forum..

You can find it here..

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

» Mon Feb 03, 2014 5:36 pm

@LittleStain
It would take sometime to download it again. :( it's also getting mid night.
So can you please take a screen shot of the events :)
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

PreviousNext