How destroy scenery and walls around using gun? Probably many peoples think before about such effect, and well i found how made it during work on Dust & Blood.
Ability to shoot doors using gun depend not on script, but type of scenery object. Its hardcoded that every doors (wooden portals) can be destroy using guns. So made new scenery as "wooden portal" to shot it! Ofcourse obiect will just disappear which is not so funny as broke something. But its possible to place different obiect in the same area where was one which you shoot.
First you need to made alternate scenery. Its not so hard just open frm of chair and modify it as broken chair. In result when you shoot normal chair it will disappear but very quick in the same hex will be placed broken one.
Script after shot (damage) remove this scenery (you must add script to scenery obiect) and place in the same hex another (destroyed) one. Ofcourse you must known pid number of new scenery (i count it so no problem) Number of last scenery pid is 33556283 each next is that number +1
Only problem is to create alternate new frms of broken obiects (just modify existing frms) Then you can walk around and shoot everything. This could work also for walls, so when you throw grenade few walls around should fall into ruins.
Unless you could destroy everything using any gun, so better is give to player only some big shotgun or heavy weapons.
I think its dont need add scripts to obiects in mapper it could be made during create item proto. Everytime you place such obiect on map it should have such script (possibility to destroy)
http://dust-and-blood.blogspot.com/2007/07/shooting-on-scenery.html
Ability to shoot doors using gun depend not on script, but type of scenery object. Its hardcoded that every doors (wooden portals) can be destroy using guns. So made new scenery as "wooden portal" to shot it! Ofcourse obiect will just disappear which is not so funny as broke something. But its possible to place different obiect in the same area where was one which you shoot.
Code:
procedure damage_p_proc;
procedure damage_p_proc begin
create_object(33556286,tile_num(self_obj),elevation(self_obj));
destroy_object(self_obj);
end
First you need to made alternate scenery. Its not so hard just open frm of chair and modify it as broken chair. In result when you shoot normal chair it will disappear but very quick in the same hex will be placed broken one.
Script after shot (damage) remove this scenery (you must add script to scenery obiect) and place in the same hex another (destroyed) one. Ofcourse you must known pid number of new scenery (i count it so no problem) Number of last scenery pid is 33556283 each next is that number +1
Only problem is to create alternate new frms of broken obiects (just modify existing frms) Then you can walk around and shoot everything. This could work also for walls, so when you throw grenade few walls around should fall into ruins.
Unless you could destroy everything using any gun, so better is give to player only some big shotgun or heavy weapons.
I think its dont need add scripts to obiects in mapper it could be made during create item proto. Everytime you place such obiect on map it should have such script (possibility to destroy)
http://dust-and-blood.blogspot.com/2007/07/shooting-on-scenery.html