Mr. Game & Watch - .CNS Coding help - Code Library - Blaze mugen forums
Tuesday, 2009-11-24, 1:26 Pm
Welcome Guest

Blaze M.U.G.E.N

Blaze mugen forums

[New messages · Members · Forum rules · Search · RSS ]
Page 1 of 212»
Blaze mugen forums » Code Library » .CNS Coding help » Mr. Game & Watch
Mr. Game & Watch
Waluigi99Date: Tuesday, 2008-03-11, 9:13 Pm | Message # 1
Training
Group: Users
Messages: 32
Reputation: 0
Status: Offline
I need Help Doing Mr. Game & Watches Judgement move in mugen (The move ware he pulls out different numbers 1 - 9 Randomly Generated) So if somebody could help me with how to use the random varialble or something that would be nice.

Waluigi

Message edited by Waluigi99 - Tuesday, 2008-03-11, 9:27 Pm
 
Sir_KillzalotDate: Wednesday, 2008-03-12, 6:43 Pm | Message # 2
MuGeN Expert
Group: Users
Messages: 349
Reputation: 12
Status: Offline
the way to randomize moves is use the random trigger

info:

Code

------------------------------------------------------------

Random

------------------------------------------------------------

     

R eturns a random number between 0 and 999, inclusive.

     

Format:

    Random

     

Arguments:

    none

     

Return type:

    int

     

Error conditions:

    none

     

Example:

    trigger1 = Random <= 249

      Triggers if the random number returned is less than or equal to

      249. (This occurs with 25% probability.)

Should be pretty easy to understand.

Message edited by Sir_Killzalot - Wednesday, 2008-03-12, 6:47 Pm
 
Waluigi99Date: Wednesday, 2008-03-12, 10:01 Pm | Message # 3
Training
Group: Users
Messages: 32
Reputation: 0
Status: Offline
What Does The 249 Represent?

Waluigi
 
OmnifoxDate: Thursday, 2008-03-13, 5:14 Am | Message # 4
MuGeN Mayhem
Group: Users
Messages: 174
Reputation: 3
Status: Offline
249 is the max number you want to generate. So you want to replace 249 with 9 when you code the move.

Do you understand the rest?


Current W.I.P. :

.... still have not added all the required sprites yet. <_<

 
Sir_KillzalotDate: Thursday, 2008-03-13, 1:43 Pm | Message # 5
MuGeN Expert
Group: Users
Messages: 349
Reputation: 12
Status: Offline
Quote

249 is the max number you want to generate. So you want to replace 249 with 9 when you code the move.
Do you understand the rest?

Sorry that is not right.

ok a random generator generates 1 number between 0 to 999 in the current state

so...
trigger1 = random <= 111 ;would be when the number is bellow 111 or a 11.111111% chance

trigger1 = random > 111 ; would be when the number is greater than 111 or a 88.8888888% chance

Message edited by Sir_Killzalot - Thursday, 2008-03-13, 1:44 Pm
 
Waluigi99Date: Thursday, 2008-03-13, 3:06 Pm | Message # 6
Training
Group: Users
Messages: 32
Reputation: 0
Status: Offline
I want it to randomly pick between 9 Different ANIMATIONS because for each one the sprites are different.
I don't Quite Understand what you were explaining.

Waluigi
 
Sir_KillzalotDate: Friday, 2008-03-14, 1:16 Pm | Message # 7
MuGeN Expert
Group: Users
Messages: 349
Reputation: 12
Status: Offline
use a changeanim with a random trigger

Code

------------------------------------------------------------

ChangeAnim

------------------------------------------------------------  

   

Changes the action number of the player's animation.

   

Required parameters:

   value = anim_no (int)

     anim_no is the action number to change to.

   

Optional parameters:

   elem = elem_no (int)

     elem_no is the element number within the specified action

     to start from.

   

Example:

   none

   

ex:

[State *]
type = ChangeAnim
trigger1 = random <= 111
value = 210

 
OmnifoxDate: Friday, 2008-03-14, 10:54 Pm | Message # 8
MuGeN Mayhem
Group: Users
Messages: 174
Reputation: 3
Status: Offline
lol sorry about that I was thinking about some other code.

Current W.I.P. :

.... still have not added all the required sprites yet. <_<

 
Waluigi99Date: Saturday, 2008-03-15, 4:29 Pm | Message # 9
Training
Group: Users
Messages: 32
Reputation: 0
Status: Offline
Now I Just Have One Question, How Would I Code the Hole Move, just give Me What I need so I understand.

Waluigi
 
Sir_KillzalotDate: Sunday, 2008-03-16, 12:58 Pm | Message # 10
MuGeN Expert
Group: Users
Messages: 349
Reputation: 12
Status: Offline
You will need 9 hitdefs and 9 changeanim

1 hitdef and 1 changeanim per level

just use the same random trigger for the hitdef and changanim of the specific level

