Home   Help Search Login Register  

Author Topic: Two simple questions I need help with  (Read 1875 times)

0 Members and 1 Guest are viewing this topic.

Offline Fmrfox

  • Members
  • *
Two simple questions I need help with
« 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)

Offline Fmrfox

  • Members
  • *
Re: Two simple questions I need help with
« Reply #1 on: 03 Sep 2007, 03:03:20 »
2) Ok so the action menu part would be

Code: [Select]
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.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Two simple questions I need help with
« Reply #2 on: 04 Sep 2007, 11:25:37 »
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.

Offline Fmrfox

  • Members
  • *
Re: Two simple questions I need help with
« Reply #3 on: 04 Sep 2007, 14:58:54 »
Hi Mando, how do I attach that to the object through the init.sqf?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Two simple questions I need help with
« Reply #4 on: 04 Sep 2007, 15:32:13 »
Code: [Select]
;init.sqf
your_codes_object addAction ["Obtain Codes", "gotcodes.sqs"];

Offline Fmrfox

  • Members
  • *
Re: Two simple questions I need help with
« Reply #5 on: 04 Sep 2007, 18:15:02 »
Wow that simple, lol :) Thanks

Could you shed any light on my first question?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Two simple questions I need help with
« Reply #6 on: 04 Sep 2007, 20:14:41 »
Code: [Select]
? {alive _x} count units group player == 0: hint "all dead"

Offline Fmrfox

  • Members
  • *
Re: Two simple questions I need help with
« Reply #7 on: 04 Sep 2007, 22:42:56 »
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?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Two simple questions I need help with
« Reply #8 on: 04 Sep 2007, 23:01:29 »
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  ;)

Offline Fmrfox

  • Members
  • *
Re: Two simple questions I need help with
« Reply #9 on: 04 Sep 2007, 23:25:59 »
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: