![]() |
|
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
|
Most problems solved! Here is the video about my product :) - totokwok - 08-12-2012 Hi all and thanks to those who helped me, Eventually I finished the AI scripts for characters in this mod ![]() OLD------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Hi, here is the question: Suppose there is a character which has a move that does not cost mp and his state is 17 while doing the move, the frames are unknown. Is there a method to stop him from continuing this move when an opponent is near him? this is a weird problem I know, but I have tried adding the following but it didn't work anyway: Code: if ( target.x - self.x <= 100 && self.state == 17 ) {
D();
}it seems that he can't stop the move even the conditions are met.. Thanks for reading (and there may be more questions soon)
RE: some stupid questions - Silverthorn - 08-12-2012 Have you tried "D(1,0)"? Also, something which might lead to unexpected results is that you're not using the abs()-function. When the target's x-value is less than your x-value, it'll be definitely below 100, but it could also be something like -700 (which would still meet the condition). RE: some stupid questions - totokwok - 08-12-2012 (08-12-2012, 03:31 PM)Blue Phoenix Wrote: Have you tried "D(1,0)"? Also, something which might lead to unexpected results is that you're not using the abs()-function. When the target's x-value is less than your x-value, it'll be definitely below 100, but it could also be something like -700 (which would still meet the condition). thanks for the quick reply! Code: if ( abs(target.x - self.x) <= 100 && self.state == 17 ) {
D(1,0);
}still, it doesn't work.. Is state 17 special that AI will lost any target so the conditions aren't met?[/code] RE: some stupid questions - YinYin - 08-12-2012 i think it is this is probably due to you using the ego function which is only called and run when the original basic AI of the game thinks its time to do a special move to my experience characters tend to not care while drinking (state 17) and not run the ego function at all - so you might need to write a whole id function to fix this also if your own frames are unknown but you do know you are in state 17 how do you know pressing D will end this? quite weird RE: some stupid questions - totokwok - 08-12-2012 (08-12-2012, 04:05 PM)YinYin Wrote: i think it is this is probably due to you using the ego function which is only called and run when the original basic AI of the game thinks its time to do a special move The script isn't for my own character, he's made by others. There is a mod that all dat and sprites are moleboxed. You should know which I'm talking about. thank you for you help anyway.. I'm afraid I'm not able to rewrite the whole AI by myself so I can eventually give up this idea because of this nvm.RE: some stupid questions - YinYin - 08-12-2012 but even if its moleboxed and you can run AI scripts on it you will be able to find out which frames are used by printing them out RE: some stupid questions - totokwok - 08-12-2012 (08-12-2012, 04:29 PM)YinYin Wrote: but even if its moleboxed and you can run AI scripts on it you will be able to find out which frames are used by printing them out oh ... indeed.. but using frames instead of state seems won't alter the result.. I have tried with "(self.frame >= 235) && (self.frame <= 398)" previously.
RE: some stupid questions - YinYin - 08-12-2012 yes the problem remains if the ego function doesnt run during state 17 oh well ... RE: some stupid questions - Azriel - 08-13-2012 i haven't checked since the angelscript change, but my ai for davis ages ago did tell him to stop drinking and dash away (or sometimes (try to) throw the milk at the enemy) Azriel~ RE: some stupid questions - totokwok - 08-13-2012 (08-13-2012, 11:36 AM)Azriel Wrote: i haven't checked since the angelscript change, but my ai for davis ages ago did tell him to stop drinking and dash away (or sometimes (try to) throw the milk at the enemy) thank you. would you mind to share the relevant script for it? |