Home   Help Search Login Register  

Author Topic: that old chestnut JIP  (Read 5552 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkattack

  • Former Staff
  • ****
Re: that old chestnut JIP
« Reply #15 on: 14 Jan 2008, 22:42:09 »
many thanx mate ...
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Sick

  • Members
  • *
    • Dev-Heaven.net
Re: that old chestnut JIP
« Reply #16 on: 24 Jan 2008, 15:10:00 »
It depends what "no player object" means. If it means player is nil, then no, that line won't work at all (and will be simply ignored). However, as far as I am aware, player is objNull when it is not set to a real player object at the start of the game, so isNull player will be true and alive player will be false. This is why I prefer waitUntil { not (isNull player) } rather than waitUntil { alive player } or even waitUntil { player == player } since it is much clearer why you are waiting.
I think you are mistaken mate, im not 100% sure, can't test it atm, but afaik, a waitUntil will always wait until the condition is true,
even if the condition contains nil variables. It will simply wait until the variables are not nil and the condition becomes true.
« Last Edit: 24 Jan 2008, 15:29:39 by Sick »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: that old chestnut JIP
« Reply #17 on: 24 Jan 2008, 23:42:04 »
Actually, on testing I find that you are right about the operation of waitUntil. Sorry! waitUntil does wait until the condition is actually true, rather than just being non-false as I suspected. Still, I think my other statements are correct in spite of this error (specifically that player is defined as a null object, rather than being undefined/nil, on a dedicated server throughout a game or a dedicated client at the start of a game). I'm sure I've successfully used this particular value directly in if statements as well as in waitUntil (both then and else clauses of an if statement are ignored if there is an undefined value anywhere in the logical expression). Still, I haven't done a specific MP test on this, so I might still be wrong in the other parts of my original statement.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline sharkattack

  • Former Staff
  • ****
Re: that old chestnut JIP
« Reply #18 on: 26 Mar 2008, 20:18:02 »
the script  posted by MAN THE MAN  works great  however during testing  when using Norrins revive script
we have found if the leader is awaiting revive   then the jip will spawn at startpont
(if he is lucky ... could be anywhere )

would it be possible to have jip start at a  marker pos
(which is moved in conjunction with completed objectives )

thanks in advance guys    :)

trying to include in an upcoming co op pack
« Last Edit: 26 Mar 2008, 20:20:59 by shark attack »
"HOLY SARDINE" - see Shark-Attack meet his match

Offline paritybit

  • Members
  • *
Re: that old chestnut JIP
« Reply #19 on: 26 Mar 2008, 22:15:51 »
I was integrating the multiple respawn points script into my mission and had problems until I made the "main" respawn marker "respawn_west".  The problem was similar to what you are describing -- occasionally players would spawn in what seemed to be random locations (in the ocean mostly).  Once I changed the main respawn point (I think "base_respawn" or something") to "respawn_west" I didn't have any more trouble.
Heroes don't die -- they just respawn.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: that old chestnut JIP
« Reply #20 on: 27 Mar 2008, 01:49:44 »
would it be possible to have jip start at a  marker pos

Well, a JIP will execute init.sqf so you might try something like:
Code: [Select]
// whateverelse in init.sqf
waitUntil {local player};
Sleep 0.1;
player setPos getMarkerPos "mk_respawn1";

Offline sharkattack

  • Former Staff
  • ****
Re: that old chestnut JIP
« Reply #21 on: 28 Mar 2008, 16:53:37 »
thanks mate ...
will give it a go
cheers   :)
"HOLY SARDINE" - see Shark-Attack meet his match

Offline sharkattack

  • Former Staff
  • ****
Re: that old chestnut JIP
« Reply #22 on: 26 Apr 2008, 14:01:10 »
im trying to have  players join in progress at a marker (startpoint)..  the marker will move as objectives are cleared

"mk_startpoint" setMarkerPos getMarkerPos "mk_pos_two";

this seems to work as the marker shifts position  when  conditions are met
however the jip still starts at the markers origional position

anyone see what im doing wrong

// init.sqf

if (isServer) then {intro = true; publicVariable "intro";};
server execVM "revive_init.sqf";
waitUntil {local player};
Sleep 0.1;
player setPos getMarkerPos "mk_startpoint";


many thanks  in advance     ???





"HOLY SARDINE" - see Shark-Attack meet his match

Offline Loyalguard

  • Former Staff
  • ****
Re: that old chestnut JIP
« Reply #23 on: 27 Apr 2008, 00:56:34 »
I am assuming that for JIP Players that the marker position has not been updated as it has moved so it is wherever it was when you placed it at mission start.

The only solution that immediately comes to mind is to store/update mk_startpoint's position as a public variable so when a JIP player joins you can use public variable to update the marker position then setPos the player to it.  So, whenever you move the marker also re-broadcast the pv and then add a move marker sequence using the pv for JIP players.  This solution requires 1.09 or above since it was only after 1.09 that public variable could be used for arrays.  If not using 1.09 or later then you would have to use a separate pv for the x, y, and z elements of the position array.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: that old chestnut JIP
« Reply #24 on: 27 Apr 2008, 08:42:51 »
I think the markers, as any other global object in the game which position has changed, are synced with any new client connecting.
Try the following, change the Sleep 0.1 by Sleep 2