...and then add any other effects you want to the attack.

 
Waluigi99Date: Monday, 2008-03-17, 11:45 Am | Message # 11
Training
Group: Users
Messages: 32
Reputation: 0
Status: Offline
[StateDef 1001]
type = S
movetype= A
physics = S
juggle = 1
velset = 0,0
ctrl = 0
anim = 1001
poweradd = 20
sprpriority = 2

[State 1001, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 23
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 10
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

[State 1001]
type = ChangeAnim
trigger1 = random < 111
value = 1001
;-----------------------------------
[StateDef 1002]
type = S
movetype= A
physics = S
juggle = 1
velset = 0,0
ctrl = 0
anim = 1002
poweradd = 20
sprpriority = 2

[State 1002, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 23
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 10
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

[State 1002]
type = ChangeAnim
trigger1 = random < 111
value = 1002

If this is what you meen it does not Work that Well.


Waluigi
 
Sir_KillzalotDate: Monday, 2008-03-17, 1:14 Pm | Message # 12
MuGeN Expert
Group: Users
Messages: 349
Reputation: 12
Status: Offline
you really only need one statedef for all attacks.

Also the hitdefs trigger should also be a random trigger

 
Waluigi99Date: Monday, 2008-03-17, 4:35 Pm | Message # 13
Training
Group: Users
Messages: 32
Reputation: 0
Status: Offline
Its Not working, I keep getting errors and i dont know how to keep it in all one statedef.
My error is I need at leased 1 trigger.

Waluigi
 
Sir_KillzalotDate: Monday, 2008-03-17, 8:10 Pm | Message # 14
MuGeN Expert
Group: Users
Messages: 349
Reputation: 12
Status: Offline
One of your states is missing a trigger1 so find the state that has it missing

Example of one statedef with two different types of attacks:

[StateDef 1001]
type = S
movetype= A
physics = S
juggle = 1
velset = 0,0
ctrl = 0
anim = 1001
poweradd = 20
sprpriority = 2

[State 1001, 1]
type = HitDef
trigger1 = random < 111
attr = S, NA
damage = 23
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 10
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

[State 1001]
type = ChangeAnim
trigger1 = random < 111
value = 1001

[State 1001, 2]
type = HitDef
trigger1 = random > 111
attr = S, NA
damage = 9999999
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 10
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

[State 1001]
type = ChangeAnim
trigger1 = random > 111
value = 1002

Message edited by Sir_Killzalot - Monday, 2008-03-17, 8:10 Pm
 
blazeincDate: Tuesday, 2008-03-18, 4:35 Pm | Message # 15
Admin
Group: Administrator
Messages: 377
Reputation: 13
Status: Offline
nice codes sirkillzalot and thanks for helping out on the site, but i guess the blazeMuGeN project will not ever start since NOBODY WILL
DO ANYTHING ABOUT IT, and NOBODY REALLY CARES. It dont matter i will make this project with other people in private and i will make
mugen version 2, my style.

|-| /\ |< |= R

 
Waluigi99Date: Wednesday, 2008-03-19, 6:51 Am | Message # 16
Training
Group: Users
Messages: 32
Reputation: 0
Status: Offline
I put the code you gave an example for and it just sits there on the first animation. And he sits there until he gets attacked.

Waluigi
 
Sir_KillzalotDate: Wednesday, 2008-03-19, 1:24 Pm | Message # 17
MuGeN Expert
Group: Users
Messages: 349
Reputation: 12
Status: Offline
add this to the code above:

[State 1001, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Then it should go back to stand state.

Note: This should be put at the end of all moves.

 
blazeincDate: Thursday, 2008-03-20, 6:14 Am | Message # 18
Admin
Group: Administrator
Messages: 377
Reputation: 13
Status: Offline
Code
add this to the code above:

[State 1001, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Then it should go back to stand state.

Note: This should be put at the end of all moves.

lol this should even be generated by fighter factory or when u make a hit def. who ever dont have

Code
[State 1001, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

should seriously fix up in mugen or at least start learning mugen beofre posting stupid things but what ever.


|-| /\ |< |= R

 
Waluigi99Date: Thursday, 2008-03-20, 7:35 Am | Message # 19
Training
Group: Users
Messages: 32
Reputation: 0
Status: Offline
Even With That Code There it randomly chooses an animation but it sits at the first frame till attacked

Waluigi
 
Sir_KillzalotDate: Thursday, 2008-03-20, 1:57 Pm | Message # 20
MuGeN Expert
Group: Users
Messages: 349
Reputation: 12
Status: Offline
I forgot a trigger that must be added.

add this to each of the states

trigger1 = anim = (1001 or 1002 depending on which group you are adding the trigger too)

Without this line of code there will be an infinite loop.

 
Blaze mugen forums » Code Library » .CNS Coding help » Mr. Game & Watch
Page 1 of 212»
Search:

Login form
E-mail:
Password:
Site friends
Site Admins
Blazeinc (A.K.A UrOz)
Our poll
which character series are the best for mugen
Total of answers: 1007
Created By UrOz | Blazeinc