This code makes the character not give their all until some of the specific actions occur.
They are each designed to controls the speed "random" changes via their specific control. Each is set to 999, you would obviously change that to what ever normal random condition you would like.
Description is on each trigger. If anyone thinks of improvement, or other similar versions of this trigger Id' love to hear them.
trigger1 = cond(Gametime% ((life/100)-1) = 0 ,random,1000) <= 999 ; "random"'s speed changes via health. Increase "n" in ((life/100)-n) for more active "random". fights harder if life lowered. "comeback mode"
trigger1 = cond(Gametime% ((1000/life )-1) = 0 ,random,1000) < 999 ; "random"'s speed changes via health. Increase "n" in ((life/100)-n) for more active "random". fights harder if life high. "tired mode"
trigger1 = cond(Gametime% ((1000/p2life)-1) = 0 ,random,1000) < 999 ; "random"'s speed changes via P2 health. Increase "n" in ((life/100)-n) for more active "random". fights harder if p2 life is high.
trigger1 = cond(Gametime% ((p2life/100)-1) = 0 ,random,1000) < 999 ; "random"'s speed changes via P2 health. Increase "n" in ((life/100)-n) for more active "random". fights harder if p2 life is low.
trigger1 = cond(Gametime% ((power/300)-1) = 0 ,random,1000) < 999 ; "random"'s speed changes via power. Increase "n" in ((life/300)-n) for more active "random". fights harder if power is low.
trigger1 = cond(Gametime% ((3000/power)-1) = 0 ,random,1000) < 999 ; "random"'s speed changes via power. Increase "n" in ((life/300)-n) for more active "random". fights harder if power is low.
trigger1 = cond(Gametime% ((([state 33333333, AIlevel formula]*4)/((var(44) + var(45)) / 2))-1) = 0 ,random,1000) < 999 ; "random"'s speed changes via round. Increase "n" in ((life/100)-n) for more active "random". for use with Inktrebuchet's AI Defeat System
trigger1 = cond(Gametime% floor(P2BodyDist X/100) = 0 ,random,1000) < 999 ; "random"'s speed change via P2 distance. Increase "n" in ((P2BodyDist X/n) for more active "random". fights harder if near to p2. "inside fighter"
trigger1 = cond(Gametime% floor(100/P2BodyDist X) = 0 ,random,1000) < 999 ; "random"'s speed change via P2 distance. Increase "n" in ((P2BodyDist X/n) for more active "random". fights harder if far from p2. "outside fighter"
I posted this one last night and deleted it when I realized there are other triggers that do a similar thing with less work. After going over my work I realized I could simplify it and it could be useful to someone. so I left my original work in the spoiler. It helps show the idea and how it works along with a ton of notes on how I got there.
Spoiler, click to toggle visibilty
;==========================================================================
;Inktrebuchet
;Learning AI 1/25/2017
;==========================================================================
;==========================================================================
;Goal:
;-Make AI that appears to learn.
;
;==========================================================================
;Achievements:
;-character less active at begining of round and increses activity if life lowers.
;
;==========================================================================
;notes:
;-borrowed ((root,AIlevel ** 2 / 64.0)*n) from Just No Point / XGargoyle. Used in base example of trigger use below.
;-This code controls the speed "random" changes via the amount of life.
;-The idea was to replace "random" completely with a var. But this could also be used for select changestates as well. (ones that should activate with less life or as a effort to make a 'comeback'.)
;-It could be argued that a similar effect could be used with: trigger1 = random > n && life < 500
;
;base example of trigger use: n = normal "random condition" without AI Defeat System.
;trigger1 = var(43) < (n * (AIlevel ** 2 / 64.0)) ;with AIlevel
;trigger1 = var(43) < n
;--------------------------------------------------------------------------
;==========================================================================
; AI Low Health System
;==========================================================================
[state -2] ; increase"random" speed via lower health
type = varset
trigger1 = 1
v = 42
value = (life/100)-1 ; for more activity increase n , (life/100)-n
ignorehitpause = 1
[state -2] ; "random" speed controller/timer
type = varset
trigger1 = Gametime% var(42) = 0
v = 43
value = cond(Gametime% (var(42)+1) = 0 ,random,1000) ;condition turns random off (1000) after timer activates it, resulting in "random" at different speeds.
ignorehitpause = 1
example trigger:
[state -1]
type = changstate
trigger1 = var(43) < 50 ; var(43) takes the place of random.
value = n