Jump to content
Danskkat

Ladder Use Prevention

Recommended Posts

Is there a way to prevent units from using a ladder?

I've been throwing down invisible walls to block the unit from getting to it, but it doesn't seem to work for the AI who repeatedly climb up anyway.

I was debating making a marker that detects someone on the ladder and either removes unit from play or teleports it elsewhere but I'm worried about either A: a lot of removed enemies for no good reason or B: teleported unit may just decide to go path back over again.

Any advice or tricks?

Thanks!

Share this post


Link to post
Share on other sites

Use the "AnimChanged" object event handler to detect the ladder anim, then execute the "ladderOff" action

 

<unit> addEventHandler [
	"AnimChanged",
	{
		params ['_unit','_anim'];
		if (_anim in [ladder animations]) then {
			_unit action ["ladderOff",<building object>];
		};
	}
];

 

  • Like 3

Share this post


Link to post
Share on other sites
13 minutes ago, fn_Quiksilver said:

Use the "AnimChanged" object event handler to detect the ladder anim, then execute the "ladderOff" action

 


<unit> addEventHandler [
	"AnimChanged",
	{
		params ['_unit','_anim'];
		if (_anim in [ladder animations]) then {
			_unit action ["ladderOff",<building object>];
		};
	}
];

 

 

Oh that's insanely clever.

I love it. Thank you!

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

×