Demo mode detection

Started by Black_Dahlia_Isis, February 22, 2005, 03:10:46 PM

Previous topic - Next topic

Black_Dahlia_Isis

If someone cares...

May be the most easy mode to detect. As when the round start you're already full of power. (In training mode, the power grows at the beginning).


So, to detect demo mode (to set AI->ON), go to the pre-intro state of your char (the [state 190], may be in mugen\data\common1.cns, and copy/paste it in your char.cns file. Then add only these lines :

[State 190, 4] ; AI in demo mode
type = VarSet
trigger1 = Power > 2990    ; This number has to be close to char's power max value
trigger1 = Time = 0
value = 1                            ; <- The var value is set to 1
v = 0                                   ; <- This is var(0)


May be you can test :
trigger1 = Power = 3000
This would work but as I don't know how the engine fill the power bar at this time... I prefered to put the version above.

As far as I remember it's compatible with Winane's Activation code, where Var(0)=1 means AI is activated.

AFAIK, Winane didn't add a special part for that demo mode.
The good point here, is that we can be 100% sure* that AI is going to be activated even before the start of the show.


* : Except may be if you add Winane's Training detection mode bonus :
; ONLY if desired:
[State -2, Start Full]
...

or some same stuffs...

Byakko

Quotetrigger1 = Power > 2990
... > const.powermax-10 or something that would more or less look like that (rarely touch anything about those consts - and don't even tell me about the new trigger shortcuts in WinMugen)
That would be more universal, eh
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Black_Dahlia_Isis

#2
True, you pointed some syntax I don't master yet, thxs. :-*

EDIT : fixed
, and btw if anyone else (especially W. ;)) has some things to say to improve this code, be my guest. :)

:P

EDIT2 : disfixed ;D

Byakko

I don't master it either, this syntax is probably wrong, actually  :-*  :grin3:
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Black_Dahlia_Isis

Bwaaaa ! :P This may explain why I didn't remember it ! :P

Let's have a look... ::)

PotS

that will activate the a.i. if your simul mode partner starts the round already with power

and pre-intro state is 5900 :tongue2:
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

Black_Dahlia_Isis

Quote from: P.o.t.S. on February 22, 2005, 10:46:30 PM
that will activate the a.i. if your simul mode partner starts the round already with power

??? :)

Can you give more details ?

In which mode ? with how many players ? CPUs ? in which round state/number ?

Quote from: P.o.t.S. on February 22, 2005, 10:46:30 PMand pre-intro state is 5900 :tongue2:

Quote from: common1.cns;---------------------------------------------------------------------------
; PREINTRO
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 190, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(190)
value = 190

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = 191

5900 (which is not "pre-intro" but "initialize") appears only at round 2 and 3 not at the first one AFAIK.

Anyway, I add the feature to Pocket_Chun-li so you'll be able to test it on your own and if bug there is, please kick me violently ! ;D

Well in fact, feedback would be enough... ^_^

Sheng Long

Actually, State 5900 does activate in round 1. We just don't see that because it goes strait into the characters intro state, 190, or 191.

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0

[State 5900, 3] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
value = 190

"You must defeat my flaming
dragon punch to stand a chance."

Byakko

#8
Quote from: the docs
------------------------------------------------------------
PowerMax
------------------------------------------------------------

Returns the maximum amount of power the player can have. This is normally 3000 (level 3).
Format:
 PowerMax
Arguments:
 none
Return type:
 int
Error conditions:
 none
Example:
 trigger1 = power < powermax / 2
   True if player has less than half his maximum power.
There...
WinMugen version, won't work with DOS
I'm pretty sure there's something with const.data(power) or something like that (I still don't know) for DOS
But that'll still be more universal than power > 2990 for chars that have 2 or 9 powerbars (like, your own Pocket ChunLi ??)
Kissu :-*
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Kung Fu Man

I think I get what Phantom is pointing out...try putting Chun-Li in training mode, and tap F4: Demo Mode will kick on.

PotS

#10
Quote from: Black Dahlia Isis on February 23, 2005, 09:24:47 AM
Can you give more details ?

In which mode ? with how many players ? CPUs ? in which round state/number ?
simul mode (with partner), any round
there are chars that start with a full power bar (especially sfa3 and dbz chars), so trigger1 = Power > 2990 will activate the a.i.

tested it already

add this to any char other than chun-li:
[State -2, power]
type=poweradd
trigger1=1
value=9999

then play in simul mode, choosing chun-li and that other char as your team
bam, a.i. activated  >:)

