Entity does not exits

Blitz3D Forums/Blitz3D Beginners Area/Entity does not exits

AJ00200(Posted 2009) [#1]
Gives an entity does not exist error.
(yes, the picture loads find, but position entity crashes the program)

p="ph\DSC018"
s=".JPG"
Dim still(27)
still(0)=LoadSprite(p+"49"+s)
PositionEntity still(0),0,1,5



Adam Novagen(Posted 2009) [#2]
So, wait a minute... The sprite actually displays onscreen, with the correct texture? But when you use PositionEntity(), then the program crashes? Am I reading you correctly?


Matty(Posted 2009) [#3]
Check the value of still(0) - if it is 0 then the sprite has not loaded correctly.


Zethrax(Posted 2009) [#4]
p="ph\DSC018"
s=".JPG"
Dim still(27)
still(0)=LoadSprite(p+"49"+s)
If still(0) = 0 Then Print "Oh Noes!!!" : Waitkey : End
PositionEntity still(0),0,1,5

Always check that a loaded entity has loaded correctly.


Warner(Posted 2009) [#5]
And try using p$ and s$ instead of p and s.


Adam Novagen(Posted 2009) [#6]
And try using p$ and s$ instead of p and s.

D'OH; how could we all miss that?! *slaps forehead* XD


AJ00200(Posted 2009) [#7]
And try using p$ and s$ instead of p and s.

That worked.
Thanks everyone