Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Small Suggestions topic

Give us your input on how we may improve the game in future versions.
Forum rules
By using the forum you agree to the following rules. For this forum you also need to follow these additional rules.
User avatar
Shock
Superfighter
Superfighter
Posts: 258
Joined: Sun Mar 20, 2016 7:17 am
SFD Account: Shock
Started SFD: Pre-Alpha 1.2.0.
Location: Metalion
Gender:
Age: 20
Contact:

Re: Small Suggestions topic

Post by Shock » Tue Nov 19, 2019 5:58 am

Filter players/cpu for activate trigger would be a nice addition, so... You will set chosen players who can activate anything.
1 x
-Content-maker.

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1684
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 29

Post by Gurt » Sat Nov 23, 2019 12:24 pm

Shock wrote:
Tue Nov 19, 2019 5:58 am
Filter players/cpu for activate trigger would be a nice addition, so... You will set chosen players who can activate anything.
Any filtering for triggers can be done today using the "Script Method" parameter.
Here's some demo code only allowing Team1 to press a button. Just type in "Btn01_Team1Only" in the "Script Method" property of the button:

Code: Select all

public void Btn01_Team1Only(TriggerArgs args)
{
	if (args.Sender != null && args.Sender is IPlayer && ((IPlayer)args.Sender).GetTeam() == PlayerTeam.Team1) {
		// Allow sender to push button by not doing any custom code...
	} else {
		// Don't allow sender to activate button by handling the event here
		args.Handled = true;
	}
}
2 x
Gurt

Post Reply