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 scripts

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
azizguy101
Meatbag
Posts: 1
Joined: Thu May 19, 2016 5:29 pm
Title: commander guy
Location: in an alternate dimensoin
Gender:

cpu scripts

Post by azizguy101 » Thu May 19, 2016 5:36 pm

i joined sfd a few months ago and i like the map editor but when i make a CPU player i can't make him attack. i'm sure this has something to do with scripts and this is my first post so don't judge me and i don't know if there is another forum like this but how do i make CPU's attack? Any replies help :D
P.S. in the future can you add a simple button in the player spawn trigger that activates aggressiveness?

thank you
Last edited by azizguy101 on Thu May 19, 2016 7:53 pm, edited 1 time in total.
1 x

Armadyl5
Superfighter
Superfighter
Posts: 119
Joined: Sun Mar 20, 2016 9:50 am
Started SFD: 1.2.1
Gender:
Age: 25

Post by Armadyl5 » Thu May 19, 2016 8:22 pm

okay , First , Welcome to This Forum , There is a Rules Thread That The Admins Here Would Really Appreciate You Reading it .

For Your Request , Making a Bot Attack is Easy , Here is What You Should Do : -

1) Press The CPU Spawn Trigger , It Should Show It's Properties .

2) You Should See a Box Named "Script Method"

3) Type "Bot" inside the Box (Without The "")

4) Go To The Script Box (You Can Find it By Clicking "Script" On The Top Right Corner of the Map Editor)

5) Copy and Paste This in it :-


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


Press Compile and Then Start The Game .


Now You The Bot Should Attack You When It Spawns .
0 x
Never Surrender !

Always Fight For Your Rights , and Don't Let Your Friends Down .

User avatar
Shock
Superfighter
Superfighter
Posts: 312
Joined: Sun Mar 20, 2016 7:17 am
Title: Content-maker
SFD Account: Shock
Started SFD: Pre-Alpha 1.2.0.
Location: Belarus
Gender:
Age: 24
Contact:

Post by Shock » Fri May 27, 2016 10:28 pm

Armadyl5 wrote:okay , First , Welcome to This Forum , There is a Rules Thread That The Admins Here Would Really Appreciate You Reading it .

For Your Request , Making a Bot Attack is Easy , Here is What You Should Do : -

1) Press The CPU Spawn Trigger , It Should Show It's Properties .

2) You Should See a Box Named "Script Method"

3) Type "Bot" inside the Box (Without The "")

4) Go To The Script Box (You Can Find it By Clicking "Script" On The Top Right Corner of the Map Editor)

5) Copy and Paste This in it :-


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


Press Compile and Then Start The Game .


Now You The Bot Should Attack You When It Spawns .
Hello , i need a help.
Have you got the scripts like this ?
1.Cpu on , Cpu off
2.Cpu go away.

Help please.
0 x
-Content-maker.

User avatar
Motto73
Superfighter
Superfighter
Posts: 316
Joined: Mon May 09, 2016 7:35 am
Title: Lazy ass
SFD Account: Motto73
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 24

Post by Motto73 » Fri Aug 26, 2016 7:26 am

Shock wrote:
Armadyl5 wrote:okay , First , Welcome to This Forum , There is a Rules Thread That The Admins Here Would Really Appreciate You Reading it .

For Your Request , Making a Bot Attack is Easy , Here is What You Should Do : -

1) Press The CPU Spawn Trigger , It Should Show It's Properties .

2) You Should See a Box Named "Script Method"

3) Type "Bot" inside the Box (Without The "")

4) Go To The Script Box (You Can Find it By Clicking "Script" On The Top Right Corner of the Map Editor)

5) Copy and Paste This in it :-


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


Press Compile and Then Start The Game .


Now You The Bot Should Attack You When It Spawns .
Hello , i need a help.
Have you got the scripts like this ?
1.Cpu on , Cpu off
2.Cpu go away.

Help please.
You should download my template.
0 x
Image

Post Reply