HideEntity ?

Blitz3D Forums/Blitz3D Beginners Area/HideEntity ?

CodeOrc(Posted 2009) [#1]
Hello,

I am trying to make it so that when I kill a badguy and it relocates, it is not visible.

HideEntity a\entity
 idx=Rnd(-470,500):idz=Rnd(-600,600):PositionEntity a\entity,idx,80,idz
ShowEntity a\entity


the problem is this, I can see it move all the way over to it's new postion as if frames between pointa=killed and pointb=respawn are visible.

How do I make it truly invisible during it's move?


Gabriel(Posted 2009) [#2]
Are you using Mark's render tweening, by any chance?

If you are, you'll need to have some kind of NoTween flag which stops this happening. A good tweening implementation has this built in and allows you to warp objects immediately, but you have to roll your own with Mark's.

I know a number of people have requested Mark add such a function, but it's been so long since I used Blitz3D that I don't remember how to implement your own with all this captureworld stuff.


CodeOrc(Posted 2009) [#3]
Are you using Mark's render tweening, by any chance?

I am using Marks Tween Structure.

...but you have to roll your own with Mark's.

argh! ^ ^ ... anyone have a fix for this ?


_PJ_(Posted 2009) [#4]
Just Before your rendering:
If (a\Relocating)HideEntity a\entity
Else If (Not(a\Relocating)) Then ShowEntity a\Entity
End If



When first killed:
 if (a\Relocating)
      idx=Rnd(-470,500):idz=Rnd(-600,600)
      PositionEntity a\entity,idx,80,idz
      a\Relocating=True
 End If



CodeOrc(Posted 2009) [#5]
I added "Relocating" to my Types, but I get several errors using both of your components from "End w/If" to "Expecting If" and yes, I added them as you suggested.

Although I do not see any problems with your code I still get those errors and using your syntax verbatim.

But ty for offering it.


_PJ_(Posted 2009) [#6]
Sorry, my bad - I didnt test that to see how it compiled in Blitz first.

Try this:

If (a\Relocating)
	HideEntity a\entity
Else
	If (Not(a\Relocating))
		ShowEntity a\Entity
	End If
End If



and the First Killed bit:
 If (a\Relocating)
      idx=Rnd(-470,500):idz=Rnd(-600,600)
      PositionEntity a\entity,idx,80,idz
      a\Relocating=True
 End If