canuckbrian

Random Spawn Only

9 posts in this topic

Hello,

Is there a way to turn off all other spawn location options except Random.

I don't want players being able to pick their spawn. I'm assuming I can just modify this file "ExileClient_gui_selectSpawnLocation_show.sqf", put it in my missions file, and add it to the config.cpp file.

/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display","_spawnButton","_listBox","_listItemIndex","_numberOfSpawnPoints","_randNum","_randData","_randomSpawnIndex"];
disableSerialization;
diag_log "Selecting spawn location...";
ExileClientSpawnLocationSelectionDone = false;
ExileClientSelectedSpawnLocationMarkerName = "";
createDialog "RscExileSelectSpawnLocationDialog";
waitUntil
{
    _display = findDisplay 24002;
    !isNull _display
};
_spawnButton = _display displayCtrl 24003;
_spawnButton ctrlEnable false;
_display displayAddEventHandler ["KeyDown", "_this call ExileClient_gui_loadingScreen_event_onKeyDown"];
_listBox = _display displayCtrl 24002;
lbClear _listBox;
{
    if (getMarkerType _x == "ExileSpawnZone") then
    {
        _listItemIndex = _listBox lbAdd (markerText _x);
        _listBox lbSetData [_listItemIndex, _x];
    };
}
forEach allMapMarkers;
_numberOfSpawnPoints = {getMarkerType _x == "ExileSpawnZone"} count allMapMarkers;
if (_numberOfSpawnPoints > 0) then
{
    _randNum = floor(random _numberOfSpawnPoints);
    _randData = lbData [24002,_randNum];
    _randomSpawnIndex = _listBox lbAdd "Random";
    _listBox lbSetData [_randomSpawnIndex, _randData];
};
true

Just not sure what to modify in there, or if it is actually the correct file to modify. Any help would be appreciated.

Thanks!

Share this post


Link to post
Share on other sites

Got it figured out.

Here's the code:

/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display","_spawnButton","_listBox","_listItemIndex","_numberOfSpawnPoints","_randNum","_randData","_randomSpawnIndex"];
disableSerialization;
diag_log "Selecting spawn location...";
ExileClientSpawnLocationSelectionDone = false;
ExileClientSelectedSpawnLocationMarkerName = "";
createDialog "RscExileSelectSpawnLocationDialog";
waitUntil
{
    _display = findDisplay 24002;
    !isNull _display
};
_spawnButton = _display displayCtrl 24003;
_spawnButton ctrlEnable false;
_display displayAddEventHandler ["KeyDown", "_this call ExileClient_gui_loadingScreen_event_onKeyDown"];
_listBox = _display displayCtrl 24002;
lbClear _listBox;

{
    if (getMarkerType _x == "ExileSpawnZone") then
    {
     _listItemIndex = _listBox lbAdd (markerText _x);
     _listBox lbSetData [_listItemIndex, _x];
    };
}
forEach allMapMarkers;

_numberOfSpawnPoints = {getMarkerType _x == "ExileSpawnZone"} count allMapMarkers;

if (_numberOfSpawnPoints > 0) then
{
    _randNum = floor(random _numberOfSpawnPoints);
    _randData = lbData [24002,_randNum];
    lbClear _listBox;        // Clears all options execpt Random from the spawn selection dialog
    _randomSpawnIndex = _listBox lbAdd "Random";
    _listBox lbSetData [_randomSpawnIndex, _randData];
};
true

 

Share this post


Link to post
Share on other sites
Advertisement

Yes.

The key bit is near the end of the file, in the last section.

Adding "lbClear _listbox;" above "_randomSpawnIndex = _listBox lbAdd "Random";" is what forces random only spawn selection. Alternatively you could also look at this:

 

Share this post


Link to post
Share on other sites
28 minutes ago, Digital Purge said:

does this still work?

 

There is now a built in feature in exile to allow random spawning. In your exile_server_config\config.cpp change parachuteSpawning = 1 to parachuteSpawning = 0

I think that's he function for it but I honestly can't entirely remember because I'm in my phone. Just look around the area that line is located in. There is some more info but also remember, random spawning is only meant for smaller maps because the players could spawn really anywhere on the coast.

Share this post


Link to post
Share on other sites
6 minutes ago, Surge132 said:

There is now a built in feature in exile to allow random spawning. In your exile_server_config\config.cpp change parachuteSpawning = 1 to parachuteSpawning = 0

I think that's he function for it but I honestly can't entirely remember because I'm in my phone. Just look around the area that line is located in. There is some more info but also remember, random spawning is only meant for smaller maps because the players could spawn really anywhere on the coast.

You're correct, but there's a couple of conditions to this.

It picks a random location on the shore, not randomly on the map. It will ignore any spawn locations you have set in your mission.sqm file. The method in this thread is for using defined spawn zones in your mission.sqm file but forcing players to pick a random one instead of selecting what one they want to.

Share this post


Link to post
Share on other sites
10 minutes ago, canuckbrian said:

You're correct, but there's a couple of conditions to this.

It picks a random location on the shore, not randomly on the map. It will ignore any spawn locations you have set in your mission.sqm file. The method in this thread is for using defined spawn zones in your mission.sqm file but forcing players to pick a random one instead of selecting what one they want to.

Feasibly you could also just remove all the spawn markers and only allow random to show up. I'll see if I can find something that might work

Share this post


Link to post
Share on other sites

Just found this thin which pretty much does what I said. It's an older script (from 0.9.20b) but it might still work.

I haven't really gone in the code and looked into it, but you could probably compare that file to the most up to date one that exile has and adjust the updated one to fit your needs by just adding in the part that removes the options for the other zones.

Share this post


Link to post
Share on other sites
12 minutes ago, Surge132 said:

Feasibly you could also just remove all the spawn markers and only allow random to show up. I'll see if I can find something that might work

That actually won't work because the Random button picks from ExileSpawnZone marker locations. If there aren't any in the mission.sqm the random button won't work because it has nothing to pick from.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.