Jump to content
Sign in to follow this  
Bulldog Six

remove radio from a unit, run a script once for a connecting player, AND OTHER ISSUES

Recommended Posts

Hi,

the following issues are part of a MP mission (player versus player), hopefully to run on a dedicated server sometime. please keep this in mind when posting a solution since some code won't work in MP/dedicated server mode.

if you want to run this mission on your server, let me know via PM. it's pretty cool so far, but it's still work in progress.

Issue 1:

I've been trying to remove the radio from a specific unit's inventory, but for some reason it doesn't work.

I've tried the following code in the initialisation field of a unit, also in a trigger - without success. the unit keeps the radio.. :-(

this removeweapon "ItemRadio";

any ideas?

(I'm using [sBS]mac's pvp script pack, which might be loading some default gear after a few seconds - but there must be a way to get rid of the radio again. removing it from the script pack is not an option, because I want only some specific units not to have the radio).

Issue 2:

I need a connecting player to run a script (an intro script with typewriter credits and some music) once they connect. Each side (WEST,EAST,CIVILIAN) has a different intro script.

I want each CONNECTING player to run the intro script ONCE when they connect. It should ONLY be visible/audible to the connecting player and not for others already playing. And it should never run again for those who have already seen it (i.e. respawn).

So far I am using an area trigger with the condition

this && player in thislist

and the on activation

nul = [this && vehicle player in thislist] execVM "scripts\intro_blufor0.sqf";

