Jump to content

How do I update my respawn point?


Aphelion079

Recommended Posts

I have an idea for a mission where I can fly around the map and as I land at various airports/farps (or even overfly them if that's easier) it would update my respawn location if I were to crash.  Does anyone have any creative ideas on how to do this but still force the client to start at the initial starting airbase? 

Link to comment
Share on other sites

With standard, single-player DCS that seems exceedingly difficult right now. Since you are looking for creative solutions, here's a possible approach:

  • Along the route, set up airfields and farps with player-controlled aircraft.
  • Use server-side SSB to be able to selectively slot-block aircraft
  • During mission progress, enable the closest airfield/farp's aircraft for respawn, and disable all others with SSB
  • Obviously, the mission has to be played as multiplayer (self-hosted)

That should at least give a credible approximation of what you want. The wart is that abviously, all client aircraft are visible when choosing planes, but only one is selectable.

 


Edited by cfrag
  • Like 1
Link to comment
Share on other sites

Cfrag's approach is the one I would go for (but I already use SSB for other tasks). One day ED may give us the ability to enable/disable spawn slots with a simple trigger/setting.

Another option would be just to allow all aircraft to be spawnable but setup triggers that after 2 seconds of being spawned into - they blow up unless a flag is set to use that particular aircraft. It's not the most elegant solution - but could be done within the .MIZ file without requiring the use of server side scripts such as simple slot block, or needing to desanitize the client, and could then also allow missions to be self-sufficient in a .miz file so thus distributable. 

Moving forward - maybe the new 'password' feature on slots could be utilised. Apparently those slots don't show up except for people using passwords. I don't think it works with single player - but who knows - moving forward we may be able to set passwords dynamically on the fly - and that would be a great way to enable/disable slots.

Link to comment
Share on other sites

21 hours ago, Aphelion079 said:

I have an idea for a mission where I can fly around the map and as I land at various airports/farps (or even overfly them if that's easier) it would update my respawn location if I were to crash.  Does anyone have any creative ideas on how to do this but still force the client to start at the initial starting airbase? 

and to @cfrag and @Dangerzone, it's not hard to do, it's mostly done in fact (Mist function gets Player/client datas, and landing event gets airbase/farp/ship datas). Only work for Singleplayer as you can't spawn a client unit, but only a player unit (but initially you can have multiples client slot it's not an issue).

I only still have a little bug for spawning an "air start" client to an aircraft carrier you have landed at (works with a ground start airbase client, so I should find it).

  • Thanks 1
Link to comment
Share on other sites

16 minutes ago, toutenglisse said:

you can't spawn a client unit, but only a player unit

Ha! Thank you @toutenglisse! That explains why I never could get it to work (then again, I mostly create MP missions, so I have an excuse 🙂). I tried to dynamically alter the mission's data for the client slots, but never got far.

I'd be grateful if you have a short demo mission for me to see how you do it, so I can educate myself. 


Edited by cfrag
Link to comment
Share on other sites

@Aphelion079, @cfrag, @Dangerzone, I attached a mission example. To enable it in another mission, it requires Mist lua and the Respawn lua to be loaded at mission start (both luas can be extracted from mission example with 7zip, they are located in folder \l10n\DEFAULT\ inside the mission). In the example you can change units (it has hornets, Ka50, carrier and supercarrier) if you don't have the ones existing inside.

It has limitations (issues I've not overcome) : no Air start player/client units (only from ground, whatever the type), and no neutral player/client units (only red/blue).

Apart from that, it works for what I can see in all cases. When you enter mission as "player" (not in the example), or as "client", and you take off, you get a radio menu to respawn to last base you landed at (you get the same respawn if you crash), initial base if you have not landed elsewhere. It works whatever the coalition of the base.

Everytime you land at a base (airbase, farp or ship with helipad or aircraft carrier), you get a message to confirm landing detection (touch and go is enough), and that updates the place you'll respawn at if so.

EDIT : I've just corrected a little mistake preventing respawn on crash.

 

Test-Respawn-at-last-base.miz


Edited by toutenglisse
in post
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

1 hour ago, toutenglisse said:

@Aphelion079, @cfrag, @Dangerzone, I attached a mission example. To enable it in another mission, it requires Mist lua and the Respawn lua to be loaded at mission start (both luas can be extracted from mission example with 7zip, they are located in folder \l10n\DEFAULT\ inside the mission). In the example you can change units (it has hornets, Ka50, carrier and supercarrier) if you don't have the ones existing inside.

It has limitations (issues I've not overcome) : no Air start player/client units (only from ground, whatever the type), and no neutral player/client units (only red/blue).

Apart from that, it works for what I can see in all cases. When you enter mission as "player" (not in the example), or as "client", and you take off, you get a radio menu to respawn to last base you landed at (you get the same respawn if you crash), initial base if you have not landed elsewhere. It works whatever the coalition of the base.

Everytime you land at a base (airbase, farp or ship with helipad or aircraft carrier), you get a message to confirm landing detection (touch and go is enough), and that updates the place you'll respawn at if so.

EDIT : I've just corrected a little mistake preventing respawn on crash.

 

Test-Respawn-at-last-base.miz 74.83 kB · 0 downloads

 

What a wonderful reply! Thank you this exactly what I was looking for, I love this community!

Link to comment
Share on other sites

9 hours ago, toutenglisse said:

@Aphelion079, @cfrag, @Dangerzone, I attached a mission example. To enable it in another mission, it requires Mist lua and the Respawn lua to be loaded at mission start (both luas can be extracted from mission example with 7zip, they are located in folder \l10n\DEFAULT\ inside the mission). In the example you can change units (it has hornets, Ka50, carrier and supercarrier) if you don't have the ones existing inside.

It has limitations (issues I've not overcome) : no Air start player/client units (only from ground, whatever the type), and no neutral player/client units (only red/blue).

Apart from that, it works for what I can see in all cases. When you enter mission as "player" (not in the example), or as "client", and you take off, you get a radio menu to respawn to last base you landed at (you get the same respawn if you crash), initial base if you have not landed elsewhere. It works whatever the coalition of the base.

Everytime you land at a base (airbase, farp or ship with helipad or aircraft carrier), you get a message to confirm landing detection (touch and go is enough), and that updates the place you'll respawn at if so.

EDIT : I've just corrected a little mistake preventing respawn on crash.

 

Test-Respawn-at-last-base.miz 74.83 kB · 2 downloads

 

Here I am... having done so much so far with LUA and multiplayer missions, and never knew. Thanks so much for this - learning every day! 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...