Jump to content
Sign in to follow this  
CPT_ALPHA

Object in a place

Recommended Posts

Hi, I want to ask a question. How can you call an object in a place?
Example:

Call "Land_Table_EP1" in a place "Site"

My idea is that if a type of object is in a place, X thing happens. I thought with:

if {"Land_Table_EP1" inArea "Site"}
	...

But it does not work.
The idea is that it is not a variable, because I would have to put a variable to 40 objects and create 40 "If".

I would appreciate any help.

Share this post


Link to post
Share on other sites

If the Site is the name of the trigger, then you'd better use its condition field to activate it and activation field to call your X thing.
Condition:

{typeOf _x isEqualTo "Land_Table_EP1"} count thisList > 0

Activation:

hint "X thing";

This should work with units, but I'm not sure if it will work with interior items as well.
Take a look here.
 

Share this post


Link to post
Share on other sites

If you use a marker instead of a trigger, then you need to write a separate script to check the condition after a certain period of time

while {true} do 
	{
		sleep 1;
		
		if (count (((entities "") select {typeOf _x isEqualTo "Land_Table_EP1" and _x inArea "Site"})) > 0) then 
			{
				hint "X thing";
			}
	};

 

Share this post


Link to post
Share on other sites

For what it's worth, what I want to do is if I bring a "Table" to a "place", that table has a monetary value.

A cash with starting value 0 in an init. This increases when the table is left in X place.

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  

×