Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Most problems solved! Here is the video about my product :)
#1
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)
Reply
Thanks given by:
#2
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).
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by: totokwok
#3
(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]
Reply
Thanks given by:
#4
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
Reply
Thanks given by: totokwok
#5
(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
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

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.


Reply
Thanks given by:
#6
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
Reply
Thanks given by: totokwok
#7
(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

Shock 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.
Reply
Thanks given by:
#8
yes the problem remains if the ego function doesnt run during state 17
oh well ...
Reply
Thanks given by:
#9
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~
Reply
Thanks given by: totokwok
#10
(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)



Azriel~

thank you. would you mind to share the relevant script for it?
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)