Problems with Types

Blitz3D Forums/Blitz3D Beginners Area/Problems with Types

Ace Killjoy(Posted 2008) [#1]
That's right! I'm converting my Arrays to Types!
But I have a few minor problems.
Here's the code:

So here are the problems:

1) It keeps reusing the same bullet when I fire (that's my assumption)

2) It keeps saying "Entity Does Not Exist" and it points to this line:
foe.target=Object.target(EntityName(entity))

I'm not completely sure why I put those lines in there. But I thought it would fix the issue of nothing happening when my bullets collided with the target.

Also, I have set up everything else on the line of "type_target" and such.


Stevie G(Posted 2008) [#2]
I'm pretty sure I already answered this before. You need to put some error trapping in there. You can't be sure that any entity has been collided with or that that entity is actually a target.

Also, you hide the entity as soon as it collides with something so it will never make the second part of the condition.

Indent your code - it makes it so much easier to debug.




Ace Killjoy(Posted 2008) [#3]
I apologize for the repetition.
I'm not used to Types or the EntityCollided command for that matter.
I'll try what you've suggested.


Ace Killjoy(Posted 2008) [#4]
Success! The targets are disappearing as I wish. (Currently trying to make it so that it takes three shots to disappear)

I've also indented my code and it looks much better now. Thanks!

Now if I could only figure out how to keep the bullet from being reused...


GIB3D(Posted 2008) [#5]
This is how I create new types




Ace Killjoy(Posted 2008) [#6]
Thanks.
I'll see what I can do with it.


Ace Killjoy(Posted 2008) [#7]
Unfortunately, I couldn't get it to work with my code (probably my code's fault).