Somerville 0 Posted March 21, 2007 Okay here's the situation: Our clan's trying to impliment Artillery and a time/weather dialog into our training map. Initially, the time/weather console was brought up by radio commands sequentially (I.e. Radio 1 > Radio 1> etc to bring up the weather dialog). However, because the radio shows on the map even when it's set to false in description.ext, idiots kept changing time and weather. I've set this as a custom action for the leader of the clan, so only he can use it. However, if somebody gets close to him in the game, they can also select the action from his body. The same goes for artillery actions. Basically, I want to know how to have a custom action that only a unit called "Soldier1" can access. Also, I'd like to make the dialog only show on HIS screen, nobody else's. I would also like to know how to make a hint appear in the corner of the screen when the artillery is called, showing the name of the player who has called the artillery/opened the weather console. Cheers. Share this post Link to post Share on other sites
mattxr 9 Posted March 21, 2007 Okay here's the situation:Our clan's trying to impliment Artillery and a time/weather dialog into our training map. Initially, the time/weather console was brought up by radio commands sequentially (I.e. Radio 1 > Radio 1> etc to bring up the weather dialog). However, because the radio shows on the map even when it's set to false in description.ext, idiots kept changing time and weather. I guess you shouldn't have idiots in your clan then... hmm lets see then.. Share this post Link to post Share on other sites
celery 8 Posted March 21, 2007 You can block others from getting any radio messages by typing this in the init file, p1 being the leader and assuming he doesn't have a group to command: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">bossman = group p1 ?(local player and group player != bossman):{1 SetRadioMsg "null" and 2 SetRadioMsg "null" and 3 SetRadioMsg "null" and 4 SetRadioMsg "null" and 5 SetRadioMsg "null" and 6 SetRadioMsg "null" and 7 SetRadioMsg "null" and 8 SetRadioMsg "null" and 9 SetRadioMsg "null" and 10 SetRadioMsg "null"} Actions can be made private by execing a script in init with a starting condition of ?(local player and group player != bossman):exit and after that you list all the actions. You will have to use publicvariable switches with a separate script checking those conditions and making the corresponding changes. Share this post Link to post Share on other sites
Somerville 0 Posted March 21, 2007 Well, I've sorted this now. Test.sqs has the following in it: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(Player == soldier1): BossAction = soldier1 addaction ["Time/Weather","TU_Weather.sqs"] ?(Player == soldier1): ArtyFire = soldier1 addaction ["Call Light Artillery","westari\setfire.sqs"] ?(Player == soldier1): ArtyFire1 = soldier1 addaction ["Call Heavy Artillery","westari\setfire1.sqs"] EXIT These action aren't appearing when Soldier1 dies and respawns. Is there a way I can make them reappear? Share this post Link to post Share on other sites
celery 8 Posted March 21, 2007 Well, I've sorted this now.Test.sqs has the following in it: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(Player == soldier1): BossAction = soldier1 addaction ["Time/Weather","TU_Weather.sqs"] ?(Player == soldier1): ArtyFire = soldier1 addaction ["Call Light Artillery","westari\setfire.sqs"] ?(Player == soldier1): ArtyFire1 = soldier1 addaction ["Call Heavy Artillery","westari\setfire1.sqs"] EXIT These action aren't appearing when Soldier1 dies and respawns. Is there a way I can make them reappear? Make it loop: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#start @alive soldier1 ?(Player == soldier1): BossAction = soldier1 addaction ["Time/Weather","TU_Weather.sqs"] ?(Player == soldier1): ArtyFire = soldier1 addaction ["Call Light Artillery","westari\setfire.sqs"] ?(Player == soldier1): ArtyFire1 = soldier1 addaction ["Call Heavy Artillery","westari\setfire1.sqs"] @!alive soldier1:goto "start" Share this post Link to post Share on other sites
Sentinel- 0 Posted March 21, 2007 If I remember right, addaction passes some parameters to a script. One of them is who 'owns' the action and one of them is who used the action (which can be someone else than the one who 'owns' the action. You can test this easily by placing following code at the top of the script and pick the right parameters. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["%1",_this] If user and owner are different, don't ececute Share this post Link to post Share on other sites
KJAM 0 Posted March 21, 2007 Okay here's the situation:Our clan's trying to impliment Artillery and a time/weather dialog into our training map. Initially, the time/weather console was brought up by radio commands sequentially (I.e. Radio 1 > Radio 1> etc to bring up the weather dialog). However, because the radio shows on the map even when it's set to false in description.ext, idiots kept changing time and weather. I guess you shouldn't have idiots in your clan then... hmm lets see then.. Although one or two clan members can mess around sometimes and not behave when told to, usually it's the publics (Though when the misison is question is being played the server is lock most of the time). Though sometimes idiots can slip through the cracks by not being idiots until they get in the clan :P On the whole the vast majority of the clan take game playing seriously. Somer: Hope you get it sorted, anything you do to improve te training map is always a good thing Share this post Link to post Share on other sites
Somerville 0 Posted March 21, 2007 Uh, changing the test.sqs script to what was suggested just created an endless list of Time/Weather Light Artillery etc... Help? Share this post Link to post Share on other sites
the unknown 0 Posted March 21, 2007 Btw we fixed the showing up on the other players. This did the trick. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(Player == soldier1): BossAction = soldier1 addaction ["Time/Weather","TU_Weather.sqs"] Share this post Link to post Share on other sites
Somerville 0 Posted March 21, 2007 Still no luck. 'Soldier1' respawns with no custom actions. I've even tried this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#start @(alive soldier1) ?(Player == soldier1): BossAction = soldier1 addaction ["Time/Weather","TU_Weather.sqs"] ?(Player == soldier1): ArtyFire = soldier1 addaction ["Call Light Artillery","westari\setfire.sqs"] ?(Player == soldier1): ArtyFire1 = soldier1 addaction ["Call Heavy Artillery","westari\setfire1.sqs"] @(not(alive soldier1)): goto "start" Which was supposed to be so if he died, the script would restart itself.. which it doesn't. Share this post Link to post Share on other sites
Sentinel- 0 Posted March 21, 2007 hmmm.... I don't know if unit name is passed on to respawned unit. If not then following code might help: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(Player != soldier1):exit #start @(alive player) BossAction = player addaction ["Time/Weather","TU_Weather.sqs"] ArtyFire = player addaction ["Call Light Artillery","westari\setfire.sqs"] ArtyFire1 = player addaction ["Call Heavy Artillery","westari\setfire1.sqs"] @(not(alive player)): goto "start" Share this post Link to post Share on other sites
Somerville 0 Posted March 22, 2007 Hmm.. I tried that, and I'm still getting the same error I did before. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(Player != soldier1):exit #start @(alive player) BossAction = player addaction ["Time/Weather","TU_Weather.sqs"] ArtyFire = player addaction ["Call Light Artillery","westari\setfire.sqs"] ArtyFire1 = player addaction ["Call Heavy Artillery","westari\setfire1.sqs"] @(not(alive player)): goto "start" .. was typed into test.sqs, yet when I run the script, it says something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(not(alive player)): goto "start" - Error: Type Bool, expected switch I think ArmA doesn't like the not alive statement... Share this post Link to post Share on other sites
Cloughy 0 Posted March 22, 2007 If you are team leader, and are still team leader on respawn, instead of player or soldier1, use 'leader group1', where group1 is your group. I have heard that respawned units are created and not copied in anyway, so it doesnt have a name. Cheers GC Share this post Link to post Share on other sites
-SPA-LynxEye 0 Posted March 22, 2007 Hmm.. I tried that, and I'm still getting the same error I did before.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(Player != soldier1):exit #start @(alive player) BossAction = player addaction ["Time/Weather","TU_Weather.sqs"] ArtyFire = player addaction ["Call Light Artillery","westari\setfire.sqs"] ArtyFire1 = player addaction ["Call Heavy Artillery","westari\setfire1.sqs"] @(not(alive player)): goto "start" .. was typed into test.sqs, yet when I run the script, it says something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(not(alive player)): goto "start" - Error: Type Bool, expected switch I think ArmA doesn't like the not alive statement... Well, maybe im into a mistake but... ? Player == soldier1.... isn't it badly written? Maybe is " ? soldier1 == player " Share this post Link to post Share on other sites
-SPA-LynxEye 0 Posted March 22, 2007 sry, bad quote, im just a newbie Share this post Link to post Share on other sites
Sentinel- 0 Posted March 23, 2007 Quote[/b] ](not(alive player)): goto "start" - Error: Type Bool, expected switch This means you're using sqs-syntax where you're supposed to use sqf-syntax. Basicly it means that your script is named as script.sqf not script.sqs Share this post Link to post Share on other sites
UNN 0 Posted March 23, 2007 Quote[/b] ]This means you're using sqs-syntax where you're supposed to use sqf-syntax. Basicly it means that your script is named as script.sqf not script.sqs There is way to much importance placed on Arma script extensions. You can use whatever file extension you want , Arma could not care less. As long as it's a file containg text, then anything will do. The problem with the script is caused by the wrong use of the @ command. The script should be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(Player != soldier1):exit #start @(alive player) BossAction = player addaction ["Time/Weather","TU_Weather.sqs"] ArtyFire = player addaction ["Call Light Artillery","westari\setfire.sqs"] ArtyFire1 = player addaction ["Call Heavy Artillery","westari\setfire1.sqs"] @(not(alive player)) goto "start" The @ command can't be used the same way as the If \ ? command. Share this post Link to post Share on other sites
Sentinel- 0 Posted March 23, 2007 Quote[/b] ]The @ command can't be used the same way as the If \ ? command. Seems like many of us aren't really paying attention when reading other's codes Share this post Link to post Share on other sites
Somerville 0 Posted March 25, 2007 Btw, can any of you guys help with this? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;Script by Mr-Murray and JörgF 2006 ;mr-murray@bossmail.de ;www.mapfact.net ;www.mr-murray.de.vu ~Random 2 _K = _this select 0 _Z = _this select 1 _X = Getpos _Z select 0 _Y = Getpos _Z select 1 _K DoWatch [_X,_Y,5000] _A =_K Ammo "M119" ~5 _K fire "M119" #Next @ _A > _K Ammo "M119" _K exec "westari\artismoke.sqs" ~2 _N = nearestObject [_K,"HeatM119"] _X = _X+((Random 60)-40) _Y = _Y+((Random 60)-40) _H = "HeliHEmpty" CreateVehicle [_X,_Y] ~1 _H say "Ari" ~1 _N setpos [_X,_Y,0] _Bomb="SH_125_HE" CreateVehicle [_X,_Y,0] _H exec "westari\artismoke.sqs" ~0.5 deleteVehicle _H exit This is (as it says) Mr-Murrays Artillery script. I PM'd him asking personally for help, but no response. Basically, I want to edit this script so that it fires GBU's. It works in single player by simply changing the _Bomb value to the GBU class name, but in multiplayer, it just fires normal shells. Thanks for any help guys. Share this post Link to post Share on other sites
-SPA-LynxEye 0 Posted March 25, 2007 I dont know that arti script... and... where you are publishing his artismoke.sqs to take a look? And another question... are you sure that HeliHEmpty is correct? is not Heli_H_Empty? Share this post Link to post Share on other sites
Somerville 0 Posted March 25, 2007 Must be correct.. I mean, the Light Artillery (Using the normal ammo) works fine in MP. I can post the smoke script if you wanna see it, but it doesn't work in MP anyway? Share this post Link to post Share on other sites
ArMoGaDoN 0 Posted August 15, 2007 Cloughy said this: "I have heard that respawned units are created and not copied in anyway, so it doesnt have a name.". I have the same problem with another script, and still cannot find a way to update the editor-assigned-name to units. I can get the name (like [sSS]FredBloggs ) no problem from units, but after the player or other players respawn, the object reference 'WestLeader1' as editor-assigned-name for example is GONE AWOL, so how can a respawning player be re-addressed using the object name? The original object with the editor-name is not set Null, therefore all the code I wrote works still, but the object remains on the map, and is DEAD still EVEN AFTER the player has respawned. This is nuts? Is there any way to reassign the new respawned player with his original editor name? Share this post Link to post Share on other sites