Little Fighter Empire - Forums
Most problems solved! Here is the video about my product :) - Printable Version

+- Little Fighter Empire - Forums (https://lf-empire.de/forum)
+-- Forum: Little Fighter 2 Zone (https://lf-empire.de/forum/forumdisplay.php?fid=7)
+--- Forum: AI Scripting (https://lf-empire.de/forum/forumdisplay.php?fid=56)
+--- Thread: Most problems solved! Here is the video about my product :) (/showthread.php?tid=8166)

Pages: 1 2


RE: some stupid questions - Boop - 08-13-2012

Are you talking about NTSD and the move being the recharge move? Nave modified the basic AI to do that(so all characters do it), if it's doing the charging move then special move AI shouldn't run.

I could be wrong, but I'm pretty sure this is the case.


RE: some stupid questions - totokwok - 08-14-2012

okay.. but it's not the original NTSD since it uses LF2 1.9c and it can not run with AI scripts. The one I'm working on is the 'Final Edition' (not official) by someone else which uses LF2 2.0 and does not have basic AI, but I think this mod is quite interesting so I had an idea to run AI scripts on it for fun. (built-in AI in NTSD 2.4 isn't really good anyway except id 21)




Question 2: How to ensure the AI use specific move only when there is one opponent?

Code:
for (int i = 0; i < 8; ++i){ if ( target.team != self.team && target.num != self.num && target.hp > 0){ k = k + 1; }} if (k == 1){ DdJ(); }

does it work on ego function?




EDIT: solved.. it should be
Code:
int k = 0; for (int i = 0; i < 400; ++i){ if ( loadTarget(i) == 0 &&target.team != self.team && target.num != self.num && target.hp > 0){ k = k + 1; }} ... ...





Question 3: Sometimes the AI won't alter his facing before doing some moves like DvA , D^J etc (He faces left when target is on his right)

Code:
if ( abs(self.x-target.x) >= 171 && abs(self.x-target.x) <= 390 && abs(self.z-target.z) <= 10 ) { if (target.x > self.x){ right(1,0); DdA(); } else { left(1,0); DdA(); }}





Question 4: Anything wrong with the script below? Many 'good's were printed but he only punched without triggering a move ( A D )
Code:
if (abs(self.x-target.x) >= 91 && abs(self.x-target.x) <= 370) { A(); if ((self.x-target.x >= 91) && ((self.x-target.x) <= 370) && (self.frame >= 60) && (self.frame <= 67) ) { if (target.x > self.x) { D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); print("good"); } else { D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); D(); print("good"); }}



RE: some stupid questions ((NEW question on page 2)) - Boop - 08-14-2012

Question 3:

You need to turn left/right first, then do the move.

Question 4: First of all why do you have so many D();'s ?! I don't really know why it's not working, check all your inputs before and after.


RE: some stupid questions ((NEW question on page 2)) - totokwok - 08-14-2012

(08-14-2012, 01:09 PM)Lord Silva Wrote:  Question 3:

You need to turn left/right first, then do the move.

Question 4: First of all why do you have so many D();'s ?! I don't really know why it's not working, check all your inputs before and after.

about Question 3: i think i understand.. trying.. sorry, any simple example? :(


about Question 4: just a test, but he never Defend...



RE: some stupid questions ((NEW question on page 2)) - Boop - 08-14-2012

3: Check if you are facing the proper way. If you are not, press left/right. If you are facing the right way then it'll do the move. This way it is done over 2 frames and not one.

4: Are you sure there is a hit_d in those frames?


RE: some stupid questions ((NEW question on page 2)) - totokwok - 08-14-2012

(08-14-2012, 02:50 PM)Lord Silva Wrote:  3: Check if you are facing the proper way. If you are not, press left/right. If you are facing the right way then it'll do the move. This way it is done over 2 frames and not one.

4: Are you sure there is a hit_d in those frames?

4: sure, at least when I use that character, I can press A then press D when he's punching and do the move. also, most AI can do 'A J' moves randomly as I know

3: ok.. I will try it


RE: some stupid questions ((NEW question on page 2)) - Silverthorn - 08-14-2012

Thing is that, once the script is run, it executes within a single frame (something which you probably can't do). You'd have to check if you're in the correct frame (self.frame == 60 || self.frame == 65, etc., assuming we're talking about the regular punch).


RE: some stupid questions ((NEW question on page 2)) - totokwok - 08-14-2012

(08-14-2012, 03:05 PM)Blue Phoenix Wrote:  Thing is that, once the script is run, it executes within a single frame (something which you probably can't do). You'd have to check if you're in the correct frame (self.frame == 60 || self.frame == 65, etc., assuming we're talking about the regular punch).

got it! thanks!!


for 3:
I still can't make it ... :s
Code:
if ( abs(self.x-target.x) >= 151 && abs(self.x-target.x) <= 390&& abs(self.z-target.z) <= 4 && target.x > self.x ) { if ( self.facing){ DdA(); } else { if ( target.x > self.x && !self.facing){ right(1,0); }}} if ( abs(self.x-target.x) >= 151 && abs(self.x-target.x) <= 390&& abs(self.z-target.z) <= 4 && target.x < self.x ) { if ( !self.facing){ DdA(); } else { if ( target.x < self.x && self.facing){ left(1,0); }}}

When he meet the condition and face the opponent, he does nothing except jumping.. and sometimes do the move when he's not facing the opponent... confused

aww I think I messed with self.facing and !self.facing ... I replaced self.facing with !self.facing and vice versa, seems that it works