This is a temporary solution only because I can't set the trigger to be triggered repeatedly, otherwise a unit won't just get it only once if they step into the trigger area again. And if I set the trigger to be triggered once, probably only the first player who triggers it will get the intro and others who connect later won't because it's been triggered before by the previous player (I guess! - correct me if I'm wrong).

Issue 3:

I'm using a UAV in my mission. I've set it to fly in a certain height (350) and because of that it keeps flying up and down depending on the terrain below it to keep the assigned height. This makes it difficult to monitor an area with the UAV. I need the UAV to either use the sealevel as height-reference or to set the Z-speed to 0 (zero) so it won't rise (I've read about this, but it wasn't explained how-to). How do I do that? Other solutions/workarounds are also welcome of course.

Issue 4:

A while back I somehow managed to have civilians driving civilian vehicles on the roads. I don't know if I messed it up or if the Civilian Vehicle Module was altered in a way that this feature doesn't work anymore.

What do I have to do to make the AI civilians occassionally use vehicles again? (sync or group the ALICE and SILVIE modules together or something of that sorts maybe?)

Issue 5:

at the beggining of my mission I have an AI-controlled C130 landing on the airstrip. I managed to make it land, but at the middle of the airstrip it banks to the left and "parks" partially on the strip and on the grass between the taxiway and the landing strip. How do I make it use the entire landing strip and turn at the end of it to move on the taxiway?

And how do I make it take-off again after a while to fly around until further notice?

Issue 6:

I mentioned I'm using an UAV in my mission earlier. How can I make it respawn after it's been shot down using the same settings it had when it was initialized (circleing above the WEST base at the pre-defined height AND player-accessible through a terminal Humvee or Laptop)?

The respawn script I'm using won't work, it keeps falling straight down after it respawns and the terminal keeps telling me it's destroyed when I try to access it when it respawns.

Issue 7:

How can I give specific units the ability to repair vehicles?

Issue 8:

How can I give a unit entering the driver/pilot seat a hint message only visible for him? (I've done it with a trigger-area at the vehicle's position with the condition this && vehicle player in thislist; so far, but I'm not very happy with this temporary solution because when the vehicle is not there/taken the hint message will still appear as soon as someone walks/drives over the trigger-area).

Issue 9:

I'm using this code to have a coloured title of a hint message:

hintSilent parseText format["<t color='#FFCC33'>[color="DarkOrange"]UAV Terminal:[/color]</t> to use it, walk up to the laptop and select the UAV function in the mousewheel menu. While using the UAV left klick on the map (default M) to designate a location you want to monitor. Q = gain height, Z/Y = reduce height, F = switch functions, N = optical modes (all key references according default key settings)"];

How can I break the text to use a new line? I want it to look like this:

[color="DarkOrange"]UAV Terminal:[/color]

to use it, walk up to the laptop
and select the UAV function in
the mousewheel menu. While using    [b]<<These breaks will be done automatically by the hintbox's size[/b]
the UAV left klick on the map
(default M) to designate a location
you want to monitor.    [b]<<< These won't[/b]
                       [b]<<< These won't - how do I force these?[/b]
Q = gain height         [b]<<< These won't[/b]
Z/Y = reduce height     [b]<<< These won't[/b]
F = switch functions    [b]<<< These won't ...[/b]
N = optical modes (all key references according default key settings)

The following two codes won't work.

\n

<br>

The first will be displayed in the hint as such and the second cuts off the text after it.

Issue 10:

Is it possible to pre-define the player's music volume setting on connect? Most people usually disable music, but it's an important part of my mission. Is it possible to override a player's setting so they can enjoy the intro music as well?

Issue 11:

Is it possible to have an AI-controlled aircraft (i.e. An-2) spawn on a player's connect, having the connecting player in cargo, flying pre-defined waypoints, land, drop-off the unit(s), take-off again and delete itself at another pre-defined waypoint?

And how do I disable the options "switch to pilot seat" and "jump out" from the in cargo/co-pilot-seat-connected player's mousewheel menu?

Issue 12:

I'm working on a new medevac idea - but I lack the know-how. I'm using kylanias chopper planned extraction script for this. So far the player can call a medevac chopper with the radio to bring him to the medic tent back at the base. But instead of the regular respawn on death I'd love to have a medevac chopper land somewhere near the victim, an immortal soldier to disembark the chopper, grab the incapacitated soldier and drag him into the medevac chopper to bring him back to base to revive him. If it's to dangerous, i.e. enemy tanks or attack choppers within a certain radius or a time limit exceeded the player should have the option to respawn as usual. It would be amazing if anyone could help me with this.

If it's easier to help me with any of these issues I can also send you my mission. Just PM me and I'll upload it for ya.

I'd be very grateful for working solutions! Please keep in mind that I'm quite new to all this when you respond to avoid further questioning about it and to spare us both some time.

Probably more questions as new issues arise...;)

Many thanks so far!

Cheers

p.s.: I love to add helpers to the mission intro's credits for working solutions as a symbol of my gratitude. that way your efforts are recognized forever! :)

It also adds a little something to the cinematic experience of my mission.

Edited by Bulldog Six

Share this post


Link to post
Share on other sites

Issue 2:

Use a trigger with condition: local player

You might wanna add this to the condition: && time > 5

Issue 4:

The ALICE module makes them drive cars. They have to have cars nearby obviously that's where SILVIE. I've found it common to not see any traffic or very rare traffic when using the official modules. Think several people have made custom scripts that increase the traffic.

Issue 5:

There is a script that allows you to script accurate flying. AFAIK you cannot make the AI do exactly what you want.

Issue 8:

Use this condition instead: vehicle player != player && driver (vehicle player) == player

You probably want to set this trigger to repeat.

Issue 9:

Use <br /> or <br> to create newlines.

Issue 10:

AFAIK - No.

Issue 11:

Use same condition to check for player join as in Issue 2 answer. However, you are gonna need more scripting logic to make it all work perfect.

Share this post


Link to post
Share on other sites

1: paste this into the init of the units that you do not want to have the radio, it will check for 60 seconds into mission start if the unit has the radio, if so it removes it and waits unitl unit gets radio again or total time of mission is more than 60 seconds, increase 60 if not long enough.

_null = this spawn {
if (_this != player) exitWith {};
while {time < 60} do {
if ("ItemRadio" in (weapons _this)) then {_this removeweapon "ItemRadio"};
waitUntil {time == 60 OR "ItemRadio" in (weapons _this)};
};

};

3: run this code on the UAV unit in its init line:

it will order the UAV to fly in its current above sealevel height, so i added a sleep 10 to allow it to reach the height you had decided and then start adjusting.

i also added a safe height of 50, in the if line, if the UAV is less than 50 meter high the flyingheight will be added 50 meter, and the height will not be adjusted down again unless you add something to the script.

also you can try to experiment on the sleep 0.1 in bottom of the loop if its needed faster or can do slower.

and the 10 second delay in top you can also alter if not needed, i just added it to make sure UAV is up in that height flying before starting to manipulate.

not usable as flyInHeight will not respond fast enough.

6: it sounds like you need setVelocity, maybe the reason it will fall down is because the vehicle respawn script simply setPos it up in tha air, (still not moving) plane goes in stall and crash to the ground.

if this is the case try this to push it to speed, name the UAV and add the below into the respawn script after it has respawned.

if (vehiclename == myUAVname) then {
_vel = velocity _vehicle;
_dir = direction _vehicle;
_speed = 150;
_vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+ (cos _dir*_speed),(_vel select 2)];
};

