YesNoOk
avatar

Demo mode detection (Read 17760 times)

Started by Black_Dahlia_Isis, February 22, 2005, 03:10:46 pm
Share this topic:
Demo mode detection
#1  February 22, 2005, 03:10:46 pm
  • ****
  • ~ Esprit guerrier ~
    • madahine.net/bdi/
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 :

Code:
[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 :
Code:
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 :
Code:
; ONLY if desired:
[State -2, Start Full]
...
or some same stuffs...
Last Edit: February 22, 2005, 03:47:00 pm by Black Dahlia Isis
Re: Demo mode detection
#2  February 22, 2005, 03:15:47 pm
  • avatar
  • ******
Quote
trigger1 = 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.
Re: Demo mode detection
#3  February 22, 2005, 03:17:55 pm
  • ****
  • ~ Esprit guerrier ~
    • madahine.net/bdi/
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
Last Edit: February 22, 2005, 03:50:20 pm by Black Dahlia Isis
Re: Demo mode detection
#4  February 22, 2005, 03:33:47 pm
  • avatar
  • ******
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.
Re: Demo mode detection
#5  February 22, 2005, 03:42:13 pm
  • ****
  • ~ Esprit guerrier ~
    • madahine.net/bdi/
Bwaaaa ! :P This may explain why I didn't remember it ! :P

Let's have a look... ::)
Re: Demo mode detection
#6  February 22, 2005, 10:46:30 pm
  • ******
    • Portugal
    • network.mugenguild.com/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.
Re: Demo mode detection
#7  February 23, 2005, 09:24:47 am
  • ****
  • ~ Esprit guerrier ~
    • madahine.net/bdi/
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 ?

and pre-intro state is 5900 :tongue2:

common1.cns said:
;---------------------------------------------------------------------------
; 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... ^_^
Re: Demo mode detection
#8  February 23, 2005, 05:07:22 pm
  • ******
  • Video Game Veteran
  • Can you do it? SUREYOUCAN!
    • USA
    • gcnmario.free.fr
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.

Code:
;---------------------------------------------------------------------------
; 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."
Re: Demo mode detection
#9  February 23, 2005, 05:52:19 pm
  • avatar
  • ******
the docs said:
------------------------------------------------------------
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.
Last Edit: February 23, 2005, 05:59:51 pm by Byakko

Kung Fu Man

Re: Demo mode detection
#10  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.
Re: Demo mode detection
#11  February 23, 2005, 11:40:07 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
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

Quote
5900 (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

Quote
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
: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.
Last Edit: February 23, 2005, 11:54:28 pm by S.t.o.P.
Re: Demo mode detection
#12  February 23, 2005, 11:57:23 pm
  • avatar
  • ******
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.
Last Edit: February 24, 2005, 08:51:17 am by Byakko

Kung Fu Man

Re: Demo mode detection
#13  February 24, 2005, 01:26:11 am
Not quite. The code is flawed, but not worthless :P Just needs to be adjusted.
Re: Demo mode detection
#14  February 24, 2005, 02:47:03 pm
  • ****
  • ~ Esprit guerrier ~
    • madahine.net/bdi/
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...

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... ???

EDIT: 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 :
there are chars that start with a full power bar (especially sfa3 and dbz chars)
That.  :-\

all the same
5900 occurs every round, usually to reset the variables
Yeah you're right I was wrong, sorry. :)

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:

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
Re: Demo mode detection
#15  February 25, 2005, 11:32:32 pm
  • ******
    • Portugal
    • network.mugenguild.com/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.
Re: Demo mode detection
#16  February 27, 2005, 03:28:52 pm
  • ****
  • ~ Esprit guerrier ~
    • madahine.net/bdi/
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.
Re: Demo mode detection
#17  March 02, 2005, 12:13:15 am
  • ******
    • Portugal
    • network.mugenguild.com/pots/
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.
Re: Demo mode detection
#18  April 13, 2005, 04:23:48 am
  • avatar
  • ******
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.
Re: Demo mode detection
#19  April 13, 2005, 04:39:50 am
  • ******
  • ゴゴゴゴゴ
Maybe demo as in, don't press anything in the menu?
Re: Demo mode detection
#20  April 13, 2005, 10:49:35 am
  • avatar
  • ******
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.