WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To use 4 wiimote to play combat emulator game ?

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
wtz54321



Joined: 31 Mar 2007
Posts: 2

Digg It
PostPosted: Sat Mar 31, 2007 10:33 am    Post subject: To use 4 wiimote to play combat emulator game ?

I write some code to test if I can use 2 wiimote to conrol to left , 2 level punch and 2 level kick ... I only know how to let Key.left = true if wiimote.1 and wiimote.2 move together ...

But My idea is to use 4 wiimote to control 1 player

If I attach Wiimote.1 to left hand , Wiimote.2 to right hand
Wiimote.3 to left leg , Wiimote.4 right leg

If wiimote.3 move forward and wait for a second wiimote.4 move forward
or wiimote.4 move forward and wait for a second wiimote.3 move forward
then Key.Right=True

If wiimote.3 move backward and wait for a second wiimote.4 move backward
or wiimote.4 move backward and wait for a second wiimote.3 move backward
then Key.Left=True

If wiimote.3 and wiimote.4 move upward together then Key.Up=True

If wiimote.1 and wiimote.2 move downward together then Key.Down=True

If wiimote.1 or wiimote.2 level 1 acceleration detected , then Key.A=true=Level 1 Punch

If wiimote.1 or wiimote.2 level 2 acceleration detected , then Key.S=true=Level 2 Punch

If wiimote.1 or wiimote.2 level 3 acceleration detected , then Key.D=true==Level 3 Punch

If wiimote.3 or wiimote.4 level 1 acceleration detected , then Key.Z=true=Level 1 Kick

If wiimote.3 or wiimote.4 level 2 acceleration detected , then Key.X=true=Level 2 Kick

If wiimote.3 or wiimote.4 level 3 acceleration detected , then Key.C=true=Level 3 Kick

I am bad in code language , anyone can help me to translate the requirement to final scrip ?
===============================================

var.xOffset = 8
var.yOffset = -37
var.zOffset = 12

var.xRot1 = Wiimote1.RawForceX + var.xOffset
var.yRot1 = Wiimote1.RawForceY + var.yOffset
var.zRot1 = Wiimote1.RawForceZ + var.zOffset

var.xRot2 = Wiimote2.RawForceX + var.xOffset
var.yRot2 = Wiimote2.RawForceY + var.yOffset
var.zRot2 = Wiimote2.RawForceZ + var.zOffset

debug = "X=" + var.xRot + " Y=" + var.yRot + " Z=" + var.zRot

if var.yRot1 > 30 then
var.L1 = True
else
var.L1 = False
endif

if var.yRot1 > 70 then
var.P1 = Wiimote1.A and not (Wiimote1.B or Wiimote1.Minus or Wiimote1.Home or Wiimote1.Plus or Wiimote1.One or Wiimote1.Two)
else
var.P1 = False
endif

if var.yRot1 > 10 but < 40 then
var.P3 = Wiimote1.A and not (Wiimote1.B or Wiimote1.Minus or Wiimote1.Home or Wiimote1.Plus or Wiimote1.One or Wiimote1.Two)
else
var.P3 = False
endif

if var.yRot2 > 30 then
var.L2 = True
else
var.L2 = False
endif

if var.yRot2 > 70 then
var.P2 = Wiimote2.A and not (Wiimote2.B or Wiimote2.Minus or Wiimote2.Home or Wiimote2.Plus or Wiimote2.One or Wiimote2.Two)
else
var.P2 = False
endif

if var.yRot2 > 10 but < 40 then
var.P4 = Wiimote2.A and not (Wiimote2.B or Wiimote2.Minus or Wiimote2.Home or Wiimote2.Plus or Wiimote2.One or Wiimote2.Two)
else
var.P4 = False
endif

if var.L1 = True and var.L2= True then
var.LL = True
else
var.LL = False
endif

Key.Left = var.LL
Key.A = var.P1
Key.S = var.P2
Key.D = var.P3
Key.F = var.P4
Back to top
View user's profile Send private message
wtz54321



Joined: 31 Mar 2007
Posts: 2

Digg It
PostPosted: Sat Mar 31, 2007 3:15 pm    Post subject:

Some Update

===============================================
if wiimote1.RelAccY > 15 then
Wait 500 ms
Var.LC1=not (Wiimote1.A or Wiimote1.B or Wiimote1.Minus or Wiimote1.Home or Wiimote1.Plus or Wiimote1.One or Wiimote1.Two)
Wait 500 ms
Var.LC1=False
endif

if wiimote2.RelAccY > 15 then
Var.LC2=not (Wiimote2.A or Wiimote2.B or Wiimote2.Minus or Wiimote2.Home or Wiimote2.Plus or Wiimote2.One or Wiimote2.Two)
Wait 500 ms
Var.LC2=False
endif

if Var.LC1=True and Var.LC2=True then
Var.LC3=True
Key.Left=True
Wiimote1.Rumble=True
Wiimote2.Rumble=True
Wait 500 ms
Wiimote1.Rumble=False
Wiimote2.Rumble=False
Key.Left=False
endif

if wiimote1.RelAccY > 15 then
Var.LC4=not (Wiimote1.A or Wiimote1.B or Wiimote1.Minus or Wiimote1.Home or Wiimote1.Plus or Wiimote1.One or Wiimote1.Two)
Wait 500 ms
Var.LC4=False
endif

if wiimote2.RelAccY > 15 then
Wait 500 ms
Var.LC5=not (Wiimote2.A or Wiimote2.B or Wiimote2.Minus or Wiimote2.Home or Wiimote2.Plus or Wiimote2.One or Wiimote2.Two)
Wait 500 ms
Var.LC5=False
endif

if Var.LC4=True and Var.LC5=True then
Var.LC6=True
Key.Right=True
Wiimote1.Rumble=True
Wiimote2.Rumble=True
Wait 500 ms
Wiimote1.Rumble=False
Wiimote2.Rumble=False
Key.Right=False
endif

var.xOffset = 8
var.yOffset = -37
var.zOffset = 12

var.xRot1 = Wiimote1.RawForceX + var.xOffset
var.yRot1 = Wiimote1.RawForceY + var.yOffset
var.zRot1 = Wiimote1.RawForceZ + var.zOffset

var.xRot2 = Wiimote2.RawForceX + var.xOffset
var.yRot2 = Wiimote2.RawForceY + var.yOffset
var.zRot2 = Wiimote2.RawForceZ + var.zOffset

debug = "X=" + var.xRot + " Y=" + var.yRot + " Z=" + var.zRot

if var.yRot1 > 30 then
var.P1 = Wiimote1.A and not (Wiimote1.B or Wiimote1.Minus or Wiimote1.Home or Wiimote1.Plus or Wiimote1.One or Wiimote1.Two)
else
var.P1 = False
endif

if var.yRot1 > 30 then
var.P3 = Wiimote1.B and not (Wiimote1.A or Wiimote1.Minus or Wiimote1.Home or Wiimote1.Plus or Wiimote1.One or Wiimote1.Two)
else
var.P3 = False
endif

if var.yRot2 > 30 then
var.P2 = Wiimote2.A and not (Wiimote2.B or Wiimote2.Minus or Wiimote2.Home or Wiimote2.Plus or Wiimote2.One or Wiimote2.Two)
else
var.P2 = False
endif

if var.yRot2 > 30 then
var.P4 = Wiimote2.B and not (Wiimote2.A or Wiimote2.Minus or Wiimote2.Home or Wiimote2.Plus or Wiimote2.One or Wiimote2.Two)
else
var.P4 = False
endif

Key.S = var.P1
Key.A = var.P2
Key.F = var.P3
Key.D = var.P4
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group