YesNoOk
avatar

Change state according to life level (Read 162 times)

Started by Mikelel, June 03, 2012, 10:48:56 pm
Share this topic:
Change state according to life level
#1  June 03, 2012, 10:48:56 pm
  • avatar
  • *
Normally I don't open many topics, even I've solved various problems myself -always those were not so difficult-.  :sugoi:

But this time I don't know how: to write an AI command to force CPU to change state according to life level.  :???:

Any tip?   Thanks in advance.

GT

Re: Change state according to life level
#2  June 03, 2012, 10:59:33 pm
  • *****
  • Don't fuck with me, Jack!
    • USA
You mean like this?
[mcode]
type=changestate
value = ifelse(life < 500, 2000, 1500)[/mcode]
 
or

[mcode]
triggerall = life < 500[/mcode]
 

When you say 'force', is your intention to get the cpu to perform a behavior no matter what is happening to them (gethit, customstate, midcombo)?
Yeah Titiln, in fact, You Made Him

2OS

Re: Change state according to life level
#3  June 03, 2012, 11:42:13 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
life<ceil(lifemax/2) is better than life<500 cos of the options setting for life percentage.

and move this to the root of development help.


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: Change state according to life level
#4  June 04, 2012, 12:24:45 am
  • avatar
  • *
Tried all of these, and nothing works :(

I guess there is another code which is working instead of these -in terms of priority and such-.

*sigh*
Re: Change state according to life level
#5  June 04, 2012, 07:25:55 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
Tried all of these, and nothing works :(

I guess there is another code which is working instead of these -in terms of priority and such-.

*sigh*

I don't understand why it wouldn't work, unless you have a conflicting changestate controller with the same triggers like for example:

[mcode]
[State -1, High Life Hadooken]
trigger1 = AILevel > 0
...
value = 1000

[State -1, Low Life Hadooken]
trigger1 = AILevel > 0
trigger1 = life < 500
...
value = 1200
[/mcode]

in the above even if you have less than 500 life the first one will still occur. You need to add a life >= 500 trigger to that one in that case. It would help to see the code you have so far so we have a better understanding of what youre trying to do, as well as what you did wrong.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.