EDIT: or add that piece of code in chun-li and play in any mode :P

Quote5900 (which is not "pre-intro" but "initialize") appears only at round 2 and 3 not at the first one AFAIK.
all the same
5900 occurs every round, usually to reset the variables

QuoteAnyway, I add the feature to Pocket_Chun-li so you'll be able to test it on your own and if bug there is, please kick me violently ! ;D
:smash:

and what k.f.m. said is also true
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

Byakko

#11
Short :
this thread has no useful purpose.
BDI, owned by the Guild. :laugh: ;)


|| Yes, I'm just teasing him around a bit ;)
V
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Kung Fu Man

Not quite. The code is flawed, but not worthless :P Just needs to be adjusted.

Black_Dahlia_Isis

Quote from: Kung Fu Man on February 23, 2005, 08:19:37 PM
I think I get what Phantom is pointing out...try putting Chun-Li in training mode, and tap F4: Demo Mode will kick on.

Damn !  >:( :'( your right...

Quote from: S.t.o.P. on February 23, 2005, 11:40:07 PM
simul mode (with partner), any round
there are chars that start with a full power bar (especially sfa3 and dbz chars), so trigger1 = Power > 2990 will activate the a.i.

tested it already

add this to any char other than chun-li:
[State -2, power]
type=poweradd
trigger1=1
value=9999

then play in simul mode, choosing chun-li and that other char as your team
bam, a.i. activated  >:)
:o Right ? ??? I'll have a look.

...

Tested, and.. I guess I missed something because I didn't see any unwished demo mode activation ??? I added your code to a char, made him partner of Pocket Chun, and tested various Team mode with partnership set as "simul" and noticed nothing wrong... ???

Quote from: S.t.o.P. on February 23, 2005, 11:40:07 PMEDIT: or add that piece of code in chun-li and play in any mode :P
Mwahahaha :D this is a new mission for captain obvious ! :P Of course this works ONLY if your char doesn't start fighting with fullfilled power gauge... The thing I was ignoring was :
Quote from: S.t.o.P. on February 23, 2005, 11:40:07 PMthere are chars that start with a full power bar (especially sfa3 and dbz chars)
That.  :-\

Quote from: S.t.o.P. on February 23, 2005, 11:40:07 PMall the same
5900 occurs every round, usually to reset the variables
Yeah you're right I was wrong, sorry. :)

Quote from: Byakko on February 23, 2005, 11:57:23 PM
Short :
this thread has no useful purpose.
BDI, owned by the Guild. :laugh: ;)
Yeah, i need to be lashed on public place for that crappy attempt ! :yes:

Quote from: Kung Fu Man on February 24, 2005, 01:26:11 AM
Not quite. The code is flawed, but not worthless :P Just needs to be adjusted.
Damn KFM, you're too kind, kick me too ! ;D

PotS

you're right
i wasn't aware that mugen fills the powerbar slowly during roundstate=1
so only with F4
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

Black_Dahlia_Isis

oooh, soka.

So may be this code is not as damn crappy shit as I though.

Is F4 reinitialise gametime too ?

may be that should be a keypoint to prevent this bug.

PotS

Quote from: Black Dahlia Isis on February 27, 2005, 03:28:52 PM
Is F4 reinitialise gametime too ?

may be that should be a keypoint to prevent this bug.
yep
just add a var that says if those triggers were already read
that way if you press F4 the triggers won't work again
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

BlackJack

IIRC Faye managed to set up a code to achieve the same goal as yours, on Dev. Maybe should you ask her, or The Slipator?


When you say "demo", you mean "training", correct? And "CPU mode" = "AI", right?
Because if you want "to activate AI in that CPU mode", you only need to set "Dummy Control" to AI, wait, then put it back to "Cooperative" or "Manual": the opponent will now do the moves you've coded in his custom AI.

S.D.

Maybe demo as in, don't press anything in the menu?

Byakko

Faye's code was for the Training mode as far as I recall, not Demo. Difference is how fast power increases :P
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.