View Full Version : [AS2] AI Follow Agro Range?
Sythius
09-18-2009, 03:16 PM
I tested out using.
http://www.freeactionscript.com/2009/04/enemy-behavior-run-away-follow-player/
And ti worked, and it does everything I wanted, different turn speeds and such for the different creatures.
But there's a few issues with that...
It spawns enemies randomly on the map, while I want to be able to place them at certain, exact locations.
The second problem is that the maps are much bigger than the stage size, so the easiest means to have the enemies where I want them, would be if I could place them directly.
I have tried converting that fla's code to that, but I'm finding it nigh on impossible to do it. =(
Help would be much appreciated, this is like the last mechanic I need in my game =)
xdeath
09-18-2009, 05:22 PM
here how about this file. i changed a few parameters for the character create function. see that fixes your location issue on were there created. the problem with this is, you want it to not leave the screen correct?
well the problem is it will go off screen because there's nothing in the code that says it has to stay within a curtain place. its free to travel as much distance as it wants to currently. also there is a slight glitch in the code that the creator either never fixed or didn't see. enemies update once when everything is created and until you start dragging it doesn't start acting like the enemy we told it to act like.
but yes i hope my few quick changes comes off some assistance.
Sythius
09-18-2009, 06:32 PM
Thanks for the effort.
And nuh, the issue is with I can't place them where I want them, many of them will be off the stage area.
The glitch doesn't matter (I think).
What I want to be able to do is to place them actually on the stgae.workplace where I exactly want them, without using AS. But still ant them to respond as they do in that when the target is close.
xdeath
09-19-2009, 12:10 AM
ohh i though you wanted to be able to tell them were to be placed in the code. yeah that easy just take out the line in the enemy create functon called attachMovie then when you place them on stage make sure you give them the same instance name as they would have had before hand.
Sythius
09-19-2009, 12:38 AM
Hm, I tried what you said, but I can't get it work :S
Could you be more specific? :3
xdeath
09-19-2009, 12:50 AM
not really. its really a one line change. i'm a bit busy right now, but i'll come back when i have time and i'll try and do what you asked.
Sythius
09-19-2009, 12:29 PM
Well I took out that line, placed a symbol on the stage, named it "e1" and ti didn't work...
I then tried switching what layer it's on, it's name to "TypeA" etc, and still didn't work..
xdeath
09-19-2009, 02:50 PM
hmm...well normally this is an easy fix. but in all honesty i don't know why this isn't working. i have my suspicions but i can't seem to get it to work. these kind of systems are built normally to be more dynamic, so the whole creating them on the stage via code is how it normally done.
but for some screwed up reason i can't seem to get this working for you. hopefully someone else can. i gave it my best shot but it wouldn't work.
Sythius
09-20-2009, 05:00 PM
Hehe, thanks for trying to help anyhow ^^
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.