Reeveli 4 Posted February 22, 2020 (edited) So I am trying to create a situation where there is critical information on computer terminal that the players are trying to get. The catch is that if the players accidentally shoot the computer during the firefight it is destroyed (they wont get the option of accessing its files). My problem is how to achieve this. The computer (or as far as I know all prop items like barrels, crates, soda cans etc) objects do not register damage from bullets/grenades so a simple trigger with if (damage computer <0) condition will not work. I will however note that it is possible to manually set the damage on the object using the setDamage command (from example from debug menu) while in-game. However I would rather not have to worry about such minutiae if I am zeusing a hectic mission. The 'Hit' and 'Dammaged' eventhandlers are also not registering on the prop objects so using them will not work. An alternative I thought was to use the 'Fired' and/or 'EpeContactEnd' eventhandlers to track the bullets fired by the players to see if they end up hitting the computer. This however does not sound to me like a performance friendly solution, especially since I would also like to have possibility for an AI to damage the computer by accident (thus greatly increasing the tracked bullets). I guess I could try to only add the eventhandler to units only when the move to the vicinity of the computer and removing the EHs afterwards in an effort to reduce the amount of bullets tracked. If someone here would have a more elegant solution in mind please share your thoughts. Edited February 22, 2020 by Reeveli Share this post Link to post Share on other sites
7erra 629 Posted February 22, 2020 What about allowDamage false? Share this post Link to post Share on other sites
Reeveli 4 Posted February 22, 2020 1 hour ago, 7erra said: What about allowDamage false? Not sure what you are referring to. I specifically want to allow the prop to be damaged. Share this post Link to post Share on other sites
7erra 629 Posted February 22, 2020 You want to disable the damage of the computer but still be able to damage it? What? Share this post Link to post Share on other sites
Reeveli 4 Posted February 22, 2020 Poor wording on my part, first post updated to correct this. What I meant is that the players are not allowed to damage the computer in order to get the intel out of it. From a scripting perspective I definitely want to allow the computer to be damaged. The problem is that short of manually setting the damage I haven't found out any good ways of achieving this dynamically. Share this post Link to post Share on other sites
7erra 629 Posted February 22, 2020 The "HitPart" EH fires for these kind of objects. 1 hour ago, Reeveli said: What I meant is that the players are not allowed to damage the computer in order to get the intel out of it. Spoiler 1 Share this post Link to post Share on other sites
stburr91 1004 Posted February 22, 2020 This may not be perfect, but it's a possible solution. You could place a water balloon in front of the computer, and remove the texture of the balloon so you don't see it. If the balloon is hit, it will be destroyed. So you would not be registering a hit on the computer, but the balloon. The down side to using the water balloon is that when it's hit, you get the effect of a water splash. Share this post Link to post Share on other sites
Harzach 2517 Posted February 22, 2020 6 minutes ago, 7erra said: The "HitPart" EH fires for these kind of objects. Beat me to it, was just checking and it works nicely. Share this post Link to post Share on other sites
stburr91 1004 Posted February 22, 2020 12 minutes ago, Harzach said: Beat me to it, was just checking and it works nicely. Could you post the code you used to do that? Share this post Link to post Share on other sites
Reeveli 4 Posted February 22, 2020 10 minutes ago, 7erra said: The "HitPart" EH fires for these kind of objects. Reveal hidden contents Didn't know that, I was assuming the 'HitPart' was using same detection model as 'Hit' or 'Dammaged'. Just because you can recover stuff afterwards from a hard drive doesn't mean careless fire discipline is the desired form of gameplay on every mission. Share this post Link to post Share on other sites
Harzach 2517 Posted February 22, 2020 1 minute ago, stburr91 said: Could you post exactly how you set that up? this addEventHandler ["HitPart", { (_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; systemChat "You shot the laptop, dummy."; }]; 1 Share this post Link to post Share on other sites
stburr91 1004 Posted February 22, 2020 3 minutes ago, Harzach said: this addEventHandler ["HitPart", { (_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; systemChat "You shot the laptop, dummy."; }]; Awesome, thank you sir. Share this post Link to post Share on other sites
Harzach 2517 Posted February 22, 2020 Of course, you can get as complex as you'd like regarding how you handle the hitPart events. Share this post Link to post Share on other sites