EntityColor

Blitz3D Forums/Blitz3D Beginners Area/EntityColor

_PJ_(Posted 2016) [#1]
Graphics3D 1024,768,32
SetBuffer BackBuffer()
AmbientLight 128,128,128

cam=CreateCamera()
MoveEntity cam,0,10,0

l=CreateLight(cam)



Type FIRST_LAYER
	Field ent
End Type

Type SECOND_LAYER
	Field ent
End Type

Global MASTER=CreateCube()
Local Arbitrary#=2.0
ScaleEntity MASTER,Arbitrary,Arbitrary,Arbitrary,True

For f= 1 To 25
	Local T.FIRST_LAYER= New FIRST_LAYER
	T\ent=CopyEntity(MASTER)
	EntityColor T\ent,255,0,0
	PositionEntity T\ent,(f*4)-50,0,20,True
	
Next

f=0

For T=Each FIRST_LAYER
	Local S.SECOND_LAYER=New SECOND_LAYER
	
	S\ent=CopyEntity(MASTER,T\ent); COMMENT
	EntityColor S\ent,0,0,255 ; Why not blue?
	PositionEntity S\ent,(f*4)-50,0,25,True
	
	f=f+1
Next

While Not KeyDown(1)
	RenderWorld
	Flip
Wend


When I remove the comment (; COMMENT) the blue blocks are coloured blue. Otherwise, the EntityColor S\Ent,0,0,255 line is skipped...

I suspect this may be an issue with IDEal?


Floyd(Posted 2016) [#2]
Do you see this if you copy/paste the code from your post above?

My guess is that your original code is somehow missing an end-of-line marker after the ; COMMENT so the next line is still part of the comment.


_PJ_(Posted 2016) [#3]
The above is an exact copy from the problem code - that's why it didn't make sense to me.

It seemed to work just fine when I recopied & pasted into B3D itself (from the original code even, not from the above).

Must have just been ideal having a glitch. I had a large project open so maybe memory or something?

The only reason this snippet existed was because I was separately testing something to do with EntityParent and EntityScale which seemed to behave oddly - this "oddness" too cleared up after I restarted the whole computer.

Either way, it's certainly not Blitz or a necessarily reproduceable issue. If anything like it happens again I should refrain from posting till I have investigated a bit further !


RustyKristi(Posted 2016) [#4]
Yes, looks like it. copied it and run no changes w/ or w/o comment


jfk EO-11110(Posted 2016) [#5]
I had strange issues when xp run out of ram. Apps just end, and mav for no reason, or textures missing etc.

Probably an OS issue, tho new to me. Probably since dotnet4 deinstall? Just hope it's not malware.


Dan(Posted 2016) [#6]
there are 2 blue and 2 red bars. is this the wanted behavior ?