Would you be able to get the stun rod tool to shoot out bullets that when hitting a specific object it can create a piece of code for the object and bullet (ex: Play a death animation and the bullet getting destroyed)?
Over the last week, me, Abion and Romulator have been trying to get the stun rod to shoot projectiles to the point of madness. We tried a number of systems which have been unsuccessful for the following reasons:
My way:
- Can shoot enemies through walls
- Does produce effects (like bullet holes)
- We don't know if we can add areas to a HUD object yet
Abion's way:
// On gun firing
Map_GetEntity("dummy_entity").cLux_GetPlayer().GetCamera().GetPosition();
iLuxEntity @bullet = Entity_CreateAtEntity("new_entity_name", "entity_file_name", "dummy_entity_name");
cVector3f forward = Player_GetCamera().GetForward();
bullet.GetMainBody().SetLinearVelocity(cVector3f(forward.x * bulletSpeed, forward.y * bulletSpeed, forward.z * bulletSpeed));
Entity_AddCollideCallback("new_entity_name", "monster_*", "bullet_OnCollide");
- Too complex
- Hard to code
- Too easy to mess up code
Any suggestions on different ways on solving this issue? This post is sort of a last resort at the moment.