Jump to content
Sign in to follow this  
Hellfreez

How to add respawn and mission info?

Recommended Posts

I am trying to do simple basic mutliplayer map and I have some questions.

When I have made my map, placed helos and pilots and everything, I don't know how to make it respawn.

When u connect that server I made there reads

Max. Slots: Unknown

Type: Unknown

Respawn: NONE

How to fix those three things? I look that "manual" web site, no help at all.

:butbut:

Edited by Foxhound
Title changed and topic moved

Share this post


Link to post
Share on other sites

That didn't help much, there is code but problem is where to write it.

On game modding area there is Config file -> BIS_fnc_SpawnCrew what looks like this.

//scriptName "Functions\spawning\fn_spawnCrew.sqf";
/*
File: spawnCrew.sqf
Author: Joris-Jan van 't Land

Description:
Function to fill all crew positions in a vehicle, including turrets.
In dummy mode no objects are created and the returned array contains only ones.
In this mode the function can be used to count the actual crew of an existing vehicle or vehicle type.

Parameter(s):
_this select 0: the vehicle (Object)
_this select 1: the crew's group (Group)
_this select 2: (optional) dummy mode toggle (Boolean)
_this select 3: (optional) dummy mode type (String)
_this select 4: (optional) crew type (String)

Returns:
Array of Objects or Scalars - newly created crew or crew count
*/

//Validate parameter count
if ((count _this) < 2) exitWith {debugLog "Log: [spawnCrew] Function requires at least 2 parameters!"; []};

private ["_vehicle", "_grp"];
_vehicle = _this select 0;
_grp = _this select 1;

private ["_dummy"];
_dummy = false;
if ((count _this) > 2) then
{
_dummy = _this select 2;
};

private ["_dummyType"];
_dummyType = "";
if ((count _this) > 3) then 
{
_dummyType = _this select 3;
};

private ["_crewType"];
_crewType = "";
if ((count _this) > 4) then 
{
_crewType = _this select 4;
};

//Validate parameters
if ((typeName _vehicle) != (typeName objNull)) exitWith {debugLog "Log: [spawnCrew] Vehicle (0) must be an Object!"; []};
if ((typeName _grp) != (typeName grpNull)) exitWith {debugLog "Log: [spawnCrew] Crew group (1) must be a Group!"; []};
if ((typeName _dummy) != (typeName false)) exitWith {debugLog "Log: [spawnCrew] Dummy mode toggle (2) must be a Boolean!"; []};
if ((typeName _dummyType) != (typeName "")) exitWith {debugLog "Log: [spawnCrew] Dummy mode type (3) must be a String!"; []};
if ((typeName _crewType) != (typeName "")) exitWith {debugLog "Log: [spawnCrew] Crew type (4) must be a String!"; []};

private ["_type", "_entry", "_crew"];
if (!_dummy) then 
{
_type = typeOf _vehicle;
} 
else 
{
if (_dummyType != "") then 
{
	_type = _dummyType;
};
};
_entry = configFile >> "CfgVehicles" >> _type;
_crew = [];

private ["_hasDriver"];
_hasDriver = getNumber (_entry >> "hasDriver");

//Select the appropriate crew type
private ["_crewType", "_unit"];
if (!_dummy && (_crewType == "")) then
{
_crewType = [side _grp, _entry] call BIS_fnc_selectCrew;
};

//Spawn a driver if needed
if ((_hasDriver == 1) && (isNull (driver _vehicle))) then
{
if (!_dummy) then
{
	_unit = _grp createUnit [_crewType, position _vehicle, [], 0, "NONE"];
	_crew = _crew + [_unit];

	_unit moveInDriver _vehicle;
}
else
{
	_crew = _crew + [1];
};
};

//Search through all turrets and spawn crew for these as well.
_turrets = [_entry >> "turrets"] call BIS_fnc_returnVehicleTurrets;

//All turrets were found, now spawn crew for them
_funcSpawnTurrets =
{
private ["_turrets", "_path"];
_turrets = _this select 0;
_path = _this select 1;

private ["_i"];
_i = 0;
while {_i < (count _turrets)} do
{
	private ["_turretIndex", "_thisTurret"];
	_turretIndex = _turrets select _i;
	_thisTurret = _path + [_turretIndex];

	if (!_dummy) then
	{
		if (isNull (_vehicle turretUnit _thisTurret)) then 
		{
			//Spawn unit into this turret, if empty.
			_unit = _grp createUnit [_crewType, position _vehicle, [], 0, "NONE"];
			_crew = _crew + [_unit];

			_unit moveInTurret [_vehicle, _thisTurret];
		};
	}
	else
	{
		_crew = _crew + [1];
	};

	//Spawn units into subturrets.
	[_turrets select (_i + 1), _thisTurret] call _funcSpawnTurrets;

	_i = _i + 2;
};
};

[_turrets, []] call _funcSpawnTurrets;

if (!_dummy) then 
{
//Set ranks for the most important crew.
if (!(isNull (driver _vehicle))) then {(driver _vehicle) setRank "LIEUTENANT"};
if (!(isNull (gunner _vehicle))) then {(gunner _vehicle) setRank "SERGEANT"};
if (!(isNull (effectiveCommander _vehicle))) then {(effectiveCommander _vehicle) setRank "CORPORAL"};
};

_crew

WHAT I supposed to type and where.. number 3? to respawn base

Edited by Foxhound
added code tags

Share this post


Link to post
Share on other sites
That didn't help much, there is code but problem is where to write it.

Look at the first line of the link I posted:

