Posted: . At: 8:26 AM. This was 5 years ago. Post ID: 12742
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Arma 3 script samples and functions to make a great mission.


To play music while players enjoy your mission, use this simple but effective function.

6 fademusic 0.1;
 
[] call BIS_fnc_jukebox;

This plays ambient music, randomly selecting tracks to play. Put this in the initPlayerLocal.sqf file.

Put this code in the init of a vehicle at the base to have it respawn after it is abandoned for a while, or if it is destroyed.

[this,65,80,300,{},0,2,1,false,false,0,false] call BIS_fnc_moduleRespawnVehicle;

This will respawn the vehicle at the place it started when the mission loaded.

When you have a base with a lot of decorative objects, and they are not interactive, then use this code in their init, this will set them as super simple objects.

[this, true] call BIS_fnc_replaceWithSimpleObject;

This will help keep framerates up. If you have a massive base built, and forget to disable simulation on your walls, then your mission will run very badly, but setting wall segments as super-simple will help greatly when running a mission with 100 players.

How to disable Zeus notifications and remove the bird that flies around when Zeus is active.

{ // Turn off "X is now Zeus" notifications, remove bird flying around
	_x setVariable ["showNotification", false];
	_x setVariable ["bird", objNull];
} forEach allCurators;

These script samples will really help your mission out. Making a mission from scratch is better than using outdated old copies of AW Invade and Annex on your server, that is far too outdated and does not have all new features. Coding one from scratch means you can take advantage of new functions added to the game in Laws of War and Tacops. The script I would like to code though is one that filters the chat to get rid of swear words and abusive language while keeping the chat working. That would be really helpful to multiplayer servers. There used to be a ton of servers that used old Invade and Annex copies, but they are mostly gone now. Everyone uses APEX edition, as it is all up to date and has many more features. Another thing people do is run a server that allows any mod to be used, this means that someone can just create a mod with CBA and run any script they want upon joining the server. Take the time to setup a server properly, and this will not happen.

https://community.bistudio.com/wiki/Arma_3_Dedicated_Server.

Another very useful scripting sample, this is run inside a function called by spawn instead of call. This means I have trouble with functions that should output globally, but this fixes it.

_add = {
	_AOStartText = format
	[
		"Enemy forces spotted %1. Clear the area.", TownLoc
	];
	[west,["task3"],["Destroy the enemy invasion.","Destroy the enemy.","aoMarker"], objNull,1,3,false] call BIS_fnc_taskCreate;
	["TaskAssigned",["",_AOStartText]] remoteExec ["BIS_fnc_showNotification",0];
};
 
[] spawn _add;

This shows a notification easily, using remoteExec. Do not use BIS_fnc_MP anymore, remoteExec is the way to go, especially after the security updates.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.