major_upset 0 Posted August 5, 2007 Hey guys, I'm back with a question, that's doubtlessly been asked a million times before. Is there a code to stop tanks, troops, etc from firing untill their a set distance away from their target, say like 300 meters or whatever? I'm sure I have read that you can do this, but I can't find the tread, and as always searching the forums as turned up nothing. Cheers in advance. Share this post Link to post Share on other sites
Black Sphere 0 Posted August 5, 2007 Hey guys, I'm back with a question, that's doubtlessly been asked a million times before. Yea I'm sure it was. But you did some effort in searching so half is forgiven.  Use a setCombatMode command, like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unitname setCombatMode "red" What the colors means: blue - never fire green - hold fire white - hold fire, engage at will yellow - open fire red - open fire, engage at will Share this post Link to post Share on other sites
AgentJonathan 0 Posted August 5, 2007 You can start these tanks with a waypoint to never fire, then create another waypoint to open fire at 300 ft away from their target. I hope that kinda helped. Share this post Link to post Share on other sites
major_upset 0 Posted August 5, 2007 You can start these tanks with a waypoint to never fire, then create another waypoint to open fire at 300 ft away from their target.I hope that kinda helped. Thanks guys. That'll help with the tanks that I've got advancing, now that just leaves the stationary ones, however I think I can get round that one by putting... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">tank1 setCombatMode "red"; tank2 setCombatMode "red" In a trigger that's fired by the attacking force. as they roll though. But I'm sure there's a code you could drop into a unit's init box though. Â Anyway cheers guys. Share this post Link to post Share on other sites
Black Sphere 0 Posted August 5, 2007 But I'm sure there's a code you could drop into a unit's init box though. Â But of course, the same code. Share this post Link to post Share on other sites
major_upset 0 Posted August 5, 2007 But I'm sure there's a code you could drop into a unit's init box though.  But of course, the same code. No I mean some sort of  <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unitname holdfiretill > 300; code Share this post Link to post Share on other sites
Black Sphere 0 Posted August 5, 2007 No I mean some sort of  <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unitname holdfiretill > 300; code No, there's no such code. You can use setCombatMode with distance code in trigger's condition thou: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">tank1 distance tank2 < 300 Share this post Link to post Share on other sites
major_upset 0 Posted August 5, 2007 Quote[/b] ]<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">tank1 distance tank2 < 300 ok cool, thanks for the info. Share this post Link to post Share on other sites
AgentJonathan 0 Posted August 5, 2007 Curses! I've got a long way to go til I'm actually helpful. Share this post Link to post Share on other sites
major_upset 0 Posted August 5, 2007 Curses! I've got a long way to go til I'm actually helpful. I'm still greatfull for the help. Share this post Link to post Share on other sites
AgentJonathan 0 Posted August 6, 2007 Thanks. That makes my day! Well, I might have actually been able to offer help, but I haven't scripted in a while. Share this post Link to post Share on other sites