Download

Limit Specific Structure Placement to .. maybe 4 ?

Question above:

Its when i want a structure, Table, Box etc to check for same structure in range and prevent placement when there are to many (like 4 or more)

Is this possible with the Graph ? Iam new with the Graph so please be carful :smiley:

Yes. Quite easy really. On begin play do a get all actors of class (your actor), add a numerical check then destroy actor if it is more than specified amount

Something like this should work.

5cf54c40eef8d0b6f7df2ec93c61d54e37475b8e.png

You may want to add some sort of self check on there or increase the amount by 1 because it WILL count the one you are in the process of placing
You probably also want to add a “IsPreviewStructure” check after the switch has auth node since while in preview mode it will only count any actors within stasis range. It checks the entire server on begin play after final placement

d334b3b93094089d08074add790c3837af26dcbc.png

Thank you,i will check on that. But this effects only the Tribe or Player ? Because i dont want that a tribe places 4 and nobody else can place this structure later :slight_smile:

Add a targeting team comparison then it will be 4 per tribe

hi, i’m doing something similar and i’ve got questions on what you set… why the switch authority ?
How does targetnig team worked, caus when i test it i’m not in traibe but it find a team so do i have to use something else like a cast to shooter player and get tribe to make the struct only buildable ince per tribe? Also will there not be an issue if players use fuse tribe?

Authority is called when something executes on the server. This is stuff that you need the server to do.

Targeting team is different from tribe id, that’s why you’re getting one outside of a tribe.

The logic is only used when a player is placing the structure. If they place then merge, no checks will be made on how many the resulting tribe owns.

i put a “is preview structure” test so i can have different calling of “event begin play” but all my casts fail due to get owner, owner controller,… i test all that i can ^^’ return none in both call of event

I’ll try to play with the event on changing team to see if i can do something when the tribe merge

There technically is no owner when the item is in preview mode since it is not actually placed yet. Preview only fires on client so the server does not yet know who owns it.

You could be cheesy and start a looping event that executes like every 15 minutes or whatever to check how many the tribe owns.

Can someone post an example of this with the targeting team comparison? This is exactly what i need except i dont know where to add in the comparison. Thx.