I got weird probs
Blitz3D Forums/Blitz3D Programming/I got weird probs
| ||
I have interrmittent failures of some functions. I suspect it is because I am not doing something right. This is what I have trouble with. 1. The crossbow shoots arrows but not all the time. It still counts down in ammo but no arrow is seen. 2. Trees will not ignore water. I try to make them ignore water... I suspect that I am going to have to do the ignore water thing when making up the initial positions. 3. Anyone that has an idea for a more spohisticated AI than pointentity / collide please let me know! The code is here: http://www.silverimports.com/crapola/ All told the size is about 20mg. If you are dialup this may take 9 - 14min... cable and dsl much sater! I could really use another perspective on this! : ) _ROOK |
| ||
FYI, 20 megs is a minimum one hour download on 56k ( hence why I'm not going to download ) If you could narrow it down and post a little code, I think you'll get more help than if you ask ppl to download 20 megs. Heck, that's a lot for a full game. |
| ||
Certainly... I just added the full DL so you would have all the models and textures and sounds! :) Well the code looks like this: I get the probs listed. I have a version where my badguys (spheres for now) fly in to harrass my dude. I can put them on the map, I can make them point to the dude and fly to him. If he does manage to shoot an arrow at them (and hit) they pop. But he doesn't always shoot the arrow. So I went back to a previous version and still have that problem. Figured I would try to solve it without enemies before I tried it with badguys! :) -RZ |
| ||
For some reason the arrow only seems to fire at certain locations... I am clueless. |
| ||
When you Create a Bullet, I think you might want to use Floating point numbers like. temp_x#=EntityX#(gun_entity,True) temp_y#=EntityY#(gun_entity,True) temp_z#=EntityZ#(gun_entity,True) not sure though, I am at work and can't really take much time. See if that helps at all. Regards, Eric |
| ||
SO what is the difference between: temp_x=EntityX(gun_entity,True) temp_y=EntityY(gun_entity,True) temp_z=EntityZ(gun_entity,True) what I have.... and: temp_x#=EntityX#(gun_entity,True) temp_y#=EntityY#(gun_entity,True) temp_z#=EntityZ#(gun_entity,True) is the # thing after entityX that important??? :) -RZ |
| ||
The '#' Forces Floating Point Numbers. I'm not sure if you need the '#' After the EntityX, I just do it for clarity in my own code. Regards, Eric |
| ||
Yeah, and if you get an error on those lines somthing like "Variable type mismatch" then that means it's declared as a different type of variable the very first time it's used. |
| ||
OK let me try it... anything for clarity! :) -RZ |
| ||
Rook, I can tell you what your arrow problem is with out even looking at your code. Because I ran into the same thing with paintballs! You are setting the collisions up to the initial arrow, then copyent. Do this instead, Copyent(arrow), positionent(arrow, at players bow), THEN set collision. I will download your project and make sure this is the problem... |
| ||
And your new create arrow code goes as follows Function create_bullet(gun_entity) b.bullet=New bullet temp_x=EntityX(gun_entity,True) temp_y=EntityY(gun_entity,True) temp_z=EntityZ(gun_entity,True) b\entity=CopyEntity(bolt) ; copy the main bullet entity , into the type object b\pivot=CreatePivot() PositionEntity b\entity,temp_x,temp_y,temp_z EntityType b\entity,2 RotateEntity b\entity,EntityPitch(gun_entity,True),EntityYaw(gun_entity,True),0 PositionEntity b\pivot,temp_x,temp_y,temp_z b\range=300 ; the range of the bullets b\speed=18; the speed of the bullets End Function tadaaaaaaaaaaaa |
| ||
Oh yeah, I think your using picks to try to determine there is not water, right? well, you have to make sure to set the water up so that it obscures picks. |
| ||
G.O.D. That looks like fine advice... updating code NOW!!! : ) Bot Builder... That also looks like great advice... but I don't understand it. Sorry! :) That G.O.D. code does the trick... now If I could just figure out why the treeplacer doesn't work! :) -RZ |
| ||
Picks are sensors basically. Define a origin, define a vector(From that origin) and define the radius of this virtual line in 3d space.(spherical) Now, to check the ground beneath a tree.. hit=linepick(treeX,treeY,treeZ,0,-20,0) ;this will cast this virtual line and return the entiy hit if any.(Only checks entities that have a pickmode. poly is best) then use pickedX,y,z etc to get exactly where the line and the geo(I.e the ground) meet. I.e exactly where you want to place the tree. |
| ||
so instead of ENTITYTYPE, water,3 I should use ENTITYPICK water,4??? |