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.

CPU Can not be equipped anything if you bring a script?

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Jovani
Fighter
Fighter
Posts: 55
Joined: Sun Sep 18, 2016 2:49 am
Title: Heroe
SFD Account: Jovani
SFD Alias: Johnny
Started SFD: 2014
Location: Mexico
Gender:

CPU Can not be equipped anything if you bring a script?

Post by Jovani » Sun Feb 19, 2017 8:24 am

The cpu can equip things but if you bring a script for example to attack a player infinitely does not serve the tool so you can equip something?

How disappointing :/

Image
0 x
-I hope one day to have green ping on most servers...
-SFD is a good game that inspired people to make friends, be artists and "YouTubers". I hope one day SFD becomes famous and everyone recognizes it.

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

Post by Gurt » Sun Feb 19, 2017 9:07 am

??
Can you try to re-formulate the question?
1 x
Gurt

User avatar
Jovani
Fighter
Fighter
Posts: 55
Joined: Sun Sep 18, 2016 2:49 am
Title: Heroe
SFD Account: Jovani
SFD Alias: Johnny
Started SFD: 2014
Location: Mexico
Gender:

Post by Jovani » Sun Feb 19, 2017 7:34 pm

0 x
-I hope one day to have green ping on most servers...
-SFD is a good game that inspired people to make friends, be artists and "YouTubers". I hope one day SFD becomes famous and everyone recognizes it.

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

Post by Gurt » Sun Feb 19, 2017 8:34 pm

You're most likely doing something in the script as the CPU jump to the player.
Commands are not designed to create AI. Improper use of the commands can lock a certain command to never complete and therefor never execute the next command. Read the PlayerCommandTrigger section in the help for some more details.
1 x
Gurt

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Post by JakSparro98 » Sun Feb 19, 2017 9:03 pm

It also seems you're still using the tutorialA bot, please, don't use it because will be removed in future updates. anyway, as Gurt said the script used isn't known so It could contain a command to remove all weapons.
0 x

User avatar
Jovani
Fighter
Fighter
Posts: 55
Joined: Sun Sep 18, 2016 2:49 am
Title: Heroe
SFD Account: Jovani
SFD Alias: Johnny
Started SFD: 2014
Location: Mexico
Gender:

Post by Jovani » Sun Feb 19, 2017 9:29 pm

This is the script I use

public void Botspawn(CreateTriggerArgs args)
{
IPlayer newbot = (IPlayer)args.CreatedObject;
newbot.SetBotType(BotType.TutorialA);
}
0 x
-I hope one day to have green ping on most servers...
-SFD is a good game that inspired people to make friends, be artists and "YouTubers". I hope one day SFD becomes famous and everyone recognizes it.

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

Post by Gurt » Sun Feb 19, 2017 10:56 pm

PlayerCommands only works when there are no user or AI controlling the player. This information is missing in the ScriptAPI - adding it to the next update.
So when you activate TutorialA the AI takes control and commands can't be used.
Notice that SetBotType() is obsolete and abandoned. It will be removed in future versions of the game.
0 x
Gurt

Post Reply