7: you can use addaction on the vehicles or units, but you would have to script a setDammage to 0 type script.

wich is fairly ok, using conditions in the actions etc.

you should also add an "fixing" animation as well to the caller so its not just a magic "bzzzt fixed", wich you can run with playMove.

12: very possible yes, will look more into that, need some testing.

PS: you should also have a look into the guide by Mr Murray in my sig, it will give you alot more understanding in how to do certain things as well as scripting knowledge.

Edit: for 1 there should maybe be a waituntil {!isNull player}; in top after the spawn line, for 3 maybe a if (!isServer) exitWith {}; at top also under spawn line.

i think it doesnt matter for the UAV, but for the radio i do think since JIP and the PVP scripts probably waits until its a player before adding anything as you said.

Edited by Demonized

Share this post


Link to post
Share on other sites

UPDATED:

Thanks Muzzleflash!

The line break code worked like a charm, but the solutions for Issue 2 and 8 need further tweaking.

Issue 2:

The intro for BLUFOR will start playing after 5 seconds, even if I'm on a different side (tested on CIVILIAN side). I also altered the trigger for the civilian intro the way you suggested (trigger condition: local player && time > 5), but the issue remains the same - keeps playing the BLUFOR intro.

There wasn't even a BLUFOR unit playing. Maybe the static C130 in which the trigger lies executes the trigger as BLUFOR (since the trigger is set to be activated by BLUFOR only). Either that or the local player command is not specific enough to distinguish the factions. I don't know.

Issue 8:

It doesn't give out the message related to the vehicle I entered.

I got a Chinook that should give out the hint

"CH47-F abandonment time 5 mikes"

and I got a UH60-M that should give out the hint

"UH60-M abandonment time 5 mikes".

The triggers are 2x2 meter squares in the cockpit area of each chopper, set as you described.

When I enter the Chinook I see it's message for a split second and then it's replaced by the message of the UH60-M.

I also get either one of those messages when I activate the parachute after HALO jumping on to the base (and I'm not even near the triggers!).

How do I specify the triggers to the vehicles?

Edited by Bulldog Six

Share this post


Link to post
Share on other sites
Issue 2:

The intro for BLUFOR will start playing after 5 seconds, even if I'm on a different side (tested on CIVILIAN side). I also altered the trigger for the civilian intro the way you suggested (trigger condition: local player && time > 5), but the issue remains the same - keeps playing the BLUFOR intro.

I read question too fast; forgot it was to be faction specific. Trigger only use their actual settings if the word 'this' is present. The solution is simple just add the side like this (for WEST):

local player && time > 5 && side player == west

For the others it is, east, civilian, resistance. You don't actually need the 'time > 5', however, for some reason I like to include it.

Regarding the MP question from your PM, yes this should work as intended from what I could read in your question. You want to run this for any connecting player, this will do that properly in both MP and JIP. I cannot conclude that the scripts you start from this trigger will though! If you just use hints for sideChats or something like that then it will.

Issue 8:

It doesn't give out the message related to the vehicle I entered.

I got a Chinook that should give out the hint

"CH47-F abandonment time 5 mikes"

and I got a UH60-M that should give out the hint

"UH60-M abandonment time 5 mikes".

All I read from your question was that you wanted a message to be displayed when the player got in as driver or pilot and I gave a naive answer that did that :). To solve this problem change the condition to:

driver myVehicle == player

Where myVehicle is the name you have given the vehicle. This will also solve the parachute issue.

For #8 why not use GET IN eventhandlers?

That approach was more complex given my original understanding of the problem. It does make more sense to use now and would be an valid method to solve the problem. Also a GetIn triggering does not mean you are in driver position. If you enter in back and then change seat from within to driver it will not trigger. You have to do more logic using this method.

Instead of using all thse trigger for issue #2 you can use a setup script that handles all this. I often use this approach. Create a trigger

Condition: local player && time > 2

On Act: 0 = [] execVM "playerJoined.sqf";

In playerJoined.sqf all setup for a player is done. The script will also run for JIPs.

//Don't need !isNull player check because of "local player" in condition
switch (side player) do
{
   case west: {
        //Do something for blufor
   };
   case east: {
       //Do something for Opfor
   };
   case civilian: {
      //For civilian players
   };
   case resistance: {
      //For independents
   };
};

//Do stuff for all - Welcome messages etc..

Edited by Muzzleflash

Share this post


Link to post
Share on other sites
1: paste this into the init of the units that you do not want to have the radio, it will check for 60 seconds into mission start if the unit has the radio, if so it removes it and waits unitl unit gets radio again or total time of mission is more than 60 seconds, increase 60 if not long enough.

_null = this spawn {
if (_this != player) exitWith {};
while {time < 60} do {
if ("ItemRadio" in (weapons _this)) then {_this removeweapon "ItemRadio"};
waitUntil {time == 60 OR "ItemRadio" in (weapons _this)};
};

};

That was helpful in getting rid of the radio in the gear menu, but not on the map screen or via keyboard-shortcut. I finally figured out what caused the radio issue and why the other code I tried didn't remove the shortcuts and the radio on the mapscreen. I had a trigger somewhere set to "activation by: Radio Echo". That's why the radio was still visible and usable on the map screen and also through the keyboard shortcut keys (0-0-5), even if the unit didn't have a radio in his gear! (d'oh! bohemia's logic is somewhat painful sometimes..)

The question now is: how do I create such a radio trigger that can only be used by blufor?

3: run this code on the UAV unit in its init line:

_null = this spawn {
sleep 10;
while {alive _this} do {
	_SeaHeight = getPosASL _this select 2;
	if ((getPos _this select 2) < 50) then {_SeaHeight = _SeaHeight + 50};
	_this flyInHeight _SeaHeight
	sleep 0.1;
};
};

it will order the UAV to fly in its current above sealevel height, so i added a sleep 10 to allow it to reach the height you had decided and then start adjusting.

i also added a safe height of 50, in the if line, if the UAV is less than 50 meter high the flyingheight will be added 50 meter, and the height will not be adjusted down again unless you add something to the script.

also you can try to experiment on the sleep 0.1 in bottom of the loop if its needed faster or can do slower.

and the 10 second delay in top you can also alter if not needed, i just added it to make sure UAV is up in that height flying before starting to manipulate.

Hmm... with this solution the UAV uses the sealevel as flyinheight level, right? meaning it keeps rising and rising and rising.. (the desired sealevel I need is around 2800 which is about 400 above ground level). since, as far as I understand this, it uses the sealevel as flyinheight level it flies higher. and because it flies higher, the sealevel of it increases as well so it tries to fly even higher to keep up with the sealevel height as flyinheight level. know what I mean? I need it to stick at 2800 ASL at all times - no matter if it's flying over a hillside or a valley. but I like the automatic safety precaution you added (50), that's a good crash-avoidance measure. however I need it to stick to a pre-defined sealevel until it has to take that safety measures.

initially when it spawns I already have it set to be at the desired height via

this setpos [(getpos this select 0),(getpos this select 1), 400];

the problem is that instead of holding that horizontal plane it goes up and down because of the altering terrain height.

7: you can use addaction on the vehicles or units, but you would have to script a setDammage to 0 type script.

wich is fairly ok, using conditions in the actions etc.

you should also add an "fixing" animation as well to the caller so its not just a magic "bzzzt fixed", wich you can run with playMove.

Yes, I was thinking the same thing about the animation.

I'll use

UNIT playmove "ActsPercSnonWnonDnon_carFixing2";

but I'm unaware what I should use instead of "UNIT" - is it "player", or "this" or what? basicly I just want the civilian side to be able to perform repairs on the field because they don't have choppers in my mission.

I'm just a little riddled how to combine the mousewheel menu repair action with the animation mentioned above and the setdamage 0.

The only similar code I've been using so far was this refueling code:

this addeventhandler ["fuel", {(_this select 0.5) setfuel 1}];

I'll check that addaction page again, but I doubt it'll be a big help how to solve this riddle in my head.

12: very possible yes, will look more into that, need some testing.

PS: you should also have a look into the guide by Mr Murray in my sig, it will give you alot more understanding in how to do certain things as well as scripting knowledge.

Edit: for 1 there should maybe be a waituntil {!isNull player}; in top after the spawn line, for 3 maybe a if (!isServer) exitWith {}; at top also under spawn line.

i think it doesnt matter for the UAV, but for the radio i do think since JIP and the PVP scripts probably waits until its a player before adding anything as you said.

Thanks, I'd really love to see this work. I wonder how one can make the flight in the medevac chopper as authentic as possible. I'd love to have a view like this when inside the chopper:

Sorry, I forgot how to properly post a youtube video (I tried the youtube button with with the link and several parts of it as well - it wouldn't work in the post-preview, so..

Do you think that's possible? It would be weird if one would just sit in the chopper as usual.

Share this post


Link to post
Share on other sites

this became a big post, so i hidden it in spoiler :)

That was helpful in getting rid of the radio in the gear menu, but not on the map screen or via keyboard-shortcut. I finally figured out what caused the radio issue and why the other code I tried didn't remove the shortcuts and the radio on the mapscreen. I had a trigger somewhere set to "activation by: Radio Echo". That's why the radio was still visible and usable on the map screen and also through the keyboard shortcut keys (0-0-5), even if the unit didn't have a radio in his gear! (d'oh! bohemia's logic is somewhat painful sometimes..)

The question now is: how do I create such a radio trigger that can only be used by blufor?

i dont know really, i know how to make it only work for a specific side, but it can be activated by all players.

Radio on the map screen after it is removed from inventory? then its something special added by those PvP scripts, because on wiki and in my editor there is no radio on map after i have removed it from inventory.

Hmm... with this solution the UAV uses the sealevel as flyinheight level, right? meaning it keeps rising and rising and rising.. (the desired sealevel I need is around 2800 which is about 400 above ground level). since, as far as I understand this, it uses the sealevel as flyinheight level it flies higher. and because it flies higher, the sealevel of it increases as well so it tries to fly even higher to keep up with the sealevel height as flyinheight level. know what I mean? I need it to stick at 2800 ASL at all times - no matter if it's flying over a hillside or a valley. but I like the automatic safety precaution you added (50), that's a good crash-avoidance measure. however I need it to stick to a pre-defined sealevel until it has to take that safety measures.

initially when it spawns I already have it set to be at the desired height via

this setpos [(getpos this select 0),(getpos this select 1), 400];

the problem is that instead of holding that horizontal plane it goes up and down because of the altering terrain height.

yeah, ive tried various variations of this, and the flyinheight command does not react fast enough to get a good usable result.

latest attempt oushing a training ring around at height(wich works) but the plane is not able to follow the changes fast enough:

_null = [] spawn {
while {true} do {
	tester setPosASL [position plane select 0, position plane select 1, 1000];
	_height = (getPos tester select 2);
	if ((getPos tester select 2) < 100) then {
		tester setPos [position plane select 0, position plane select 1, (position plane select 2) + 100];
	};
	plane flyInHeight (getPos tester select 2);
	sleep 0.01;
};
};

Yes, I was thinking the same thing about the animation.

I'll use

UNIT playmove "ActsPercSnonWnonDnon_carFixing2";

but I'm unaware what I should use instead of "UNIT" - is it "player", or "this" or what? basicly I just want the civilian side to be able to perform repairs on the field because they don't have choppers in my mission.

I'm just a little riddled how to combine the mousewheel menu repair action with the animation mentioned above and the setdamage 0.

The only similar code I've been using so far was this refueling code:

this addeventhandler ["fuel", {(_this select 0.5) setfuel 1}];

evnthandler and addaction is not the same, eventhandlers are for when "something" is happening, for example you die("killed"), vehicle is empty fuel,("fuel") you fire your weapon("fired") etc.

addAction is something you add to a object, and anyone looking at it wich fullfills any conditions if you have can scroll mouse when aiming at object and activate the action, wich will launch a script, with this passed to the script:

_object_Action_was_on_the_car = _this select 0;

_player_who_activated_object = _this select 1;

now you see that you can choose who to play the animation on.

example:

paste this in init of the vehicles you wish to have repair action on them if damaged, in this case i just used if it is damaged just even slightly.

but also only if its not completely destroyed, 1 or more, and the player needs to be a civilian also, look at the code and compare with the info on the link here to see what to alter to suit your needs.

_id = this addAction ["repair", "repair.sqf", [], 1, false, true, "", "(getDammage _target) < 1 AND (getDammage _target) > 0 AND (side _this) == civilian AND (vehicle _this) == _this"];

and this would be something your repair.sqf should look like:

_vehicle = _this select 0;                     	// this is the vehicle.
_playerUnit = _this select 1;                        // this is the repairing player.
_playerUnit playMove "some_kind_of_animation";  	// here the player starts the animation.
_vehicle setDammage 0;                               // here we reset the damage of the vehicle to 0.
_vehicle setFuel 1;                                  // here we fill up the fuel tank.
// this is a sqf script so it will exit here on its own, no need to end it.
// btw, this is comment line, all start with // or several lines with /* lines */

script is not fancy at all, you should perhaps make pauses and not insta repair, also maybe repair in steps, so its not all in one go etc.. but thats details for you

And the action will always be on the vehicle, but it will only show when the conditions are true, in this case all 4 below needs to be true:

1: damage is more than 0. (fully repaired)

2: damage is less than 1. (destroyed)

3: the one looking at the vehicle must be a civilian.

4: the one looking at the vehicle must be outside it on foot.

if only 1 of these is not true, then the action is hidden for that player.

Thanks, I'd really love to see this work. I wonder how one can make the flight in the medevac chopper as authentic as possible. I'd love to have a view like this when inside the chopper:

Sorry, I forgot how to properly post a youtube video (I tried the youtube button with with the link and several parts of it as well - it wouldn't work in the post-preview, so..

Do you think that's possible? It would be weird if one would just sit in the chopper as usual.

yeah thats possible, it looks like the default "wounded" part of the first aid modules, wich uses some screen effects to simulate wounded state.

the layout of the script with small details added in inbetween is like this:

1: spawn a heli with crew with BIS_fnc_spawnVehicle, or use a already placed one in editor, assignAsCargo, moveInCargo a medic inside with this allowDamage false in its initline, maybe do same for heli to have it be invincible.

2: driver domove heli to the nearest isFlatEmpty area near the getPos "patient unit".

3: then unassignVehicle of a medic you have inside heli, and make him doMove to the getPos woundedUnitName.

4: once there, playMove the animations to pick up from ground and attachTo the wounded to the medic.

5: medic domove back to getPos heli, once there, playmove unload animation on medic, moveInCargo the wounded in heli and assignAsCargo orderGetIn heli on medic for him to board, and domove driver heliname to base or mash position.

6: once there, playmove unload, carry, attachTo, domove to mash, playmove unload, setDammage 0 on wounded and reset the screen effects to be normal.

but as you can figure out by now, this is not a small task to get working "authentic", ive higlighted alot of words in the layout, use this page to check what they are and how they are used.

also this link is for the Animation viewer:

Share this post


Link to post
Share on other sites
Radio on the map screen after it is removed from inventory? then its something special added by those PvP scripts, because on wiki and in my editor there is no radio on map after i have removed it from inventory.

Nono! I tried to explain to you how this "bug" happens. It's not the pvp script pack.

To reproduce this bug just place a player without radio on the map, then place a trigger anywhere on the map (size can be 0 & 0, don't matter), and choose in the "Activation by"-dropdown menu any radio channel (i.e. "Radio: Echo"). That will force the radio in the map view and also enable triggering the radio trigger with 0-0-5 on your keyboard. No matter if noone on the map has a radio, and no matter if showRadio=false in the description.ext - the radio will always be accessible through the map and through the keyboard shortcuts (0-0-..) as long as that trigger is in the mission.

Thanks for the long post! I'll see if I can figure it all out after sleeping for a while :-)

p.s.: reg. Issue 12 you forgot to mention how to add the player to the medevac's cargo without him sitting in it like a regular healthy passenger. you think one can lie him down flat on the medevac's floor?

Cheers

Share this post


Link to post
Share on other sites

is it possible to group the Radio trigger with the person who shall be able to use it?

in other words, what would the trigger condition be "if man_X radios ECHO" ?

Share this post


Link to post
Share on other sites
is it possible to group the Radio trigger with the person who shall be able to use it?

in other words, what would the trigger condition be "if man_X radios ECHO" ?

btw i got the radio issue, you mentioned, just got confused when you said it was showing on map, though you clearly meant you could press 0,0 on map, i see that now.

on topic:

No that doesnt work as you change the trigger to a present or not present one then, but i found the solution:

http://community.bistudio.com/wiki/setRadioMsg

Radio <letter> - The trigger will be activated by a radio command available to all players leader of a group or possess a radio. Activation of radio triggers can be limited to specific players using the setRadioMsg command. Radio triggers do not make use of the six conditions below, or wait for the Countdown/Timeout Counters!

more info here:

PS: info came from this thread, a simple search for radio triggers in these forums and presto. ;)

hint for future postings and quesions..

having one thread for a specific problem is great if the thread is named like "disable radio triggers for civilians", then the next guy/girl/heshe can find your already answered thread by a simple search if they have the same question.

you see how titles work in BI forums?

not lecturing, just mentioning it eh :)

http://forums.bistudio.com/showthread.php?t=87506&highlight=radio+triggers

you can for your MP mission place in initline of the civilians

2 setRadioMsg "NULL"

then the "bravo radio trigger will not show, even for JIP i believe.

1 is alpha, 3 charlie etc..

you can also try to instead of init line, place this in init.sqf something like this:

_null = [] spawn {
waitUntil!isNull player};
if ((side player) == civilian) then {
	// this will set the "bravo" radio trigger to not show for civilians.
	2 setRadioMsg "NULL";
};
};

edit: for good practice its good to keep your init.sqf as clean as possible, but i use small snippets like that myself, others would probably call it as a seperate script instead, its no matter on functionality, but just organizing.

p.s.: reg. Issue 12 you forgot to mention how to add the player to the medevac's cargo without him sitting in it like a regular healthy passenger. you think one can lie him down flat on the medevac's floor?

i would use a combination of attachTo and switchmove (stay in a lying animation, like the wounded one).

but this might prove to be difficult to look good when flying, you can see how attachTo works, by placing a heli on map named heli, then place yourself as player and in player init:

this attachTo [heli[0,1,2]];

numbers are x,y,z in relation to center of object(heli) and its direction.

x = left, right of object

y = back, front of object

z = down, up of object.

positive values is right, front, up

negative values left, back, down

so a this attachTo [heli,[0,-2,1]] would place you at center, 2 meter back of and 1 meter above center of heli.

Edited by Demonized

Share this post


Link to post
Share on other sites

AAAARGHHHHH!!!!! effin' %!(/"$(&%!!!

see, this is what I'm talking about.. I do my homework, search the forums, read the frickin' wikis and yet this effin bastard editor won't do what I tell him to. not even the most simple things work!

I'm having trouble with the "attachto" command.

I'm trying to attach some chairs (chair_1,chair_2,chair_3, ..) and little objects to a table (table_1) because the table seems to stay on an elevated part of a building, like a "veranda" on a hillside if you will. no matter where and how I put it, it just won't work!

I used these, none worked:

chair_1 attachto [table_1,[-0.4,0,0]]; chair_1 setdir 90;  //within the table's init
this attachto [table_1,[-0.4,0,0]]; this setdir 90;  // within the chair's init
chair_1 attachto [table_1,[-0.4,0,0]]; chair_1 setdir 90;  //chair's init
chair_1 attachto ["table_1",[-0.4,0,0]]; chair_1 setdir 90;  // etc.. etc.. etc..

none worked.

I've tried putting the commands in the init line of the chairs, in the init line of the table etc. - nothing happened. the objects are within a trigger (which is not at all related to the attachto issue), is that a problem?

-- and thx for the input, the repair script worked wonderful! only odd thing about it is that when fixing a vehicle with the mentioned animation I can move my view so far behind me, as if my neck broke backwards.. hmm.. not a major issue, but if fixable I'd apreciate the advice.

Share this post


Link to post
Share on other sites

