OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: Fmrfox on 02 Sep 2007, 13:45:25
-
Ok, I have looked through the editors depot at the scripts and functions there and I have seen some things that I might be able to use. However I'm not sure if they are compatible with ARMA and I don't have the knowledge to check. I did some searches of the BIS forums but most of the threads went a little over my head. Apologies in advance as these are pretty simple problems.
1) I cant figure out how to check if a group is dead. I saw some discussion on this in a thread but like I said it went over my head. For one of the objectives in my MP co-op mission the players have to capture some critical enemy personnel. I have that sorted but I need to be able to check if they are alive so I can end the mission in failure if all three groups are killed.
2) I want to attach some code to an object that will give any player within 3m of it a new action while they remain within that distance. If they use that action it will fire off a line or two of hint text. (The players are supposed to be grabbing encryption codes from a radio and if they do, it will tell them the location of an otherwise unmarked target)
-
2) Ok so the action menu part would be
addAction [""Obtain Codes"", ""gotcodes.sqs""] ;
but Im not sure how to add that to any player who enters into the 3m radius in a MP environment.
-
You dont need to add it to players, but to the object itself. Do it in the init.sqs or init.sqf so any player joining the game will have the action available as soon as he aproaches the object. You should not take much care about the range (3m), as ArmA already uses similar ranges to make available actions for players.
-
Hi Mando, how do I attach that to the object through the init.sqf?
-
;init.sqf
your_codes_object addAction ["Obtain Codes", "gotcodes.sqs"];
-
Wow that simple, lol :) Thanks
Could you shed any light on my first question?
-
? {alive _x} count units group player == 0: hint "all dead"
-
Can I substitute "units group player" for "units group other_group_name"? As its not the players group I am interested in. Also does a single unit on its own count as a group of 1 or does the engine treat them differently?
-
Of course. And now a BIT TIP for your scripting, if you suspect something can be done, do it before even asking, you will learn quite a lot more that way ;)
-
Heh, yeah I know but I was away from my gaming computer at the time. Thanks for all your help and patience with me Mando. You are awesome! :good: