OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: polvy on 27 Jan 2005, 16:23:55
-
I have a mission in mind where a small patrol is ambushed in CAT Afghanistan. I would like them to be able to radio for a medivac chopper or airstrike but would prefer the script for said actions to be tied to their vehicle. That way anyone in the squad can use it and if the vehicle is destroyed then so is the ability to radio for assistance. Does anyone know of such a script?
Thank you,
Polvy
-
I would do it like this:
Create a switch trigger that fires when the bolean condition radioTransmission (or whatever) is set to true. Use the trigger to start the Medvac chopper in the usual way (synchronize). Now you want to create a way for any player who gets close to the car to use the radio.
In the init.sqs of your mission you add the line:
publicVariable "radioTransmission" ; radioTransmission=false
This ensures that every machine, not just the server, in the game will be told whenever the variable radioTransmission toggles between true or false. Then, in the init line of the patrol car your write:
this addAction ["Use Radio", "radio.sqs"]
This gives any unit who gets within 3-5 meters of the car an action named "Use Radio". Then make a small script called radio.sqs that looks like this:
radioTransmission=true
exit
Now you have set the variable radioTransmission to true on all computers in the game, enabling anybody in the group to use the "radio" by aproaching the car.
Off course this will be a radio transmission without sound or texts. But they can be added without to much effort if you have sound files to go with your mission.
-
Thank you kindly for the response. I will try that out and let you know. I was however hoping to be able to tie the scripts into the vehicle in such a way that the players could move it around but if that is not possible then your suggestion will be a good "second best" option.
-
I was however hoping to be able to tie the scripts into the vehicle in such a way that the players could move it around but if that is not possible then your suggestion will be a good "second best" option.
My suggestion let's you move it around. That's why the addAction command is supposed to go in the init line of the patrol car ;)
-
My appologies. I did not read it closely enough the first time. I will report back with my findings as soon as I can. Thank you once again. :)
-
OK, I set everything up the way you instructed. Double and Quadruple checked everything and the "Use Radio" option appears. I have SnYpers "Land Chopper" script setup with several orbit waypoints and the SWITCH trigger synched to the CYCLE WP. The only problem I am encountering is that the SWITCH trigger is not firing when I select the "Use Radio" option. (i.e. the chopper never comes in.) I have some text assigned to the SWITCH trigger to let me know if it's firing and I get no text. Please Advise?
-
*bump* :-\
-
Can anyone provide some assitance with this issue? My mission is complete except for this trigger not firing. I've worked really hard on this one and it's a fun mission. Please Help.
-
A crude but working method:
Place an empty object (sandbag or whatever) anywhere on the map, preferebky out of view from the mission area. Name it controlUnit.
In the script that is suppose to fire the trigger you write:
controlUnit setDamage 1
Then make the switch trigger fire if:
!(alive controlUnit)
Killing objects from a script always works (because death is recorded on all machines) and you don't have to worry about the local/public variable problem.