Possible Bug Thread

New releases and general discussions.

Post » Sun Mar 08, 2009 4:08 pm

I don't know whether the Devs agree, but rather than filling the forums with multiple posts, and the bug tracker with bugs that aren't bugs, it may be a good idea to have a thread like this to allow others to confirm people's bugs before they are added to the tracker.

As an ex Beta tester, I know this approach can save the Devs a lot of time, with a lot less "non-bugs" appearing on the tracker.

I'd like to start off with the possible bug that I posted earlier today:

[size=150:3tupti01][color=#BF0000:3tupti01]"On Bounce" not triggering in car behaviour.[/color:3tupti01][/size:3tupti01]
Can someone confirm this please.

Sponge.
B
2
S
1
G
3
Posts: 105
Reputation: 1,310

Post » Sun Mar 08, 2009 4:11 pm

[size=150:1urjugyl][color=#BF0000:1urjugyl]Custom image not working with MiniMap[/color:1urjugyl][/size:1urjugyl]
I can't seem to get an image to work as a backdrop for the MiniMap object.
I'm using a PNG file, and I haven't tried other formats yet (will do later).
Can someone confirm please.

Sponge.
B
2
S
1
G
3
Posts: 105
Reputation: 1,310

Post » Sun Mar 08, 2009 4:26 pm

Another image beneath the MiniMap and set the minimap as transparent?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sun Mar 08, 2009 7:43 pm

[quote="Mipey":3cvv6znq]Another image beneath the MiniMap and set the minimap as transparent?[/quote:3cvv6znq]
Yeah, that works...



...but there's an option in the MiniMap to load a bitmap directly into it to get the same effect, which doesn't seem to be working.

Sponge.
B
2
S
1
G
3
Posts: 105
Reputation: 1,310

Post » Sun Mar 08, 2009 7:47 pm

I believe that is for minimap points/objects rather than the background.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sun Mar 08, 2009 8:34 pm

[quote="Mipey":6zuapgoa]I believe that is for minimap points/objects rather than the background.[/quote:6zuapgoa]
You're absolutely right!
I've just checked this, and it works.

This is why this thread was a good idea.
That's one "bug" that isn't cluttering up the tracker.

Cheers mate.

Sponge.

[color=#0000BF:6zuapgoa]EDIT: It's a shame that there's a time limit on editing posts.
I'd like to go back and update the earlier post, showing that it's not a bug, but "User Foo" instead.
That way, this thread could also be a good source of common problems new users have, and new material for the FAQ.[/color:6zuapgoa]
B
2
S
1
G
3
Posts: 105
Reputation: 1,310

Post » Mon Mar 09, 2009 11:21 am

I'd say generally if you do have something which users may mistake as a bug, then you should add it to the FAQ.

In this case, clicking the property in question shows what it is intended to do, which should be clear enough if you have doubts over why it isn't working.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Fri Mar 13, 2009 3:37 pm

[size=150:wr3kfd7l][color=#BF0000:wr3kfd7l]Using a Global Variable as a range for a random number produces a floating point number[/color:wr3kfd7l][/size:wr3kfd7l]

I'm sure this is a bug, and it was bugging me for ages, until the penny dropped.

I'm using Global variables "SizeX" and "CurrentCellX", and I'm only using integer calculations throughout, but I wasn't getting conditions firing when comparing CurrentCellX to an integer, and the debugger revealed why.

Having set "SizeX" to 10, and then setting "CurrentCellX" using

Set "CurrentCellX" to random("SizeX")+1

the debugger showed that "CurrentCellX" was producing values like [color=#0000FF:wr3kfd7l]2.09159510755603[/color:wr3kfd7l] and [color=#000080:wr3kfd7l]3.46251876045338[/color:wr3kfd7l]

So it looks like using a Global variable as a range in the random statement produces a floating point value.

Could someone else confirm this please.

Sponge.
B
2
S
1
G
3
Posts: 105
Reputation: 1,310

Post » Fri Mar 13, 2009 4:39 pm

I don't think it's a bug. Random() generates a float if you pass it a float and an integer if you pass it an integer. If the global variable contains a float, random() will generate a float. Using integer only calculations is not guaranteed to result in an integer. For example, 1 / 3 gives 0.33333... instead of 0. If you want rounding, you should explicitly use int(), round(), floor() or ceil(). I believe this is more useful behavior (since you can't calculate a ratio with a / b if both are integers, you get 0 with integer division).
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Fri Mar 13, 2009 6:23 pm

Yeah, INT works, but what I couldn't understand was why it was throwing back a float when there was no divisible maths going on.

In fact, just creating a new cap with Global variables "CurrentCellX"=0 and "SizeX"=10, and the statement:

"CurrentCellX" = random ("SizeX")+1

will produce floating point numbers like 4.22801958731946 every time, without any other maths going on.
Is that expected behaviour?

I suppose as long as people are aware of it, it'll be ok, but I wouldn't have thought that floating point would have been used until it was forced to by maths that involved or resulted in a floating point value.

Sponge.
B
2
S
1
G
3
Posts: 105
Reputation: 1,310

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests