Home   Help Search Login Register  

Author Topic: Join in Progress - help  (Read 3153 times)

0 Members and 1 Guest are viewing this topic.

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Join in Progress - help
« on: 23 Jun 2008, 17:11:55 »
Hi!

I got a problem. In my mission I am running haloscript by ManDay and Norrins revive script with JIP. But since I am starting off in a helicopter it is acting up. So the thing i want to know is where i can find JIP files to add to my mission. Is it even possible to have JIP from heli?

The way it works in norrins revive script is by using marker. Would it be possible to instead of using the marker named "base1" use a unit (heli) called heli1?

I have searched around the internet and these forums for missions/intro's scripts i can use to add JIP to my mission but without any luck. Lots of talk about it but not any helping files to just add into my mission.

Anyone got any way to help me? I would attach my mission if I could. But having problems attaching files.

Code: [Select]
/*

/*

RESPAWN AT BASE SCRIPT (JIP)

© JANUARY 2008 - norrin (norrins_nook@iprimus.com.au)
****************************************************************************
respawn_at_base_jip.sqf
*/

_spawn_pos = _this select 0;
_name = _this select 1;

_no_respawn_points  = NORRN_revive_array select 12;
_Base_1 = NORRN_revive_array select 13;
_Base_2 = NORRN_revive_array select 14;
_Base_3 = NORRN_revive_array select 15;
_Base_4 = NORRN_revive_array select 16;

if (_spawn_pos == 1 && _Base_1 != "" && !no_base_1 && !no_base_1b) then
{
_name setpos getMarkerPos _Base_1;
if (local _name && isplayer _name) then {titleText ["You have respawned at position 1", "PLAIN", 0.5]};
};
if (_spawn_pos == 1 && _Base_1 != "" && no_base_1 || _spawn_pos == 1 && _Base_1 != "" && no_base_1b) then
{
titletext ["This spawn point is currently occupied by enemy forces", "PLAIN", 0.3];
if (_no_respawn_points == 1) then {_dialog_1 = createDialog "respawn_button_1b";ctrlSetText [1, _Base_1];};
if (_no_respawn_points == 2) then {_dialog_1 = createDialog "respawn_button_2b";ctrlSetText [1, _Base_1];ctrlSetText [2, _Base_2];};
if (_no_respawn_points == 3) then {_dialog_1 = createDialog "respawn_button_3b";ctrlSetText [1, _Base_1];ctrlSetText [2, _Base_2];ctrlSetText [3, _Base_3];};
if (_no_respawn_points == 4) then {_dialog_1 = createDialog "respawn_button_4b";ctrlSetText [1, _Base_1];ctrlSetText [2, _Base_2];ctrlSetText [3, _Base_3];ctrlSetText [4, _Base_4];};
};

if (_spawn_pos == 2 && _Base_2 != "" && !no_base_2 && !no_base_2b) then
{
_name setpos getMarkerPos _Base_2;
if (local _name && isplayer _name) then {titleText ["You have respawned at position 2", "PLAIN", 0.5]};
};
if (_spawn_pos == 2 && _Base_2 != "" && no_base_2 ||  _spawn_pos == 2 && _Base_2 != "" && no_base_2b) then
{
titletext ["This spawn point is currently occupied by enemy forces", "PLAIN", 0.3];
if (_no_respawn_points == 2) then {_dialog_1 = createDialog "respawn_button_2b";ctrlSetText [1, _Base_1];ctrlSetText [2, _Base_2];};
if (_no_respawn_points == 3) then {_dialog_1 = createDialog "respawn_button_3b";ctrlSetText [1, _Base_1];ctrlSetText [2, _Base_2];ctrlSetText [3, _Base_3];};
if (_no_respawn_points == 4) then {_dialog_1 = createDialog "respawn_button_4b";ctrlSetText [1, _Base_1];ctrlSetText [2, _Base_2];ctrlSetText [3, _Base_3];ctrlSetText [4, _Base_4];};
};

if (_spawn_pos == 3 && _Base_3 != "" && !no_base_3 && !no_base_3b) then
{
_name setpos getMarkerPos _Base_3;
if (local _name && isplayer _name) then {titleText ["You have respawned at position 3", "PLAIN", 0.5]};
};
if (_spawn_pos == 3 && _Base_3 != "" && no_base_3 || _spawn_pos == 3 && _Base_3 != "" && no_base_3b) then
{
titletext ["This spawn point is currently occupied by enemy forces", "PLAIN", 0.3];
};

if (_spawn_pos == 4 && _Base_4 != "" && !no_base_4 && !no_base_4b) then
{
_name setpos getMarkerPos _Base_4;
if (local _name && isplayer _name) then {titleText ["You have respawned at position 4", "PLAIN", 0.5]};

};
if (_spawn_pos == 4 && _Base_4 != "" && no_base_4 || _spawn_pos == 4 && _Base_4 != "" && no_base_4b) then
{
titleText ["This spawn point is currently occupied by enemy forces", "PLAIN", 0.3];
};

if(true) exitWith {};

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Join in Progress - help
« Reply #1 on: 23 Jun 2008, 20:36:17 »
Not sure if Im understanding your problem. JIP is nothing else than a player joining after the mission has started, and its ArmA will run init.sqf as for anyother player. The problem, if any, might be that the starting position when the game starts might not be good anymore for that player to start the mission so you might need to reposition him somewhere else.

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: Join in Progress - help
« Reply #2 on: 23 Jun 2008, 22:25:39 »
In a mission called Black Sword they had this join in progress with this halo script. And when u joined a server with a mission in progress there u started off in the heli. Would it be possible to have ppl JIP spawn somewhere else? If so what should I do?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Join in Progress - help
« Reply #3 on: 23 Jun 2008, 23:03:10 »
First define a condition to check if the player needs to be placed somewhere else or not.
If the codition is met (the check is done in init.sqf), then you check if player is inside a vehicle.
If player is inside a vehicle you execute the action GETOUT to force the player to exit the vehicle.
Once the player is outside the vehicle you setPos him where you want.

