Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem about loadTarget...
#1
:( 
I'm creating one script and i was trying to do this:

LoadTarget Type 4 > Check if is in an offencive mode > If Yes act (Defend or Dodge).
> If No Load a new Target.



LoadTarget Type 3 > //Check if is in an offencive mode > If Yes act (Defend or Dodge).
> If No Load a new Target.



LoadTarget Type 0 > Act ( Defend, Dodge or Attack).



Well. So here starts my problem. I've made all the script but, looks like the loadTarget function become a mess. I've tried a lot of changes but nothing seems to work. Here is the main part of this AI.





If need more informations just tell me. I hope anybody can help me. I don't know what to do anymore... :(
Reply
Thanks given by:
#2
hm

First of all I would advise you to only do one loop over all 400 objects and check for everything instead of looping 400 objects several times.
Second: I don't really understand why you reload the target inside the if in the for loop, if you want to act upon that certain target that met the condition you need to reload it outside of the loop - otherwise you will always have object number 399 loaded behind each loop (as the if case already executes the loadTarget on every loop and you go all the way to the end of each one).

edit: long story short: put the loadTarget(AR/PL) behind the loops.
Reply
Thanks given by: samael
#3
Yin Yin... I sincerely have no words to thank you. I've spent all my day trying to make it work. As you can see i'm not a pro doing this... I've learned it on your tutorials. Really thanks for your support and patience with noobs XD
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)