Type Confusion (Again)

Blitz3D Forums/Blitz3D Programming/Type Confusion (Again)

fireshadow4126(Posted 2009) [#1]
I am using a type for my game like this


which works well, but I want to have multiple bullets at once.
so I made an array of this type.
The only problem is with positioning the model. I position it randomly, using a
FOR...NEXT
loop, but when I run it, all the bullets are in the same position.
HELP!!!
(btw: I did call
SeedRnd Millisecs()



Warner(Posted 2009) [#2]
Can you show the part of the code that creates and positions the bullets?


fireshadow4126(Posted 2009) [#3]
sure




_PJ_(Posted 2009) [#4]
Okay, the problem is that you are assiging the Type 'Mode' entity for each Type instance to the same "bullet mesh"
easy_bullet(i)\Model = bullet_001_mesh


So all of your Bullet Tpe instances will refer to the same actual 3D model.

I'm not sure on why you have so many different bullet meshes, or if that's even relevant for this problem, so assuming you DO want all your Bullet types so far to have an entity that appears as a copy of "Bullet_001.x", Then simply ensuring the Type field of "\Model" holds its own copy rather than the actual Bullet_001 mesh should do the trick:


Just change the line I quoted above to:
easy_bullet(i)\Model = CopyEntity(bullet_001_mesh)



fireshadow4126(Posted 2009) [#5]
tnx Malice