Home   Help Search Login Register  

Author Topic: Squad Leader as a respawn point. Solved!  (Read 9556 times)

0 Members and 1 Guest are viewing this topic.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Squad Leader as a respawn point. Solved!
« Reply #15 on: 07 Jul 2009, 04:08:29 »
Rommel's does mostly the same as mine, but uses an continual loop rather than an event handler, so is less efficient. It also doesn't place the player behind the leader. Also, when there is no leader alive to spawn at, you will respawn out at sea ([0, 0, 0], the position of nullObject) rather than at base (all easy to add, but just so you know ;) ).

Does have the advantage that moving the spawn-point means that you will automatically spawn in a safe place, rather than in a wall, which is a big boon. Well, at least I assume respawn is that clever.

Scripts could be merged though, to get the best of both worlds.

@Rommel:
Code: [Select]
waituntil {
  "respawn_west" setMarkerPosLocal (getPos leader player);
  sleep 0.5;
  0 > 1
};
Is clearer as:
Code: [Select]
while { true } do {
  "respawn_west" setMarkerPosLocal (getPos leader player);
  sleep 0.5;
};
Since waitUntil implies you are running once-per-frame. while is better for loops with sleep in.
« Last Edit: 07 Jul 2009, 04:23:12 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Rommel92

  • Members
  • *
Re: Squad Leader as a respawn point. Solved!
« Reply #16 on: 07 Jul 2009, 06:01:37 »
Thanks for clearing that up for me, in any case, unfortunately respawn isn't that smart.  :whistle:
It does try to make an effort but.


Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Squad Leader as a respawn point. Solved!
« Reply #17 on: 07 Jul 2009, 12:47:02 »
Oh right. Still, plenty of other methods to ensure that the guy appears in a sensible place. You could spawn a local HeliH and see where it appears or use that BIS function I mentioned.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Cellus

  • Members
  • *
Re: Squad Leader as a respawn point. Solved!
« Reply #18 on: 14 Jul 2009, 07:08:26 »
Hello all.

I'm using a script to move respawn at random intervals to random people, but I have this problem:

Quote from: Spooner
Also, when there is no leader alive to spawn at, you will respawn out at sea ([0, 0, 0],

How would I overcome this?

And how do I move the marker behind, instead of onto a player? Or better yet, a certain distance from the player in the direction of original spawn?
« Last Edit: 14 Jul 2009, 07:50:42 by Cellus »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Squad Leader as a respawn point. Solved!
« Reply #19 on: 16 Jul 2009, 14:43:48 »
As I gave in examples above, it is best to keep the base marker in place and to only move the player from that position if there is a viable leader to move to. Saves continually moving the marker, too, so is more efficient.

If you need to move the marker, then:
Code: (place spawnpoint 5m behind the leader) [Select]
_spawnPos = getPos ((vehicle _leader) modelToWorld [0, -5, 0]);
"respawn_west" setMarkerPos _spawnPos;
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Kezei

  • Members
  • *
Re: Squad Leader as a respawn point. Solved!
« Reply #20 on: 23 Aug 2009, 20:20:00 »
Sorry for bringing up an older thread, especially if there is one newer, but how would one go about modifying this script so that you would spawn on your respective squad leader if and only if he's alive. If he's dead, you instead spawn as a crow?