Simple things. - 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: Simple things. (/showthread.php?tid=8877) Pages:
1
2
|
RE: Simple things. - Azriel - 08-16-2013 (target.state != 12 || target.state != 18) what it checks: my target's state is not 12, OR, my target's state is not 18. if my target's state is 12, then it is true that my target's state is not 18. therefore my condition is true. if my target's state is 18, then it is true that my target's state is not 12. therefore my condition is true. if my target's state is 9001, then it is true that my target's state is not 12. therefore my condition is true. (target.state != 12 || target.state != 18) is not equivalent to (target.state !=12 && target.state != 18) Azriel~ RE: Simple things. - Silverthorn - 08-16-2013 (08-16-2013, 12:58 PM)Gad Wrote:Well, can you phrase in words how you want it to be?(08-15-2013, 01:31 PM)Blue Phoenix Wrote: The third condition will always yield true.doesn't In case you're thinking of something along the lines of "target.state may be neither 12 nor 18", the above snippet is correct. Guess you managed to confuse me completely in my last post (08-16-2013, 12:58 PM)Gad Wrote:Heh, I just wanted to be on the safe side(08-15-2013, 01:31 PM)Blue Phoenix Wrote: Just to rule out anything, do you call "get_closest_enemy()" in your AI? Also, have you tried to print out the target-index + its xdistance? Have you tried to print out object-id AND xdistance to see if it changes at all? Maybe even print out all t0-objects currently in-game and check manually if it picked the right one? az u so ninja-y RE: Simple things. - Gad - 08-16-2013 I was thinkin in other way. target.state !=( 12 || 18) Is target other than (12 or 18)? 9001 if target state!=(12x or 18x ) alternative(12x or 18x )= 0 !0 = 1 ANSWER: YES! 18 if target state!=(12x or 18v ) alternative(12x or 18v ) = 1 !1 = 0 ANSWER: NO 12 if target state!=(12v or 18x ) alternative(12v or 18x ) = 1 !1 = 0 ANSWER: NO I'm really confused now, if this should work. xDD I'm probably wrong, but this seems reasonable for me. Let's stick with: target.state !=12 && target.state != 18 I thought I can write it shorter. You will probably come in with a solution to my problem anyway, to show me how wrong I am. (08-16-2013, 01:11 PM)Azriel Wrote: (target.state != 12 || target.state != 18)But is (target.state != 12 || target.state != 18) equavilent to (target.state != (12 || 18))? EDIT: ANOTHER QUESTION Just theoretical, cause I'm not willing to test it right now. Can I ask the AI to ignore weapons in that way: - Check target, if target is a weapon, then select other target Won't it be buggy? |