happydayz

Enigma Exile RandomSpawns

13 posts in this topic

Posted (edited)

Just threw this together this evening to see how hard/easy it would be.

Simple little script that overwrites the Exile spawn selection screen, and instead turns it into a randomizer! :)

Just do a simple override in the CfgExileCustomCode:

    ExileClient_gui_selectSpawnLocation_show = "overrides\ExileClient_gui_selectSpawnLocation_show.sqf"; //Spawn Randomizer

 

Spoiler

/*
Enigma SpawnRandomizer
By Happydayz - Enigma
*/



//ExileClient_gui_selectSpawnLocation_show



[] spawn {

Private ["_TextControl","_mapControl","_markername","_spawnpoint","_spawnpoints","_numberOfSpawnPoints","_randNum","_display","_ButtonsArray"];
disableSerialization; 
ExileClientSpawnLocationSelectionDone = false;
ExileClientSelectedSpawnLocationMarkerName = "";
createDialog "RscExileSelectSpawnLocationDialog";

waitUntil
{
	_display = findDisplay 24002;
	!isNull _display
};

_worldcentre = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
_worldcentre = [((_worldcentre select 0)*.72),((_worldcentre select 1)*1.76),(_worldcentre select 2)]; 
_mapControl = _display displayCtrl 24001; 
    
   _mapx = 0.23 * safezoneW + safezoneX;     
   _mapy = 0.2 * safezoneH + safezoneY;     
   _mapw = 0.540098 * safezoneW;     
   _maph = 0.644 * safezoneH;   
_mapControl ctrlSetPosition [_mapx,_mapy,_mapw,_maph];  
_mapControl ctrlCommit 0;  
_mapControl ctrlMapAnimAdd [0, 1, _worldcentre];
ctrlMapAnimCommit _mapControl;

_TextControl = _display displayCtrl 24000; 
   _Textx = 0 * (0.025) + (0);    
   _Texty = -15.5 * (0.01) + (0);     
   _Textw = 40 * (0.025);     
   _Texth = 2 * (0.04);    
_TextControl ctrlSetPosition [_Textx,_Texty,_Textw,_Texth]; 
_TextControl ctrlSetText "Locating Convict Dropoff Zone";
_TextControl ctrlSetFade 1;
_TextControl ctrlCommit 0; 

  _ButtonsArray = [24003, 24002];
  {
      _ctrl = (_display displayCtrl _x);
      _ctrl ctrlSetFade 1;
      _ctrl ctrlCommit 0.25;
      ctrlEnable [_x, true];
	  ctrlDelete _ctrl
  } forEach _ButtonsArray;

uisleep 3;
_spawnpoint = "";
_spawnpoints = [];

{
	if (getMarkerType _x == "ExileSpawnZone") then
	{
		_spawnpoint = _x; 
		_spawnpoints pushback _spawnpoint;
	};
}
forEach allMapMarkers;

_TextControl ctrlSetText "Choosing Convict Dropoff Zone";
_TextControl ctrlSetFade 0;
_TextControl ctrlCommit 0.5; 

{
_mapControl ctrlMapAnimAdd [1.5, 0.4, (getmarkerpos _x)];
ctrlMapAnimCommit _mapControl;
uisleep 1.5;
}forEach _spawnpoints;

_numberOfSpawnPoints = {getMarkerType _x == "ExileSpawnZone"} count allMapMarkers;
if (_numberOfSpawnPoints > 0) then 
{
	_randNum = floor(random _numberOfSpawnPoints);
	ExileClientSelectedSpawnLocationMarkerName = _spawnpoints select _randNum;

} else {

ExileClientSelectedSpawnLocationMarkerName = _spawnpoints select 0;

};

_markername = markerText ExileClientSelectedSpawnLocationMarkerName;
_worldcentre = getMarkerPos ExileClientSelectedSpawnLocationMarkerName;
_worldcentre = [((_worldcentre select 0)*.991),((_worldcentre select 1)*1.006),(_worldcentre select 2)];

_TextControl ctrlSetFade 1;
_TextControl ctrlCommit 0.5; 
_TextControl ctrlSetFade 0;
_TextControl ctrlSetText format ["%1 Chosen",_markername];
_TextControl ctrlCommit 0.5; 


_mapControl ctrlMapAnimAdd [1, 0.03, _worldcentre]; 
ctrlMapAnimCommit _mapControl;

uisleep 3;

 [] call ExileClient_gui_selectSpawnLocation_event_onSpawnButtonClick;
 
 };

 


     Support Further Development

Edited by happydayz
7 people like this

Share this post


Link to post
Share on other sites

Is this different from Acidy's random spawn selection? Is There an advantage to using this one? 

Share this post


Link to post
Share on other sites
Advertisement

No idea. Haven't looked at his. This one does an animation? Does his?

Share this post


Link to post
Share on other sites

Oh nice @happydayz, this is exactly what I've been needing, just haven't been bothered to throw it together myself, kudos for you my friend :rock:

1 person likes this

Share this post


Link to post
Share on other sites
18 minutes ago, happydayz said:

No idea. Haven't looked at his. This one does an animation? Does his?

His removes the option to choose any spawn except for Random.

 

Share this post


Link to post
Share on other sites

Ok we'll mine should look prettier ;) all automated. 

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

1 hour ago, happydayz said:

Ok we'll mine should look prettier ;) all automated. 

Do you have a video of yours at work?

Also, does your remove the spawn markers from the map? That's something I was looking to do but no one seemed to know how to do it.

Edited by BetterDeadThanZed

Share this post


Link to post
Share on other sites

No it doesn't. I can have a look at hiding the markers off the map. And I'll make a vid. 

1 person likes this

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.