Fcn 10 Posted June 29, 2009 Simple question with a seemingly complex answer. How do I go about making an existing building, one with an ID on the map, invincible? Share this post Link to post Share on other sites
Benny. 15 Posted June 29, 2009 (edited) You can use nearestObject. //_obj is the closest object next to the building. _house = nearestObject [_obj, "House"]; then, for SP: _house allowDamage false for MP: _house addEventHandler["Hit",{_this select 0 setdammage 0}]; _house addEventHandler["Dammaged",{_this select 0 setdammage 0}]; _house addEventHandler["Killed",{_this select 0 setdammage 0}]; Edited June 30, 2009 by Benny. Share this post Link to post Share on other sites
Fcn 10 Posted June 30, 2009 I'm really sorry, but I'm not sure how to utilise that script. a gamelogic tied to the building ID? Something like that? Share this post Link to post Share on other sites
Benny. 15 Posted June 30, 2009 Basicly, you can use an object (gameLogic or whatever) to tie it. In this case it shall be _house = nearestObject [myGameLogic, "House"]; Share this post Link to post Share on other sites
Fcn 10 Posted June 30, 2009 So, as the object ID is: 276454 A Gamelogic named 'GameLogic', with this in the init field: 276454 addEventHandler["Hit",{_this select 0 setdammage 0}]; 276454 addEventHandler["Dammaged",{_this select 0 setdammage 0}]; 276454 addEventHandler["Killed",{_this select 0 setdammage 0}]; Is that right? This is confusing. Except that doesn't tie it properly does it. Would the stuff above go in a repeating trigger while _house = nearestObject [myGameLogic, "House"]; goes in the gamelogic? Share this post Link to post Share on other sites