modemmaik 53 Posted July 20, 2008 Hi @ all, seems that I run into a little problem: I use the Extended_Killed_EventHandlers to perform hiding certain areas of an existing object and placing a new object. The result should look like the old OFP-style tank-turret blow animation. It works on local tests, but does not perform on multiplay. I init the Extended_Killed_EventHandlers this way: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Extended_Killed_EventHandlers { class SmurfC_Stryker_TOW2B { killed = "if ((_this select 0)==(_this select 0)) then {[_this] execVM ""\smurfCStryker2\killed.sqf""};"; }; }; The killed.sqf contains: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//Definitions passed to script _xehPars = _this select 0; _unit = _xehPars select 0; _attacker = _xehPars select 1; if ( 3 > random 4 ) then { //player globalchat format["killed %1",[_unit,getdir _unit]]; _turret = "Stryker_Barrel1" createVehicleLocal [0, 0 ,0]; _unit setObjectTexture [0,""]; ... deletevehicle _turret; }; The complete unbin addon can be downloaded by the zShare Link So far, I have managed to get the blown turret by using createVehicle instead of createVehicleLocal, thus I think that the script runs on the server, but the setObjectTexture and the other code is not executed on the clients I hope that someone can help me with this. Simmilar OFP-addon's show nothing new and I have not located any ArmA addon using a simmilar script (except Solus SLX-vehicles, which uses vehicle animations and no client scripts). Thanks and Best Regads, mike Share this post Link to post Share on other sites
UNN 0 Posted July 20, 2008 Quote[/b] ]So far, I have managed to get the blown turret by using createVehicle instead of createVehicleLocal, thus I think that the script runs on the server Yep, the killed event is fired locally to the object. You can use the SetVehicleInit command. To execute it on all clients. You will need to modify killed.sqf, depending on how you want it to work for JIP. Looking at your code, you delete the turret at the end of the script. I take it you just want the texture hidden for anyone who joins a game in progress? Share this post Link to post Share on other sites
modemmaik 53 Posted July 20, 2008 Yep, the killed event is fired locally to the object. You can use the SetVehicleInit command. To execute it on all clients.You will need to modify killed.sqf, depending on how you want it to work for JIP. Looking at your code, you delete the turret at the end of the script. I take it you just want the texture hidden for anyone who joins a game in progress? Thanks for the tip, I have managed to change the remove of the original turret, using a "hide" animation, included in the vehicle, which gets called instead of the setObjectTexture. This way, all clients are updated and the placed burning turret pops up after the old vanished. The delete of the turret is to reduce the objects on the battlefield. 30 secs should be enough. BR, mike Share this post Link to post Share on other sites
UNN 0 Posted July 20, 2008 Quote[/b] ]except Solus SLX-vehicles, which uses vehicle animations and no client scripts Ahh..so you had the solution to your problem at hand, all this time. Isn't that just the way with Arma There are so many possibilities. BTW, for future reference. Do Anims get transmitted to JIP clients? Share this post Link to post Share on other sites
modemmaik 53 Posted July 21, 2008 Quote[/b] ]except Solus SLX-vehicles, which uses vehicle animations and no client scripts ... BTW, for future reference. Do Anims get transmitted to JIP clients? Beacuse the anims are integrated into the addon, I think so. Else, any tank's gun would point into an alternative direction, because these are model anims, too. Those animations are linked to a specific element in the "memory" LOD of the model. I think that information is sent to the clients to determine direction of maingun / hatch open or closed / damage status etc. And the best reference seems SLX vehicles, because he integrated many animations to his models. So for my case of use, the killed script only needs to trigger the according animations and create the "replecement" turret. I have uploaded a binarized version of the corrected addon. I you want to check: SmurfC Stryker TOW (zShare) Best Regards, mike Share this post Link to post Share on other sites
sickboy 13 Posted July 21, 2008 I would suggest changing killed = Â Â into a properly tagged name. Cause when everyone's gonna use such short and untagged names, it wont be long before XEH's usefullness is lost :P Share this post Link to post Share on other sites
UNN 0 Posted July 21, 2008 Quote[/b] ]Beacuse the anims are integrated into the addon, I think so. Yeah, for things like damage and turrets. It was user defined anim sources I was thinking of there, although I guess there is no need for you to use them in this case. Quote[/b] ]So for my case of use, the killed script only needs to trigger the according animations and create the "replecement" turret. I have uploaded a binarized version of the corrected addon. You should be able to trigger the hide animation with the damage animsource, without any scripting? But that’s assuming your not doing something extra in your script. Share this post Link to post Share on other sites
modemmaik 53 Posted July 21, 2008 I would suggest changing killed = into a properly tagged name.Cause when everyone's gonna use such short and untagged names, it wont be long before XEH's usefullness is lost :P Well yes, the scripts are named init and killed. Because they are integrated into the addon, they can only be accessed using the addon's name, I guess. That is why I used the simple names. :edit: ups... Now I get you. The killed=... is what you meant. Yepp. I change that in the next version. Thanks a lot You should be able to trigger the hide animation with the damage animsource, without any scripting? But that\u2019s assuming your not doing something extra in your script. Well... I tried it, but when you use light weapons, the damage is triggered about 1 second before the explosion animation. That way, the turret vanishes, reapears one second later from nowhere just when the big blow starts... Using the user-defined animation, I am able to cover that without the "turret vanish" effect Share this post Link to post Share on other sites
Dwarden 1125 Posted July 29, 2008 one million dollar question spotDistance[] = {0,0.3,1,2}; why is last value 2 ? usually the ranges are 0 to 1 so what's that ? special mod ? super AI mode ? typo ? or just tried something out of range ? thanks to anyone able to explain why (ideally saying what are values we can use for this) Share this post Link to post Share on other sites
.kju 3245 Posted July 29, 2008 well sometimes its cadet 0 veteran 1 both 2 Share this post Link to post Share on other sites
poweruser 10 Posted July 29, 2008 [joking] Basicly that's a 200% chance of spotting a target for a high skilled AI. I guess the AI can predict the future then and will know your future postions even before the mission has started. But this gift of prediction is very rare among AIs, only the most talented ones (with skill=1) can do this. [/joking] Must be a typo. What does ArmA do when you set values out of range? Use the default values from the original ArmA config, or does it use the value in range which is closest to the set one (would be 1 then in this example)? Share this post Link to post Share on other sites
Solus 1 Posted July 30, 2008 SetVehicleInits cause MP servers to lag out when players join in progress, you can try using the SLX_NetCode addon method in the latest SLX mod update if you want, it should get rid of any MP join in progress crashes/lags. Anyone can include the slx_netcode addon in their releases. Share this post Link to post Share on other sites
Maddmatt 1 Posted July 30, 2008 Must be a typo.What does ArmA do when you set values out of range? Use the default values from the original ArmA config, or does it use the value in range which is closest to the set one (would be 1 then in this example)? It will try to use the 'out of range' value if possible. It might handle it differently according to what the value is for. I know that, at least in OFP, if you use the 'setdammage' command and give it a negative value, it will make the unit's aim shake more. I don't know how ArmA handles it, I don't do those weird experiments so much any more Basically, weird values can cause weird behaviour A unit's damage value can be more than 1 for example. This has been used in scripts that cause gibbing (people being blown apart) in OFP. Share this post Link to post Share on other sites