YesNoOk
avatar

Is there any way to make the CPU jump a little less? (Read 4763 times)

Started by Kernel panic, February 04, 2024, 07:07:06 pm
Share this topic:
Is there any way to make the CPU jump a little less?
#1  February 04, 2024, 07:07:06 pm
  • *
  • MI forever
    • Brazil
Jump, jump, jump...
Sometimes I think the pc got hacked by grayeyes2020 or somebody else...
Last Edit: February 05, 2024, 02:08:45 am by Kernel panic
Re: Is there any way to make the CPU jump a little less?
#2  February 05, 2024, 12:05:28 am
  • ****
    • crepa.neocities.org

  • Online
Yes, I do this on my chars.

- Go to your statedef 40
- Remove the anim from it (optional, if you don't the AI will be "ducking" randomly)
- Add a changestate back to state 0, the trigger should be "!Time" and "AIlevel" and a variable (or an invisible explod, or an invisible projectile) that you'll set in the CMD.
- If you removed the animation from the statedef, re-add it via changeanim, AFTER the changestate. It should look like this:

Code:
;Jumping
[Statedef 40]
type = S
physics = S
movetype = I
;Anim = 40
ctrl = 0
VelSet = 0, 0
sprpriority = 1
facep2 = 1

[State 40, Prevent AI from Randomly jump]
type = ChangeState
trigger1 = !Time && AILevel && !NumProjID(40)
value = 0
ctrl = 1

[State 40, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 40

Now, in the CMD, set the variable/explod/projectile. I like to do it via projectile. If you do it as a variable, you need to turn it off in state 40 as soon as the character enters the state, AFTER the changestate to state 0. The trick is to set the variable/explod/projectile for 1 tick only.

Code:
[State -1, Jump Flag]
type = Projectile
ProjID = 40
projanim = 1
projremovetime = 1
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType != A
triggerAll = ctrl || (StateNo = [100,101])

Add the AI triggers for when you want the AI to jump.

Code:
trigger1 = P2StateType = S && P2MoveType = A || Random < 10
trigger1 = !(EnemyNear, ctrl) && P2MoveType != H
trigger1 = Random < (100 * (AILevel ** 2 / 64.0))
trigger2 = EnemyNear, MoveType = A && P2BodyDist x < 160 && EnemyNear, HitDefAttr = SC, AT
trigger2 = Random < (250 * (AILevel ** 2 / 64.0))
trigger3 = P2StateType = C && (P2BodyDist x = [40,100]); && P2MoveType != A
trigger3 = Random < (250 * (AILevel ** 2 / 64.0))

Now you add the changestate, but the trigger should only check for the variable/explod/projectile.

Code:
[State -1, Jump]
type = ChangeState
value = 40
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType != A
triggerAll = ctrl || (StateNo = [100,101])
trigger1 = NumProjID(40)

There is probably a better way to do it but this is my method. Hope it helps! :]
Re: Is there any way to make the CPU jump a little less?
#3  February 05, 2024, 02:08:13 am
  • *
  • MI forever
    • Brazil
Thank you! that looks very promising  :)