Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> MMF AI help
United States
Slamman
Posted: Oct 19 2005, 09:32 PM
Quote Post


222
[*][*][*][*][*]
[*]

Group Icon
Group: Members
Posts: 5669
Member No.: 815
Joined: 6-February 05

Status: (0d) [--]


How do I make it so an enemy is stopped but when you get closer to it, it sees you and starts attacking?

Thanks.


--------------------
PMIntegrity Messenger IMAOLYahooMSN
Top
United States
Xgoff
Posted: Oct 19 2005, 09:35 PM
Quote Post


<):|
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03

Status: (0d) [--]


fskh let me see if I can find that Piranha Plant tutorial thing Draco made since this is basically the inverse of it

EDIT: well, maybe not
EDIT 2:

(the equations work off of the hotspot of the enemy and player so take that into consideration)

Non-directional version
CODE
Always
--> Set Alterable Value X of "Enemy" to: Abs( X( "Enemy" ) - X( "Player" ) )
--> Set Alterable Value Y of "Enemy" to: Abs( Y( "Enemy" ) - Y( "Player" ) )

Alterable Value X of "Enemy" ≤ to ( X distance you want, positive value )
+Alterable Value Y of "Enemy" ≤ to ( Y distance you want, positive value [for their "field of vision"])
--> Whatever they do when they can see you

Alterable Value X of "Enemy" > to ( your specified X distance )**
--> Whatever they do when they can't see you

Alterable Value Y of "Enemy" > to ( your specified Y distance )**
--> Whatever they do when they can't see you


Directional version
CODE
Always
--> Set Alterable Value X of "Enemy" to: Abs( X( "Enemy" ) - X( "Player" ) )
--> Set Alterable Value Y of "Enemy" to: Abs( Y( "Enemy" ) - Y( "Player" ) )

Alterable Value X of "Enemy" ≤ to ( X distance you want, positive value )
+ Alterable Value Y of "Enemy" ≤ to ( Y distance you want, positive value [for their "field of vision"])
+ X position of "Enemy" < X position of "Player"
+ "Enemy" is facing a direction: ( --> )
--> Whatever they do when they can see you

Alterable Value X of "Enemy" ≤ to ( X distance you want, positive value )
+ Alterable Value Y of "Enemy" ≤ to ( Y distance you want, positive value [for their "field of vision"])
+ X position of "Enemy" > X position of "Player"
+ "Enemy" is facing a direction: ( <-- )
--> Whatever they do when they can see you

Alterable Value X of "Enemy" > to ( your specified X distance )**
--> Whatever they do when they can't see you

Alterable Value Y of "Enemy" > to ( your specified Y distance )**
--> Whatever they do when they can't see you


EDIT 3: Ignore the Y events for now until I figure out what I'm doing

EDIT 4: Sorry I can't get the Y's to work even though I'm setting them up exactly like the X's, so you'll have to figure something out there


EDIT 5: Okay I figured it out

EDIT 6: Watch someone come up with a simpler version

** these two events need to be separate

As far as my experimentation goes it works with multiple enemies, I'll work on one that requires them to be looking in your direction to see you

AV's X and Y are just example letters so you can use others if you want

EDIT 7: Hopefully the last edit. Fixed a bug in the Directional version that sometimes made them "see" you if they were looking in the opposite direction, and not see you if they were looking in your direction. wtf that's what I get for initially testing it with small distances

This post has been edited by Xgoff on Oct 20 2005, 10:25 AM


--------------------

This post may contain original research or unverified claims.
Please disregard the above information and contact an administrator.

DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth:
DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message
DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it
DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep
DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot
this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence
NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above

QUOTE
(5:25:58 PM) Mikau: xgoff
(5:26:00 PM) Mikau: guess what
(5:26:04 PM) Xgoff: chicken butt
(5:26:09 PM) Mikau: **** you
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Slamman
Posted: Oct 19 2005, 10:39 PM
Quote Post


222
[*][*][*][*][*]
[*]

Group Icon
Group: Members
Posts: 5669
Member No.: 815
Joined: 6-February 05

Status: (0d) [--]


Ok thanks. I'll try these tomarrow because I have to go to bed now. I'll let you know if it works.


--------------------
PMIntegrity Messenger IMAOLYahooMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0496 ]   [ 13 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.26 ]