Jump to content

Recommended Posts

I have tried to search the topic and I have not found anything that really explain in depth what Game Logic is and how it works.

I was looking through the Insert Units menu, and found Game Logic, Once I clicked it it had several choices, Location, Objects and Side. I selected objects and it had another list of choices; Base Camp City Outpost Town Village.

I wondering if someone can tell me the following;

What is Game Logic?

How does it work?

How do you use it, in designing Missions

I also believe its in the Insert module as well.

If somone can assist me with this, or direct me in the right direction, it would be greatly appreciated;

  • Like 1

Share this post


Link to post
Share on other sites

I have tried to search the topic and I have not found anything that really explain in depth what Game Logic is and how it works.

I was looking through the Insert Units menu, and found Game Logic, Once I clicked it it had several choices, Location, Objects and Side. I selected objects and it had another list of choices; Base Camp City Outpost Town Village.

I wondering if someone can tell me the following;

What is Game Logic?

How does it work?

How do you use it, in designing Missions

I also believe its in the Insert module as well.

If somone can assist me with this, or direct me in the right direction, it would be greatly appreciated;

Something that has got me fascinated since recently. What do they do? What would require "Base" game logic? Does it have the capability of spawning a composition? Surprised to see no documentation in the vast universe of the internet. :(

 

Same goes for Skirmish: Trigger.

Share this post


Link to post
Share on other sites

There is also Logic OR and Logic AND, which seems a total mystery to me.

 

You used to be able to do a trick where if you place a Waypoint on a Logic you could synch multiple triggers to that waypoint and in that waypoint you could set it OR/AND. When the triggers meet the conditions the waypoint on ACT would run.

 

I's no Longer possible to Attach waypoints to logics so this doesn't work any more so you have to script the whole thing.

Share this post


Link to post
Share on other sites

A GameLogic is nothing more than an object that can run a script it can also be assigned waypoints of AND or OR but instead of moving towards a waypoint like a unit would it jumps to the position.
Any triggers synced to these waypoints will define when the GL can move on to its next WP, being all triggers must have activated(AND) or atleast one(OR).

There is little difference between the gameLogic types other than their class name, this comes in handy if say you wanted to know the positions of Base type gamelogics as you could do a search for that specific type.

A Module is nothing more than a gameLogic with some code to run. Since Arma3 and with the new module framework this system has been expanded to also incorporate some variables that are shown in the editor inspector and are placed on the GL at mission start.
 

I's no Longer possible to Attach waypoints to logics so this doesn't work any more so you have to script the whole thing.

Hmm thats a shame that they are no longer supported in the RC/DEV build.
 

There is also Logic OR and Logic AND, which seems a total mystery to me.

These types are nothing more than a gameLogic with a specific className, MiscOR_F and MiscAND_F respectively. They are designed to be used only with other objects that are specifically scripted to look for them.
From a quick grep the only thing that is designed to look for them is spawnAI modules for use with sectors.

For instance you could use one yourself, say you had a number of triggers that you needed to check that some were all activated and some others only needed to have atleast one activated.
Create a normal GL ( gamelogics >> objects >> gamelogic ) and place this in its init.

h = this spawn {
	
	_logic = _this;
	_ANDs = [ _logic, "MiscAND_F" ] call BIS_fnc_synchronizedObjects;
	_ORs = [ _logic, "MiscOR_F" ] call BIS_fnc_synchronizedObjects;
	
	_triggerOR = [];
	{
		_triggers = [ _x, "EmptyDetector" ] call BIS_fnc_synchronizedObjects;
		_triggerOR = _triggerOR + _triggers;
	}forEach _ORs;
	
	_triggerAND = [];
	{
		_triggers = [ _x, "EmptyDetector" ] call BIS_fnc_synchronizedObjects;
		_triggerAND = _triggerAND + _triggers;
	}forEach _ANDs;
	
	waitUntil {
		{ triggerActivated _x }count _triggerOR > 0 &&
		{ triggerActivated _x }count _triggerAND isEqualTo count _triggerAND
	};
	
	hint "Finished";
};

Sync a AND logic and a OR logic to this GL.
Then sync as many triggers to either of these.
When all the AND triggers have been activated and atleast one of the OR triggers has activated the GL will hint "Finished".

Not a particularly great example but hopefully gets the point across.
Example Mission showing both gamelogic waypoints and the above AND/OR logic

  • Like 3

Share this post


Link to post
Share on other sites

My understanding is game logics were used to create more complex mission flow than is possible with triggers etc alone. This dates back to the original Operation Flashpoint, 15 years ago. Script has grown a lot since OFP:Resistance and made that use pretty much obsolete.

 

BI have removed game logics entirely from the 3D editor too (or am I just not looking in the right places).

  • Like 1

Share this post


Link to post
Share on other sites

Game logics are still available, however, yes, some were removed. For example it not possible to give gamelogics waypoints to create a mission flow.

 

You can find game logics in 3den next to modules.

  • Like 1

Share this post


Link to post
Share on other sites

Some very informative posts. Saw a thread by Taijin  some time back and it dated a couple of years back, that he used game logic to spawn ammo create inside a vehicle. How? He would place the GL on a vehicle position and since it is an invisible entity, he would then attach the ammobox with this GL. Making it appear as a re-supply vehicle. Very clever :D

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

×