Jump to content
  • 0

Spawning Vehicles With Loot Inside


TheGodfather

Question

I've been trying to spawn a vehicle in my AI city for every restart like Sector B did with the urals but I've been running into some trouble. I can spawn them in with WAI using the custom static boxes, but the problem is if you get in the vehicle it stays over on a restart. I know that you can disable that feature, but that would effect with our mission system. I've tried spawning Urals in via mission.pbo, but that didn't work at all, but that seems like the way to do it. 

 

Here is the code that's located in the mission.pbo (called from init.sqf), I know I must be doing something wrong...

 

if (isServer) then {
private ["_object","_uniqueid"];
 
_vehicle_43 = objNull;
if (true) then
{
  _object = createVehicle ["KamazOpen", [429.88358, 451.99084, 2.2888184e-005], [], 0, "CAN_COLLIDE"];
  _object addMagazineCargoGlobal ["CinderBlocks", 50];
  _object addMagazineCargoGlobal ["MortarBucket", 25];
  _object addMagazineCargoGlobal ["PartPlywoodPack", 10];
  _object addMagazineCargoGlobal ["cinder_garage_kit", 2];
  _object addMagazineCargoGlobal ["PartGeneric", 10];
  _object addMagazineCargoGlobal ["ItemSandbag", 15];
  _object addMagazineCargoGlobal ["ItemTankTrap", 15];
  _object addMagazineCargoGlobal ["forest_large_net_kit", 3];
  _object addMagazineCargoGlobal ["ItemComboLock", 2];
  _vehicle_43 = _object;
  _object setPos [429.88358, 451.99084, 2.2888184e-005];
  _object setVariable ["malsar",1,true];
  _uniqueid = str(round(random 999999));
  _object setVariable ["ObjectID", _uniqueid, true];
  _object setVariable ["ObjectUID", _uniqueid, true];
};

 

Link to comment
Share on other sites

Recommended Posts

  • 0

AH! I was calling it wrong from the init.sqf, I should have taken a closer look at my .rpt file. I missed a ---> "

 

12:03:47 Error in expression <N\agn_SafeZoneCommander.sqf';

[] execVM "buildings\urals.sqf';>
12:03:47   Error position: <"buildings\urals.sqf';>
12:03:47   Error Missing ""

 

Hm does it really? Am I missing a easier way to do it? I've searched a solution for it for awhile I just can't find anyone to explain it to me (pretty new to this stuff), so as of now I'm just using WAI static boxes. 

 

I was thinking of also making it a random location (Sector B like), which I'm guessing requires some sort of array of different worldspace locations. But I'll be happy just to get the Urals spawning in with gear.

Link to comment
Share on other sites

  • 0

if you'd like a could create a little something for you that will spawn in the trucks with loot inside. it won't use anything from WAI, mind you.

i'll comment the file too so you can follow what is going on inside it and learn some :)

Link to comment
Share on other sites

  • 0

can you elaborate more on what happens when you use the above code?

also, the code above would spawn a vehicle in every time somebody connects to the server

 

not true, he has if(isServer) that prevents that

 

 

AH! I was calling it wrong from the init.sqf, I should have taken a closer look at my .rpt file. I missed a ---> "

 

Hm does it really? Am I missing a easier way to do it? I've searched a solution for it for awhile I just can't find anyone to explain it to me (pretty new to this stuff), so as of now I'm just using WAI static boxes. 

 

I was thinking of also making it a random location (Sector B like), which I'm guessing requires some sort of array of different worldspace locations. But I'll be happy just to get the Urals spawning in with gear.

 

seems like you are missing a }; at the end of the script, else it looks fine

Link to comment
Share on other sites

  • 0

even when it says if (isServer), if that is in the mission(client) side files it will run per client joining. when it says if (isServer) in the mission files it doesn't mean that it only runs once, it means that that's what the server has to do for every client joining

Link to comment
Share on other sites

  • 0

What I do is spawn them in (locked, need hotwire kit to open) using a MySQL procedure called at restart.

A breakdown of what it does, it deletes previous incarnations of these vehicles, respawns them with gear and respawns the DC3 on the runway. These are in the same locations as the Urals on Origins
 

