Interesting stuff. I'll see if I can make it work nicely and keep code contained. On Wed, Jul 22, 2009 at 8:27 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote: > well hell, this actually will probably be ok for your needs here. > > if it's too slow, we could always make that distance check not do all > kittens every frame and it would look fine (ie do 1 kitten each frame or > something). > > try and do it this way kent and if we hit problems we can think of a better > solution. > > The ugly thing about this is that it's a behavior kind of script but youd > have to put code in the main script file to make it work. > > That might be able to be made less ugly by cleverly hiding away the ugly > code in other script files (ie the "dofile" method that you do for enemy > behavior scripts). > > and if you are interested, that "state" idea i was telling you about, thats > a pretty common way AI is implemented in games. > > Like a state might be "wander around" where they just walk around > aimlessly, and when a monster gets hit by a sword they enter the "flee" > state where they just run in circles aimlessly playing a scared animation. > It's called a "Finite State Machine", and is a computer science term but > probably something youd hear a lot working on different games (: > > On Wed, Jul 22, 2009 at 5:10 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote: > >> btw im still thinking about a longer term more elegant solution :P >> >> >> On Wed, Jul 22, 2009 at 5:09 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote: >> >>> REALLY UGLY SOLUTION... >>> >>> you know how the send message to mob stuff can GET values from mobs too? >>> instead of just sending data? >>> >>> every tick of the map, you could ask each kitten for it's position using >>> that method. >>> >>> then, in your map tick, loop through all the positions, see which are >>> close enough to eachother, and send notifications to the mobs that another >>> kitten is close to them (or kittenS?) along with location data if needed >>> >>> complicated as heck, and ugly! >>> >>> but it would work (: >>> On Wed, Jul 22, 2009 at 5:06 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx>wrote: >>> >>>> Hmm lemme think about it! >>>> >>>> if i gave you a list of enemies to loop through it'd be an N^2 problem >>>> which could get really slow especially with it running in script. >>>> >>>> Let me think about it a lil cause yeah, being able to detect proximity >>>> of stuff besides the player is important (: >>>> On Wed, Jul 22, 2009 at 4:54 PM, Kent Petersen <kentkmp@xxxxxxxxx>wrote: >>>> >>>>> Alan - I would like my kitties to play with each other when they get >>>>> close to one another. My problem is that I can't figure out how to make >>>>> the >>>>> kitties detect one another. Ultimately, I would like to be able to have 4+ >>>>> kitties wandering around a room and playing with each other when they get >>>>> close to each other. Can you point me in the right direction? >>>>> >>>>> >>>>> On Wed, Jul 22, 2009 at 4:37 PM, Apache User < >>>>> dhapache@xxxxxxxxxxxxxxxxxxx> wrote: >>>>> >>>>>> User:korgath >>>>>> >>>>>> Message: added first draft of the kitties >>>>>> >>>>>> <Files Changed> >>>>>> A Scripts/Enemies/kitty.lua >>>>>> U Scripts/Personal/Kent/kenttest.lua >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> >