Code: [Select]
// init.sqf

// WHATEVER HERE

[]spawn
{
   if (local player) then
   {
      if (condition to be check here to place the player somewhere else) then
      {
         if (vehicle player != player) then
         {
            player action ["getOut", vehicle player];
         };
         waitUntil {vehicle player == player};
         player SetPos THE_POSITION_YOU_WANT_FOR_THE_JIP_HERE;
      };
   };
};
// WHATEVER HERE

Example of condition:
Code: [Select]
if (((vehicle player) distance (vehicle leader group_one)) > 100) then
{

};

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: Join in Progress - help
« Reply #4 on: 24 Jun 2008, 15:18:07 »
where should the condition be put and what do i put inside {}?

And u use get out yes. but they will be relocated before they fall to their deaths right?
« Last Edit: 24 Jun 2008, 15:23:36 by GomerPyle »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Join in Progress - help
« Reply #5 on: 24 Jun 2008, 16:21:52 »
Yes to the second question.
About the first question, the condition depends on your mission requirements (I already added an example), and about "where", in the init.sqf, as explained above.

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: Join in Progress - help
« Reply #6 on: 24 Jun 2008, 17:03:38 »
ok. sry. i misread your post. now i understand it. thank you mandoble. what should I have done without you.

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: Join in Progress - help
« Reply #7 on: 25 Jun 2008, 15:31:33 »
Hi!

Would something like this work? I used your condition as I think it means "if" the leader is more than 100meters from spawn (heli1) then JIP players will spawn at my location.

Code: [Select]
init.sqf
[]spawn
{
   if (local player) then
   {
      if (((vehicle player) distance (vehicle leader group_one)) > 100) then
      {
         if (vehicle player != player) then
         {
            player action ["getOut", vehicle player];
         };
         waitUntil {vehicle player == player};
         player SetPos getMarkerPos "Base";    
         };
   };
};

And if this works ppl joining my mission in progress will just select a slot and join the game at my markers position i hope. hehe
« Last Edit: 25 Jun 2008, 15:33:21 by GomerPyle »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Join in Progress - help
« Reply #8 on: 25 Jun 2008, 17:13:46 »
Well, dont know. As said it always depend on the mission requirements. In your example I dont know where "Base" marker is. Is base marker always away of the enemy and safe to sepos a new player?

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: Join in Progress - help
« Reply #9 on: 25 Jun 2008, 19:22:15 »
how do i find position then?

it did not work the way it was now. I got defriefing once i tried to reconnect.

Code: [Select]
init.sqf

[]spawn
{
   if (local player) then
   {
      if (((vehicle player) distance (vehicle leader group_one)) > 100) then
      {
         if (vehicle player != player) then
         {
            player action ["getOut", vehicle player];
         };
         waitUntil {vehicle player == player};
         player SetPos position[]={9308.988281,0.244440,12317.997070};         
         };
   };
};

also group_one is that the name of the group? so i need to have group called group_one or something?
« Last Edit: 25 Jun 2008, 19:29:59 by GomerPyle »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Join in Progress - help
« Reply #10 on: 25 Jun 2008, 20:12:13 »
group_one and having the player to spawn near a group leader was just an example. Where to place a player that is joining your game is a criteria entirely yours and dependant entirely on your mission design.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Join in Progress - help
« Reply #11 on: 25 Jun 2008, 20:47:15 »
I think we are all getting a bit confused. What you need to do, GomerPyle, is literally to forget the scripting for a minute. Tell us what game effect you want to achieve and maybe we can understand what script you actually want to make. Giving us broken code which doesn't do what you want, still won't do what you want when we fix it.

As far as I can tell, what you want to do is have everyone start in a helicopter at the start of the mission. If someone joins in progress, then they should start the game by appearing inside that helicopter. Am I right? Have you thought of what should happen if the helicopter has been destroyed before the player JIP?
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Join in Progress - help
« Reply #12 on: 26 Jun 2008, 19:11:30 »
I think what gomer is Implying is that units do infact start in a helo, was a condition has been met, they are all free falling. what he's asking is when all units are in free fall mode, and a player joins the game, he wants the player not to start in the helo. but where is particular unit is located in real-time.

TCM

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Join in Progress - help
« Reply #13 on: 26 Jun 2008, 19:46:36 »
aha, so free-falling too, but chuteless  :P

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Join in Progress - help
« Reply #14 on: 27 Jun 2008, 02:15:41 »
let's hope that the player doesn't end up a dart on the map! :P

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: Join in Progress - help
« Reply #15 on: 06 Jul 2008, 19:05:23 »
i am working doing it like mandoble said. Meaning once player join in progress they will be moved to a location.

// init.sqf

// WHATEVER HERE

[]spawn
{
   if (local player) then
   {
      if (((vehicle player) distance (vehicle leader group_one)) > 100) then //i am pretty sure this is checking if players already on the ground doing mission is further away than 100 meters.
      {
         if (vehicle player != player) then
         {
            player action ["getOut", vehicle player];
         };
         waitUntil {vehicle player == player};
         player SetPos THE_POSITION_YOU_WANT_FOR_THE_JIP_HERE; //I am not sure what to put here.
      };
   };
};
// WHATEVER HERE

But if I could just have the JIP working with the heli they start in it would be best..