BEGIN

	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001393';
	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001394';
	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001395';
	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001396';
	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001397';

	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001393', '13', 'MTVR', NOW(), '453223', '[180,[22462.2,19495.5,0]]', '[[[],[]],[[\"ItemAntibiotic\",\"ItemBandage\",\"ItemBloodbag\",\"ItemEpinephrine\",\"ItemMorphine\",\"ItemPainkiller\",\"ItemSodaRbull\",\"FoodCanFrankBeans\",\"FoodCanPasta\",\"FoodCanSardines\",\"ItemSodaCoke\",\"ItemSodaOrangeSherbet\",\"ItemHeatPack\"],[15,15,15,15,15,15,15,15,15,15,15,15,15]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001394', '13', 'MTVR', NOW(), '345353', '[269,[22180.7,19833.1,0]]', '[[[\"ItemCrowbar\"],[2]],[[\"ItemLockbox\",\"30m_plot_kit\",\"metal_floor_kit\",\"CinderBlocks\",\"cinder_wall_kit\",\"ItemHotwireKit\",\"ItemBriefcase100oz\",\"ItemBriefcase100oz\",\"MortarBucket\",\"MortarBucket\",\"PartScrap\",\"PartWoodPile\",\"forest_large_net_kit\"],[3,3,3,3,3,1,2,2,15,5,10,15,3]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001395', '13', 'MTVR', NOW(), '453454', '[90,[22452.8,20074.8,0]]', '[[[\"AKS_74_kobra\",\"M16A2GL\",\"AKS_74_U\",\"FN_FAL\",\"M9SD\",\"SCAR_L_STD_Mk4CQT\",\"Pecheneg_DZ\",\"bizon_silenced\",\"M4A1_HWS_GL_SD_Camo\",\"NVGoggles\",\"ItemGPS\",\"G36A_camo\"],[3,3,3,3,3,3,3,3,3,2,2,1]],[[\"ItemBloodbag\",\"100Rnd_762x54_PK\",\"30Rnd_556x45_Stanag\",\"100Rnd_762x51_M240\",\"30Rnd_556x45_G36SD\",\"10Rnd_9x39_SP5_VSS\",\"ItemAntibiotic\",\"30Rnd_545x39_AK\",\"20Rnd_762x51_FNFAL\",\"20Rnd_762x51_B_SCAR\",\"64Rnd_9x19_SD_Bizon\",\"1Rnd_HE_GP25\",\"PartGeneric\",\"PartEngine\",\"PartGlass\",\"PartVRotor\",\"ItemJerrycan\",\"ItemTent\"],[10,10,10,10,10,10,10,10,10,10,10,10,4,2,6,2,10,2]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001396', '13', 'MTVR', NOW(), '453443', '[178,[22533,20073,0]]', '[[[\"AKS_74_kobra\",\"M16A2GL\",\"AKS_74_U\",\"FN_FAL\",\"M9SD\",\"SCAR_L_STD_Mk4CQT\",\"Pecheneg_DZ\",\"bizon_silenced\",\"M4A1_HWS_GL_SD_Camo\",\"NVGoggles\",\"ItemGPS\",\"G36A_camo\"],[3,3,3,3,3,3,3,3,3,2,2,1]],[[\"ItemBloodbag\",\"100Rnd_762x54_PK\",\"30Rnd_556x45_Stanag\",\"100Rnd_762x51_M240\",\"30Rnd_556x45_G36SD\",\"10Rnd_9x39_SP5_VSS\",\"ItemAntibiotic\",\"20Rnd_762x51_B_SCAR\",\"20Rnd_762x51_FNFAL\",\"15Rnd_9x19_M9SD\",\"64Rnd_9x19_SD_Bizon\",\"1Rnd_HE_GP25\",\"PartGeneric\",\"PartEngine\",\"PartGlass\",\"PartVRotor\",\"ItemJerrycan\",\"ItemTent\"],[10,10,10,10,10,10,10,10,10,10,10,10,4,2,6,2,10,2]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001397', '13', 'MTVR', NOW(), '784523', '[178,[22549.2,20071.9,0]]', '[[[\"AKS_74_kobra\",\"M16A2GL\",\"AKS_74_U\",\"FN_FAL\",\"M9SD\",\"SCAR_L_STD_Mk4CQT\",\"Pecheneg_DZ\",\"bizon_silenced\",\"M4A1_HWS_GL_SD_Camo\",\"NVGoggles\",\"ItemGPS\",\"G36A_camo\"],[3,3,3,3,3,3,3,3,3,2,2,1]],[[\"ItemBloodbag\",\"100Rnd_762x54_PK\",\"30Rnd_556x45_Stanag\",\"100Rnd_762x51_M240\",\"30Rnd_556x45_G36SD\",\"10Rnd_9x39_SP5_VSS\",\"ItemAntibiotic\",\"30Rnd_545x39_AK\",\"20Rnd_762x51_FNFAL\",\"20Rnd_762x51_B_SCAR\",\"64Rnd_9x19_SD_Bizon\",\"1Rnd_HE_GP25\",\"PartGeneric\",\"PartEngine\",\"PartGlass\",\"PartVRotor\",\"ItemJerrycan\",\"ItemTent\"],[10,10,10,10,10,10,10,10,10,10,10,10,4,2,6,2,10,2]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());

	
DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500000431';
	
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500000431', '13', 'ori_dc3', NOW(), '0', '[1,[22687.3,19239.3,0]]', '[]', '[]', '0.3', '0.05', NOW());
	

END
Link to comment
Share on other sites

  • 0

if you'd like a could create a little something for you that will spawn in the trucks with loot inside. it won't use anything from WAI, mind you.

i'll comment the file too so you can follow what is going on inside it and learn some :)

 

That would be great if you have the time, I'm in no hurry! I appreciate the help, and ready to learn so I don't have to bother the community too much.

 

 

What I do is spawn them in (locked, need hotwire kit to open) using a MySQL procedure called at restart.

A breakdown of what it does, it deletes previous incarnations of these vehicles, respawns them with gear and respawns the DC3 on the runway. These are in the same locations as the Urals on Origins

 

BEGIN

	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001393';
	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001394';
	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001395';
	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001396';
	DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500001397';

	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001393', '13', 'MTVR', NOW(), '453223', '[180,[22462.2,19495.5,0]]', '[[[],[]],[[\"ItemAntibiotic\",\"ItemBandage\",\"ItemBloodbag\",\"ItemEpinephrine\",\"ItemMorphine\",\"ItemPainkiller\",\"ItemSodaRbull\",\"FoodCanFrankBeans\",\"FoodCanPasta\",\"FoodCanSardines\",\"ItemSodaCoke\",\"ItemSodaOrangeSherbet\",\"ItemHeatPack\"],[15,15,15,15,15,15,15,15,15,15,15,15,15]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001394', '13', 'MTVR', NOW(), '345353', '[269,[22180.7,19833.1,0]]', '[[[\"ItemCrowbar\"],[2]],[[\"ItemLockbox\",\"30m_plot_kit\",\"metal_floor_kit\",\"CinderBlocks\",\"cinder_wall_kit\",\"ItemHotwireKit\",\"ItemBriefcase100oz\",\"ItemBriefcase100oz\",\"MortarBucket\",\"MortarBucket\",\"PartScrap\",\"PartWoodPile\",\"forest_large_net_kit\"],[3,3,3,3,3,1,2,2,15,5,10,15,3]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001395', '13', 'MTVR', NOW(), '453454', '[90,[22452.8,20074.8,0]]', '[[[\"AKS_74_kobra\",\"M16A2GL\",\"AKS_74_U\",\"FN_FAL\",\"M9SD\",\"SCAR_L_STD_Mk4CQT\",\"Pecheneg_DZ\",\"bizon_silenced\",\"M4A1_HWS_GL_SD_Camo\",\"NVGoggles\",\"ItemGPS\",\"G36A_camo\"],[3,3,3,3,3,3,3,3,3,2,2,1]],[[\"ItemBloodbag\",\"100Rnd_762x54_PK\",\"30Rnd_556x45_Stanag\",\"100Rnd_762x51_M240\",\"30Rnd_556x45_G36SD\",\"10Rnd_9x39_SP5_VSS\",\"ItemAntibiotic\",\"30Rnd_545x39_AK\",\"20Rnd_762x51_FNFAL\",\"20Rnd_762x51_B_SCAR\",\"64Rnd_9x19_SD_Bizon\",\"1Rnd_HE_GP25\",\"PartGeneric\",\"PartEngine\",\"PartGlass\",\"PartVRotor\",\"ItemJerrycan\",\"ItemTent\"],[10,10,10,10,10,10,10,10,10,10,10,10,4,2,6,2,10,2]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001396', '13', 'MTVR', NOW(), '453443', '[178,[22533,20073,0]]', '[[[\"AKS_74_kobra\",\"M16A2GL\",\"AKS_74_U\",\"FN_FAL\",\"M9SD\",\"SCAR_L_STD_Mk4CQT\",\"Pecheneg_DZ\",\"bizon_silenced\",\"M4A1_HWS_GL_SD_Camo\",\"NVGoggles\",\"ItemGPS\",\"G36A_camo\"],[3,3,3,3,3,3,3,3,3,2,2,1]],[[\"ItemBloodbag\",\"100Rnd_762x54_PK\",\"30Rnd_556x45_Stanag\",\"100Rnd_762x51_M240\",\"30Rnd_556x45_G36SD\",\"10Rnd_9x39_SP5_VSS\",\"ItemAntibiotic\",\"20Rnd_762x51_B_SCAR\",\"20Rnd_762x51_FNFAL\",\"15Rnd_9x19_M9SD\",\"64Rnd_9x19_SD_Bizon\",\"1Rnd_HE_GP25\",\"PartGeneric\",\"PartEngine\",\"PartGlass\",\"PartVRotor\",\"ItemJerrycan\",\"ItemTent\"],[10,10,10,10,10,10,10,10,10,10,10,10,4,2,6,2,10,2]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500001397', '13', 'MTVR', NOW(), '784523', '[178,[22549.2,20071.9,0]]', '[[[\"AKS_74_kobra\",\"M16A2GL\",\"AKS_74_U\",\"FN_FAL\",\"M9SD\",\"SCAR_L_STD_Mk4CQT\",\"Pecheneg_DZ\",\"bizon_silenced\",\"M4A1_HWS_GL_SD_Camo\",\"NVGoggles\",\"ItemGPS\",\"G36A_camo\"],[3,3,3,3,3,3,3,3,3,2,2,1]],[[\"ItemBloodbag\",\"100Rnd_762x54_PK\",\"30Rnd_556x45_Stanag\",\"100Rnd_762x51_M240\",\"30Rnd_556x45_G36SD\",\"10Rnd_9x39_SP5_VSS\",\"ItemAntibiotic\",\"30Rnd_545x39_AK\",\"20Rnd_762x51_FNFAL\",\"20Rnd_762x51_B_SCAR\",\"64Rnd_9x19_SD_Bizon\",\"1Rnd_HE_GP25\",\"PartGeneric\",\"PartEngine\",\"PartGlass\",\"PartVRotor\",\"ItemJerrycan\",\"ItemTent\"],[10,10,10,10,10,10,10,10,10,10,10,10,4,2,6,2,10,2]],[["DZ_Backpack_EP1","DZ_LargeGunBag_EP1"],[1,1]]]', '[[\"motor\",0.8],[\"karoserie\",1],[\"palivo\",0.8],[\"wheel_1_1_steering\",1],[\"wheel_2_1_steering\",1],[\"wheel_1_2_steering\",1],[\"wheel_2_2_steering\",1]]', '0.01000', '0.05', NOW());

	
DELETE
			FROM `object_data`
			WHERE `ObjectUID` = '0000500000431';
	
	INSERT INTO `object_data` 
			VALUES (NULL, '0000500000431', '13', 'ori_dc3', NOW(), '0', '[1,[22687.3,19239.3,0]]', '[]', '[]', '0.3', '0.05', NOW());
	

END

 

I actually like spawning it this way since I could probably switch up the locations with different sql procedures. What code makes it locked/unlocked in there?  

Link to comment
Share on other sites

  • 0

 

 

 

I actually like spawning it this way since I could probably switch up the locations with different sql procedures. What code makes it locked/unlocked in there?  

 

Because the MTVR's have owner id's 453223 345353 453454 453443 784523 so therefore spawn locked as server presumes they're owned.

Link to comment
Share on other sites

  • 0

even when it says if (isServer), if that is in the mission(client) side files it will run per client joining. when it says if (isServer) in the mission files it doesn't mean that it only runs once, it means that that's what the server has to do for every client joining

 

the init is executed seperate on each client/server an if(isServer) statement makes sure the code is only ran on the server, meaning no client will execute it.

thats the whole idea of the isServer command.

 

 

What I do is spawn them in (locked, need hotwire kit to open) using a MySQL procedure called at restart.

A breakdown of what it does, it deletes previous incarnations of these vehicles, respawns them with gear and respawns the DC3 on the runway. These are in the same locations as the Urals on Origins

 

no offence to your sql version, cause it is not a stupid idea and it is an easy way to implement it with locked vehicles ...

however imho its kinda "cheating" and not everyone has the possibility to add something to the batch file not to mention it would probably be way faster to spawn them with a script compared to fetching them from the hive (not even considering the time it takes to switch each restart).

they could be easy locked with code aswell, it would also be quite easy create random loot for the trucks then to not give same ol loot each restart.

 

 

That would be great if you have the time, I'm in no hurry! I appreciate the help, and ready to learn so I don't have to bother the community too much.

 

 

I actually like spawning it this way since I could probably switch up the locations with different sql procedures. What code makes it locked/unlocked in there?  

 

 

personally i would just create them in the editor and add content to the vehicles after, like you initially did ...

Link to comment
Share on other sites

  • 0

yeah, you're right. the isServer command does mean that only the server will run it. but considering that a client's init.sqf is run every time they connect, the server would still create the vehicle for every client connecting

Link to comment
Share on other sites

  • 0

the init is executed seperate on each client/server an if(isServer) statement makes sure the code is only ran on the server, meaning no client will execute it.

thats the whole idea of the isServer command.

 

 

no offence to your sql version, cause it is not a stupid idea and it is an easy way to implement it with locked vehicles ...

however imho its kinda "cheating" and not everyone has the possibility to add something to the batch file not to mention it would probably be way faster to spawn them with a script compared to fetching them from the hive (not even considering the time it takes to switch each restart).

they could be easy locked with code aswell, it would also be quite easy create random loot for the trucks then to not give same ol loot each restart.

 

 

 

 

personally i would just create them in the editor and add content to the vehicles after, like you initially did ...

 

Yeah, I think I'll go ahead and do it that way. Thanks for the help guys.

Link to comment
Share on other sites

  • 0

yeah, you're right. the isServer command does mean that only the server will run it. but considering that a client's init.sqf is run every time they connect, the server would still create the vehicle for every client connecting

 

idk what you are smoking, but i want some of that please ...

 

to be clear on this so you can understand it better, if a client meets an if(isServer) it will obviusly just skip that part of code, meaning nothing will be done from that scope on any client executing it.

 

if it was if(!isServer) then it would execute on clients yes, if it was if(!isDedicated) then it would execute on clients yes, but thats not the case here.

Link to comment
Share on other sites

  • 0

yeah, you're right. the isServer command does mean that only the server will run it. but considering that a client's init.sqf is run every time they connect, the server would still create the vehicle for every client connecting

 

Let me lay out how a server starts for you.

 

You hit the power.

The server loads the world in.

The server runs the init.sqf. It isServer.

A client connects.

The client reads the init.sqf. It is not isServer.

And then another client and another.

 

The server does not re-read the init everytime a client connects.

Link to comment
Share on other sites

  • 0

Anyone have knowledge of how Origins did random Ural locations? As I said above, I'm guessing it can be done by having an array of different worldspace locations and somehow randomizing it, or maybe done via mySQL. Something like below added to the script above? Again I'm new at this so this could be all sorts of messed up.

 

_rndSel=floor(random 3);

_loc=
switch (_rndSel) do {
case 0: {["Test",1.5,434,385]};
case 1: {["Test2",1.5,435,386]};
case 2: {["Test3",1.5,436,387]};
Link to comment
Share on other sites

  • 0

my personal preference to choosing a random location from a list of predetermined locations is this -

_possibleLocations = [
[xxx,yyy,zzz],
[xxx,yyy,zzz],
[xxx,yyy,zzz],
[xxx,yyy,zzz],
[xxx,yyy,zzz]
];

_finalLocation = _possibleLocations call BIS_fnc_selectRandom;
Link to comment
Share on other sites

  • 0

Ok so going by your code maybe this will work? I'll test it out on the server tomorrow night...

 

 

 

if (isServer) then {

private ["_object","_uniqueid","_possibleLocations", "_finalLocation"];

 

_possibleLocations = [

[xxx,yyy,zzz],

[xxx,yyy,zzz],

[xxx,yyy,zzz],

[xxx,yyy,zzz],

[xxx,yyy,zzz]

];

 

_finalLocation = _possibleLocations call BIS_fnc_selectRandom;

 

_vehicle_43 = objNull;

if (true) then

{

  _object = createVehicle ["KamazOpen", [_finalLocation], [], 0, "CAN_COLLIDE"];

  _object addMagazineCargoGlobal ["CinderBlocks", 50];

  _object addMagazineCargoGlobal ["MortarBucket", 25];

  _object addMagazineCargoGlobal ["PartPlywoodPack", 10];

  _object addMagazineCargoGlobal ["cinder_garage_kit", 2];

  _object addMagazineCargoGlobal ["PartGeneric", 10];

  _object addMagazineCargoGlobal ["ItemSandbag", 15];

  _object addMagazineCargoGlobal ["ItemTankTrap", 15];

  _object addMagazineCargoGlobal ["forest_large_net_kit", 3];

  _object addMagazineCargoGlobal ["ItemComboLock", 2];

  _vehicle_43 = _object;

  _object setPos [_finalLocation];

  _object setVariable ["malsar",1,true];

  _uniqueid = str(round(random 999999));

  _object setVariable ["ObjectID", _uniqueid, true];

  _object setVariable ["ObjectUID", _uniqueid, true];

};

};

Link to comment
Share on other sites

  • 0

 

my personal preference to choosing a random location from a list of predetermined locations is this -

_possibleLocations = [
[xxx,yyy,zzz],
[xxx,yyy,zzz],
[xxx,yyy,zzz],
[xxx,yyy,zzz],
[xxx,yyy,zzz]
];

_finalLocation = _possibleLocations call BIS_fnc_selectRandom;

 

no need to use functions for this, thats just overkill ...

 

 

Anyone have knowledge of how Origins did random Ural locations? As I said above, I'm guessing it can be done by having an array of different worldspace locations and somehow randomizing it, or maybe done via mySQL. Something like below added to the script above? Again I'm new at this so this could be all sorts of messed up.

 

do what you initally intended, it seems your instinct for this is not too bad ... however you are forgetting brackets allover the place:

private ["_loc"];
switch (round(random 2)) do {
case 0: {_loc=["Test",[1.5,434,385]]};
case 1: {_loc=["Test2",[1.5,435,386]]};
case 2: {_loc=["Test3",[1.5,436,387]]};
};
Link to comment
Share on other sites

  • 0

The random locations work pretty well, but I've ran into a huge problem. Every time you get in the vehicle and start it, it insta-kills you right away. Is there anything I have to do to prevent this? Maybe Infistar exceptions or a battleye exception? 

 

Edit: Here's what I got from the .rpt, I'm googling the problem now, if someone has a solution I would greatly appreciate it!

 

 

17:35:14 "CLEANUP: KILLING A HACKER TheGodfather B 1-1-D:1 (TheGodfather) REMOTE IN Ural_CDF"

Link to comment
Share on other sites

  • 0

Found the fix I believe, server just restarted so I can't test it out but I'm sure this will do the trick.

 

Just add whatever vehicle you want spawned in your custom variables folder under DZE_safeVehicle around Line 688.

 

DZE_safeVehicle = ["Old_bike_TK_CIV_EP1","CSJ_GyroCover","ParachuteWest","ParachuteC"];

Link to comment
Share on other sites

  • 0

Found the fix I believe, server just restarted so I can't test it out but I'm sure this will do the trick.

 

Just add whatever vehicle you want spawned in your custom variables folder under DZE_safeVehicle around Line 688.

 

DZE_safeVehicle = ["Old_bike_TK_CIV_EP1","CSJ_GyroCover","ParachuteWest","ParachuteC"];

 

this will leave a bit of a security hole tho, you should rather set a variable within the object, (ObjectID and ObjectUID variables or if you have a mission system you can also use the varible they use) that exits in server_updateObject.sqf and server_checkHackers function in server_functions.sqf

Link to comment
Share on other sites

  • 0

Well, I did Sector B and then went Ural to Ural.  The first three were no problem. Check gear, get in front, get out, get in back, get out, etc... no problem,  On the fourth, I get in the back, and when I get out, I died.  And I had God mode on while cleaning out SecB.

 

My BE logs are clean, my client .rpt is clean.  The only indication of something amiss was these entries in my serve side .rpt:

 

20:21:06 "CLEANUP: KILLING A HACKER Pork Rind B 1-1-C:1 (Pork Rind) REMOTE IN UralCivil2"
20:21:06 "infiSTAR.de Log: Vehicle destroyed with <null> @221052 by DEAD (xxxxxxxxxxxxxx) - UralCivil2, worldspace [331.145,[22162.9,19852.4,0.33]], CharId 0, objID 497926, objUID 497926, nearby []"
20:21:06 "PLAYERDEATH: Player Died xxxxxxxxxxxxxxxxxxx"

 

Why it thought I was a hacker on the fourth but not the first three is a mystery.  I have no idea what would have triggered it or why it isn't consistent on all Urals.

Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...