TGC Codebase Backup



Smarter AI for Ralfys large spiders by wayne davis rocks

20th May 2008 8:16
Summary

More life like response to colision, distance and attacks



Description

No more getting pushed through walls, no more getting bit from across the room, when the spider gets right up on you it then stops pushing you the animation goes back to a slight pulsating motion instead of still walking and then you get bit when you run and get away the spider chaces until you get far enough away that you are no longer a threat so it goes back to being calm but always watching you. This is my first attempt at scripting anything of any kind so please let me know if its worth the 8 hours I spent figuring it out.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    desc          = Spider is calm then within range chace/attacks then backs off and
                     calms back down after you get a certain distance away
                    also can only bite when it is right up on top of you 
                     

;Triggers


:state=0,plrdistwithin=250:state=1
:state=1,plrdistfurther=90:rotatetoplr,movefore=10,animate=1
:state=1,plrdistfurther=250:animate=0,state=0
:state=1,plrdistwithin=90,rateoffire:rotatetoplr,state=2
:state=2,framebeyond=8 60,plrdistwithin=90:animate=0,plraddhealth=-10,sound=audiobank\misc\bite.wav,state=3
:state=2:incframe=8,rotatetoplr
:state=2,frameatend=8:state=1
:state=3:incframe=8
:state=3,frameatend=8:state=1