but I mean how can make a clip and bullet counter, or make shot gun with script, a real gun, when hit put decals on wall, this engine have this abillity?
you can find some help in Bloody Massacre tutorials (for weapons handling)
and tutorial from the SDK "game basics\19 - Small Overlays" for leaving decals
I have make my laser pistol and it can put decal on the wall right now. but i have some new problems.
1. how can I change the position of my bullet when it's going out from my pistol? just i can make change in X axis and can't change the Y position, the bullet go out lower than my pistol.
2. It's possible when bullet hit the wall a particle like smoke appear on wall for a second?
(solved)3. in Bloody Massacre map when I try to shoot the walls the decals are appear on some place of the wall and some time it isn't appear, maybe the decal printed on the wall but it's printed inside of the wall not out. (solved)
4. it's possible to make clip or Ammo counts for weapons?
PhysHit phys_hit;
if(Physics.ray(pos,dir*ViewportActive.range,&phys_hit)) // if ray test hit an actor
{
if(Item *item=CAST(Item,phys_hit.obj)) // if the object is an item
{
item->addBulletHole(phys_hit.plane.pos, phys_hit.plane.normal, dir); // call item method to add a bullet hole
}
if(!phys_hit.obj)
{
Game::World.terrainAddDecal(WHITE,*Materials(PistolDecal),Matrix().setPosDir(phys_hit.plane.pos, phys_hit.plane.normal).scaleOrn(0.05f));
}
}