YesNoOk
avatar

GameTime Randomizing not working? (Read 778 times)

Started by Disconcorde, February 27, 2020, 06:50:42 PM
Share this topic:
GameTime Randomizing not working?
#1  February 27, 2020, 06:50:42 PM
  • avatar
  • **
    • UK
I've been trying to edit Oni-Miko-Reimu so that she won't spam the same attacks all the time. She already has decent AI, and I'm not anywhere near the skill level to even create basic AI but I noticed that her ChangeStates of which there were many caused some events of spamming one attack. I think it's because I added too many new states for her to change into that her AI wasn't programmed for.

So I tried to condense it into one ChangeState which has a value of var(45).

Var(45) is supposed to change during various stages of GameTime%100. - However this isn't working, and causes her to just spam one attack. As in, it's changing to State 12034, which means Var(45) isn't changing like it is supposed to and I don't know why.

I have checked prior to make sure it isn't being used elsewhere; it's not.

I thought also that the issue may have been with the ChangeState changing to the State that var(45) was rather than what it "is."
So I added the trigger2 to the initial VarSet to set it back to 0. This didn't help either.

Spoiler, click to toggle visibilty



Either way I don't know why this isn't working, and I really thought that it would.
Last Edit: February 29, 2020, 12:43:27 AM by Disconcorde
Re: GameTime Randomizing not working?
#2  February 28, 2020, 04:52:28 AM
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Try something more failproof like

Varadd
trigger1 = 1
Var(45)= 1

VarSet
Trigger1 = var(45) >= 100
var(45) = 0

Re: GameTime Randomizing not working?
#3  February 28, 2020, 10:15:15 AM
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Urgh...

Why not just do a big null command
 Type = null
Triggerall = gametime%100
Trigger1 = random < 60 && var(45) := 12034
Trigger2 = random < 60 && var(45) := 14001
Trigger3 = random < 60 && var(45) := 32568
Trigger4 = random < 60 && var(45) := 8000

One of those will wind up true each time even if during evaluation it triggers 2 or 3 of them. Keep the random low enough and it won't hit all of them each time


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: GameTime Randomizing not working?
#4  February 29, 2020, 12:11:42 AM
  • avatar
  • **
    • UK
@altoiddealer @Cyanide Okay, I will try those.

I'm still not very good at this so I'm sorry if that was dumb from the beginning but I don't exactly know how these things work.
Re: GameTime Randomizing not working?
#5  February 29, 2020, 12:43:21 AM
  • avatar
  • **
    • UK
Okay, I tried them and it didn't really help much. I'm just going to mark this obsolete and move on.
Re: GameTime Randomizing not working?
#6  March 06, 2020, 04:05:47 PM
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Okay, I tried them and it didn't really help much. I'm just going to mark this obsolete and move on.

Well see, the point of my solution is that it is very straightforward, even though it is a little bulky and not optimized and maybe not precisely what you are going for.

I always de-bugged my problems by trying to root out everything that could be causing the issue.

In this case, I'm suggesting that you use a more simple method just to ensure that something else in your coding isn't causing problems.
Get something simple to work, then start replacing it with more complicated code.