it just doesnt work with those objects, it works fine on vehicles, and units, i have no better explanation for you im afraid, i did test command on chair and table from furniture list, but nogo, then used same code on predator drone and tractor, and i got a screwy transformer (it worked).

Share this post


Link to post
Share on other sites

Thank you for confirming - at least now I know it's not possbile. I thought I was unable to do even such a simple thing, kinda frustrated me.:rolleyes:

Cheerio!

Share this post


Link to post
Share on other sites

How do I disable the AI chopper pilot's talking/giving orders?

When I sit in an AI controlled chopper which has waypoints the pilots talk to each other - one pilot says "move to ...(coordinates/distance & direction)" and the chopper starts moving. I would like to disable that. How do I mute the pilots?

I've tried putting "player setVariable ["BIS_noCoreConversations", true];" in the manned chopper's init line, but that didn't work. I guess that's only for the usual "Did you see anything recently?"-talk..

Share this post


Link to post
Share on other sites

where can I edit the title of a group as seen in the unit selection screen?

unitselect.jpg

Share this post


Link to post
Share on other sites

You can't, but you can control the order by cutting and pasting so you at least get to start on 1-1-A. I setup my missions so I get 1-1-A be the Alpha squad, 1-1-B the Bravo squad and so on. Doesn't mean anything of course, but makes it look a little prettier. Then I give the units descriptions that says i.e. Alpha Squad Leader and group ID's to match. What's with the blurring? :p

Share this post


Link to post
Share on other sites
You can't, but you can control the order by cutting and pasting so you at least get to start on 1-1-A. I setup my missions so I get 1-1-A be the Alpha squad, 1-1-B the Bravo squad and so on. Doesn't mean anything of course, but makes it look a little prettier. Then I give the units descriptions that says i.e. Alpha Squad Leader and group ID's to match. What's with the blurring? :p

yes I noticed that as well. it changes depending on how often the group got replaced by other groups placed afterwards. I thought there must be a way to edit that. searched all my mission files for that text, couldn't find anything, so it's gotta be depending on the unit's id or so.

about the blurring: I haven't officially released my mission yet so I didn't want to reveal some unit's information just yet. just so it's still fresh at the release.. ;) no big thing really, just evading copycats.

Share this post


Link to post
Share on other sites

Is there a way to limit a radio trigger to a signgle unit or two? i.e. only squad leaders can trigger a "Radio: Alpha" trigger.

Share this post


Link to post
Share on other sites

Group the trigger with the unit, that way it becomes a "vehicle" trigger and triggers for that unit. For Radio type thing, maybe setRadioMsg to disable it for non-squad leaders?

Share this post


Link to post
Share on other sites
Group the trigger with the unit, that way it becomes a "vehicle" trigger and triggers for that unit. For Radio type thing, maybe setRadioMsg to disable it for non-squad leaders?

I knew about the grouping, but that doesn't work with a radio trigger because the trigger activation turns to vehicle instead of radio.

Isn't there any condition I can enter to limit the radio trigger activation by a unit name or id? (preferrably an array code, i.e. unit1 OR unit2 can activate the radio trigger).

I don't know how to translate that into code language..

dunno about setRadioMsg - the wiki is awful short in it's usage and abilities.:confused:

Edited by Bulldog Six

Share this post


Link to post
Share on other sites

Condition is mostly ignored when it's a radio command.

Share this post


Link to post
Share on other sites

_players_that_see_the_radio_trigger = [unit1, unit2];
{
if (_x == player) then {
	1 setRadioMsg "Alpha Radio wich is shown with this text";
} else {
	// alpha radio not shown.
	1 setRadioMsg "NULL";
};
} foreach _players_that_see_the_radio_trigger;

for a SP mission you can do this:

start from init.sqf:

_null = player execVM "scriptname.sqf";

scriptname.sqf

_players_that_see_the_radio_trigger = [unit1, unit2];
while {true} do {
_unit = player;
if (_unit in _players_that_see_the_radio_trigger) then {
	1 setRadioMsg "Alpha Radio wich is shown with this text";
} else {
	// alpha radio not shown.
	1 setRadioMsg "NULL";
};
waitUntil {_unit != player};
};

Edited by Demonized
added SP version, constant check.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×