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.

Script Method

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Zere
Fighter
Fighter
Posts: 39
Joined: Sun Mar 20, 2016 6:08 pm
Started SFD: 1.2.0
Gender:
Age: 25

Script Method

Post by Zere » Tue Jun 07, 2016 5:14 pm

Is there a way to change the script method by entering certain area in the map?

public void Bot(CreateTriggerArgs args){
IPlayer ply = (IPlayer)args.CreatedObject;
ply.SetBotType(BotType.TutorialA);
}

I have this scrip that makes the CPU's attack you automatically when you set the Script Method to Bot, but I would like to make it work so that when you enter certain area the script method of a SpawnPlayerTrigger would change from none to Bot.

Can a script make this happen?
0 x
Men ;D

User avatar
Splinter
Superfighter
Superfighter
Posts: 314
Joined: Sat Mar 19, 2016 5:03 pm
Title: Grenade chef
Started SFD: 1.1.6
Location: Brazil
Gender:

Post by Splinter » Tue Jun 07, 2016 6:52 pm

I think there are simpler ways to do this. Make a global variable that becomes true when you enter the area, and make this script only work if "var == true".
1 x
Hold your breath.

User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

Post by gwendalaze » Tue Jun 07, 2016 9:31 pm

trigger.SetScriptMethod(null);
and
trigger.SetScriptMethod("method");

with methods that are triggered by entering/exiting said areas
*fly away*
1 x
- Gwendalaze, failing at being fun, just like this signature

User avatar
Zere
Fighter
Fighter
Posts: 39
Joined: Sun Mar 20, 2016 6:08 pm
Started SFD: 1.2.0
Gender:
Age: 25

Post by Zere » Tue Jun 07, 2016 11:19 pm

Thanx a lot guys
0 x
Men ;D

Post Reply