Hi,

In my test project, I'm creating a 1st person shooter script.
Shooting works, changing gun too, and also have a script that creates a bullethole on the walls.

This is the scripts that creates the bullethole:

Code:
function display_hithole(){
       vec_to_angle (my.pan, normal); // orient the hit hole sprite correctly
       vec_add(my.x, normal.x); // move the sprite a bit away from the wall
       set (my, PASSABLE); // the hit hole bitmap is passable
       //set (my, TRANSLUCENT); // and transparent
       my.ambient = 100;
       //my.roll = random(360); // and has a random roll angle (looks nicer this way)
       my.scale_x = 0.5; // we scale it down
       my.scale_y = my.scale_x; // on the x and y axis
       wait (-30); // show the hit hole for 20 seconds
       ent_remove (my); // and then remove it
}


My questions:

1. How can I make bulletholes also appear on models, like barrels, lights etc.?

2. How can I detect what kind of surface the object is?
(Glass, wood, brick, concrete etc.) So I can use different bullethole images.

3. Is there a way to make some wood shatters drop down and disappear when I fire at a wooden crate or something? (So it looks more realistic when I fire at it)

4. How can I make the gun "spray" a bit. I mean, now it fires directly at one point, and bulletholes overlaps eachother perfectly, I want to be able to change the accuracy of the weapon.

Thanks.
Those are my questions. (For now :P)


The best games are the games you create yourself.