Question about function message from console

Discussion and feedback on Construct 2

Post » Sat Jul 06, 2013 2:19 am

Hi,

I wander what this means:

[Construct 2] Function object: in function 'mapgen', accessed parameter out of bounds (accessed index 0, 0 params available)

I see it in the console. At this stage function 'mapgen' shouldn't be active, but because I don't understand this I am a bit confused. Could someone explain this?

Thanks megatronx2013-07-06 02:19:49
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Sat Jul 06, 2013 2:25 pm

It means you did this:

Call function "mapgen" () (as in, with no parameters)

Then 'On function "mapgen"', you use Function.Param(0). This is probably a mistake because there weren't any parameters passed to the function.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Post » Sat Jul 06, 2013 2:51 pm

Hi, thanks.

So this is a mistake on my part, yeah? I don't know what it might be. At this stage I'm already passed 'mapgen' function and I'm calling other functions.

However maybe 'mapgen' function is on infinite loop? It's currently looks like this:

function 'mapgen'
   - do something
      -if conditions match then call function 'mapgen'

Any suggestions how I could stop that if in did it could be on the loop?

Thanks
megatronx2013-07-06 15:10:42
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Sat Jul 06, 2013 3:17 pm

'mapgen' always needs a parameter, presumably. It would be easier if we could see the code.
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Post » Sat Jul 06, 2013 3:32 pm

Hi, sure, I will pm you the code.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Sat Jul 06, 2013 4:01 pm

It's your debug code! In "New Location" you are calling this for DebugText2:

Location.UID & " " & Location.LocationState & " " & Function.Call("MapGen") & newline

There are no parameters on this call to MapGen.
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Post » Sun Jul 07, 2013 4:19 pm

Hi, Thanks for help! :D

Sorry for late replay but my network died for whole day yesterday!
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099


Return to Construct 2 General

Who is online

Users browsing this forum: Nizzara and 10 guests