
Board: M.U.G.E.N Development Help
What does this safemode do and why this happens only for some characters?
I tried to look for the information, but there is nothing about this.
Removetime should be the same as destroyself or probably longer so the knife stays for a bit after helper is destroyed. Maybe a trigger1 = Numexplod(638) = 0 should be added so multiple knifes don't appear if move is used again.
The only way to make this work really is to either remove ctrl completely so the default ai can never jump. Or override jump start to send the player back to prevstateno if ai is on and the conditions you want aren't met. You'll need a variable OR to use a special jump start state for this one.
For specific names Left to right I call them:
Bitwise Or, Or, Modulo, And.
As a whole they are often called binary operators, arithmetic operators, etc. In the forum we have a thread where you can find detailed information for each one: https://mugenguild.com/forum/msg.1971235
Here's an example of an AI snippet for one of my chars, Eighteen and in particular for her multiple fireball move, with some comments for your learning:
;AI Blitz Deadend
[State -1, AI Blitz Deadend]
type = ChangeState
triggerall = AILevel>0 && numenemy && roundstate=2 && StateType != A trigger when AI is on, there's an enemy, during the match and while on the ground
triggerall = NumHelper(1500)<3 ; Blitz Deadend limiter checks that we have not reached the max number of moves
triggerall= (enemy,stateno!=[120,155])&&(enemy,stateno!=[5100,5120]) && (enemy,vel x>=0) the move will be performed when the enemy is not blocking, or lying on the ground and while the enemy is moving forward
trigger1 = ctrl && time>5 && random < 50*(AIlevel ** 2 / 64.0) time>5 gives a reaction of at least 5 frames for the AI, to simulate a command input- the part following the random is an AI scaler, resulting in a harder AI when AI level is higher
trigger2 = ((stateno = 200) || (stateno = [210,215]) || (stateno = 220))
trigger2 = movehit && random < 100*(AIlevel ** 2 / 64.0)
trigger3 = ((stateno = 230) || (stateno = 240) || (stateno = 250))
trigger3 = movehit && random < 100*(AIlevel ** 2 / 64.0)
trigger4 = ((stateno = 400) || (stateno = 410) || (stateno = 420))
trigger4 = movehit && random < 100*(AIlevel ** 2 / 64.0)
trigger5 = ((stateno = 430) || (stateno = 440) || (stateno = 450))
trigger5 = movehit && random < 100*(AIlevel ** 2 / 64.0)
trigger6 = stateno = 100 || stateno = 101
trigger6 = random < 50*(AIlevel ** 2 / 64.0) all these conditions are to ensure a combo chain from a previous specific hit and with a variable rate of successing at the combo
value = Cond(p2bodydist y<0,1500,1500+10*(random%3)) if the AI activates one of the above conditions, then if the enemy is jumping, she will do the backwards version to stay safe. If the enemy is not jumping then she will perform any of the 3 versions
As you can see, the scenario is pretty simple for this specific move, but it gives a human feeling and reaction on when to perform a move, and also open to mistakes
AI is an awesome spot for a beginner to start in my opinion. I think the main thing you should focus on is making sure that AI can't do anything that a player wouldn't be able to do. This is easily achieved by making sure you have the right triggers on the AI changestates. Sounds obvious but I still see that mistake.
Using random is really useful and there are a few different ways that people use it with ailevel for scaling the AI.Pots has a cool example of this work really well, if you are looking for an example.Actually this would probably be more useful to checkout https://mugenguild.com/forum/msg.2321829
If you want to get into more advanced AI, you can start thinking about disabling default AI walk, jump since a human player would never do those at random. Coming up with the logic for your own can be really fun.
For me the best AI is the ones that seem really human. Not insanely overpowered or perfect, still makes mistakes but also makes solid choices.
Think of how you would like the character to play and react, and code it. AI is nothing more than just preparing scenarios and adding them to a list
To make it simple
Trigger1 = helper(1225)>=1
Trigger1 = p2bodydist x =[-40,40]
Trigger1 = abs(p2bodydist y)
Hope this helps
MGMURROW
trigger1 = helper(1225), p2bodydist x = [-40,40] && abs(p2bodydist y) < 20But it makes mugen crash, so I assume I can't write like that. Can you help me? I need to write 'If the enemy is close to this object'.
Iirc helpers spawn with their parents life value although they can't die. So they start at 1000. I forget if you can spawn them with different health values but variables is the most reliable way to manage a helpers existence as they have thier own set of 60.
For example, I am making Susanoo for a char and I want to make it, so it has its own HP, separate from main char's.just use lifeset in the helper's state