Description.ext is mission config placed in mission's root.

Simple create a file called description.ext in your mission folder. Write all relevant configuration stuff in there.

Share this post


Link to post
Share on other sites
Look at the first line of the link I posted:

Simple create a file called description.ext in your mission folder. Write all relevant configuration stuff in there.

Ah, ok :D

I thought that there is config files had to config on game modding menu.

I think I can do this now.

Share this post


Link to post
Share on other sites

Can't make vehicles or helos spawning. I already tried so many things :(

Can someone tell me what to do so that Vechicles and Helos spawn their original spots every time those destroy. Timing could be like one min or 2.

I did map, enemies and everything is ok except vechicles spawning. I just can't figure out what I done wrong.

Share this post


Link to post
Share on other sites

Hey Dude, just check my sig...Yes, I know it´s from ArmA1. But most of the Content can be used in ArmA2 as well...and Take on Helicopters is more a heavily modiefied ArmA2 than a new game, so check the guide and you´ll find most of your questions answered.

according to your Vehicle respawn issue, I recommend you tophes simple vehicle respawn...although I don´t know whether this is working there.

If this is not working so wait until tomorrow (roundabout 11:00 am GMT)...I´ll be back from work then and can provide you a simple script which is already in use on our dedicated server for ToH.

greets

Memphis

Share this post


Link to post
Share on other sites

veh = [this] execVM "vehicle.sqf"

On that line what should I put on [this] ?

Spawn area name or what??

How this can be so difficult, aaargh. losing my nerves.

Share this post


Link to post
Share on other sites

I am looking to confirm an issue I am having is either the operator or game bug.

I put respawn on a particular vehicle, and it changes the vehicle to something else.

Armed light heli or Armed medium heli.

These have missle pods or guns attached to the sides. I can place them without issue and see them during Preview. However when I Play the mission in MP, the helis change to ones without weapons visible on it. I tried two different respawn scripts, same result.

The medium Heli is especially weird, as I can get in the two gunner seats and fire, but the pov is from underneath the heli and the view can not be turned or moved.

Can anyone get respawn to work on these two particular birds correctly?

I determined it was a Dedicated server issue, causing the weapons on the Armed heli models to disappear. Same vehicles are unaffected for Client host.

http://forums.bistudio.com/showthread.php?t=127392

Edited by [DirTyDeeDs]-Ziggy-

Share this post


Link to post
Share on other sites

How do I spawn a few helicopters in multiplayer?

Made in two ways, only the first spawn helicopter in which sadishsya, the rest does not restores.

1) The file description.ext prescribed

respawnvehicle = "BASE";

respawnVehicleDelay = 8;

and put a mark in her mission

respawn_vehicle_west

2) Use the script vehicle.skf and prescribed in the mission.sqm

init = "veh = [this, 5, 10] execVM" "vehicle.sqf" "";

Doing mission desmatch between the two parties, in helicopters, to recovery vehicles.

And another question: How do I Recover a helicopter if he had damaged the engine or something, but it did not explode?

Edited by frwind

Share this post


Link to post
Share on other sites

Solved the problem

1) do not write to file description.ext

respawnvehicle = "BASE";

respawnVehicleDelay = 8;

2) He took the finished script vehicle.sqf and place in mission folder

private ["_delay","_disabled","_startdir","_startpos","_type","_vehicle"];
if (!isServer) exitWith {};

_vehicle = _this select 0;
_delay = 5;
_startpos = getpos _vehicle;
_startdir = getdir _vehicle;
_type = typeof _vehicle;

while {true} do
{
 _empty = (if (({alive _x} count (crew _vehicle)) > 0) then {false} else {true});
 _disabled = (if (damage _vehicle > 0) then {true} else {false});
 if ((_disabled && _empty)) then
 {
sleep (_delay);
   deletevehicle _vehicle;
   _vehicle = objNull;
   _vehicle = _type createvehicle _startpos;
   _vehicle setpos _startpos;
   _vehicle setdir _startdir;
 };
};

Added to each vehicle and helicopter line in the initialization

veh = [this] execVM "vehicle.sqf"

And most importantly, the mission has made the helicopter and vehicle side EMPTY

Everything works.

Edited by frwind

Share this post


Link to post
Share on other sites

frwind, I don't want to see anything of my stuff beeing used in Take On H. Even if it is such an old and outdated script.

Thank you :)

Xeno

Share this post


Link to post
Share on other sites

I believe The Bohemia community is small enough without attitudes like this. The use of a script like this is harmless, and helps enable new members of the community to create their own mission without relying on the ever decreasing numbers of remaining mission editors. You can't expect new members to create everything from scratch.

http://forums.bistudio.com/showpost.php?p=1755721&postcount=282

Edited by [DirTyDeeDs]-Ziggy-

Share this post


Link to post
Share on other sites
-Ziggy-;2058171']I believe The Bohemia community is small enough without attitudes like this. The use of a script like this is harmless' date=' and helps enable new members of the community to create their own mission without relying on the ever decreasing numbers of remaining mission editors. You can't expect new members to create everything from scratch.

http://forums.bistudio.com/showpost.php?p=1755721&postcount=282

I will second that , I am working on a mission and put a lot of time in to it but I do it becuse I love to write code. If anyone can use my work to make mission more power to them .

Dont want to see toh to turn out like some other mission in aram where people where fighting over scripts and stuuf .

Share this post


Link to post
Share on other sites

A bit fixed vehicle.sqf

Now you can leave the vehicle and it will remain in place, if not damaged.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×