This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-07-17 20:23:44

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Ai?

I want to know how to make a moving AI.

Last edited by keroro645 (2008-07-17 20:24:18)

Offline

 

#2 2008-07-17 20:27:41

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ai?

For what kind of game? What is the purpose of the AI?


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2008-07-17 20:38:02

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

Re: Ai?

AI is artificial intelligence. It gives the computer random actions to a specific point. Useful for a game that enables the option of one to four players. Or just one or two. Possibly more. You add AI so all games don't require 2 people to play. For example, a shooter game might require random movements for a computer player. A racing game requires a specific path, velocity, and actions to do when abnormal objects are near. You get the point. I can make a script for you if you tell me what game you're making.

Last edited by Kingdaro (2008-07-17 20:38:43)

Offline

 

#4 2008-07-17 21:24:19

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Ai?

Its for deathmatch.A shooting game .I want the ai to walk around.

Offline

 

#5 2008-07-18 06:43:25

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

Re: Ai?

Ok here's what you can do...
[blocks]
Make a variable <{ AI }>
<when green flag clicked>
<forever>
<wait( <pick random( 1 )to( 5 )secs>
<set{ AI }to( <pick random( 1 )to( 2
<end>
<when green flag clicked>
<forever>
<if> <( <{ AI }> <=> 2 )>
<point towards( Player
<move( 3 )steps>
<end>
<end>
<when green flag clicked>
<forever if> <( <{ AI }> <=> 2 )>
<wait( <pick random( .9999 )to( 1.9999 )secs>
<broadcast[ fire bullet
<end>
[/blocks]
If this doesn't work, then just tell me I'll try to correct it. And the variable is supposed to be AI not A.

Last edited by Kingdaro (2008-07-18 06:51:41)

Offline

 

#6 2008-07-18 14:39:56

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Ai?

Kingdaro wrote:

Ok here's what you can do...
[blocks]
Make a variable <{ AI }>
<when green flag clicked>
<forever>
<wait( <pick random( 1 )to( 5 )secs>
<set{ AI }to( <pick random( 1 )to( 2
<end>
<when green flag clicked>
<forever>
<if> <( <{ AI }> <=> 2 )>
<point towards( Player
<move( 3 )steps>
<end>
<end>
<when green flag clicked>
<forever if> <( <{ AI }> <=> 2 )>
<wait( <pick random( .9999 )to( 1.9999 )secs>
<broadcast[ fire bullet
<end>
[/blocks]
If this doesn't work, then just tell me I'll try to correct it. And the variable is supposed to be AI not A.

It dosent really work.

Offline

 

#7 2008-07-19 07:23:07

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

Re: Ai?

keroro645 wrote:

Kingdaro wrote:

Ok here's what you can do...
[blocks]
Make a variable <{ AI }>
<when green flag clicked>
<forever>
<wait( <pick random( 1 )to( 5 )secs>
<set{ AI }to( <pick random( 1 )to( 2
<end>
<when green flag clicked>
<forever>
<if> <( <{ AI }> <=> 2 )>
<point towards( Player
<move( 3 )steps>
<end>
<end>
<when green flag clicked>
<forever if> <( <{ AI }> <=> 2 )>
<wait( <pick random( .9999 )to( 1.9999 )secs>
<broadcast[ fire bullet
<end>
[/blocks]
If this doesn't work, then just tell me I'll try to correct it. And the variable is supposed to be AI not A.

It dosent really work.

To tell the truth that script seems immistakeable. It has to work.

Offline

 

#8 2008-07-19 12:20:38

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Ai?

I just dont like how the script works.

Offline

 

#9 2008-07-19 13:22:27

newareagle
Scratcher
Registered: 2008-06-10
Posts: 100+

Re: Ai?

keroro645 wrote:

I just dont like how the script works.

Look at my presentation Not-So-Simple Ai and my tanks demo, and you can use some of the scripts for your game if you would like.


My Guitar Hero Game.
8/9 Projects on the Front Page at Once!

Offline

 

#10 2008-07-22 00:06:09

smkymcpimsht
Scratcher
Registered: 2008-06-08
Posts: 12

Re: Ai?

We could probably be alot more helpfull if you were more descriptive, what EXACTLY is the problem? Do they walk into walls? Not shoot enough? What dont you like about it?

Offline

 

#11 2008-07-22 00:07:51

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Ai?

smkymcpimsht wrote:

We could probably be alot more helpfull if you were more descriptive, what EXACTLY is the problem? Do they walk into walls? Not shoot enough? What dont you like about it?

Well, I was helping, and they need to shoot the player and avoid walls. And know the players position at ALL times


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

Board footer