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 

2 player lightgun game

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



Joined: 07 Apr 2007
Posts: 1

Digg It
PostPosted: Sat Apr 07, 2007 4:11 pm    Post subject: 2 player lightgun game

Hey,
first i want to thank the many users here on the forum because i can now play House of the Dead 3 on my television with my laptop an a wii remote.
Now, what would be great is to play the game with 2 players, each with a wii remote. I already tried a 2 Wii- mouse script, but that just doesnt do it. Is there a script that can fulfull my request or is it just impossible. I think is the last one will be true because it doesn't work if you use 2 regular mice. Maybe there is a possibility to translate de IR-information to a virtual analoge gamepad that the game does support. But making this in a way it's almost as good as the real thing is very hard??

Please give you're thougths, thx Smile
Back to top
View user's profile Send private message
Gleasonator



Joined: 24 Feb 2007
Posts: 46
Location: Texas

Digg It
PostPosted: Sun Apr 08, 2007 6:03 pm    Post subject:

Well what are the controls for players one and two? You can use a sensor bar and an IR script, one Wiimote working as a mouse and the other working as whatever the controls are for player two.
_________________
I like cream soda...

Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kunalkunal2



Joined: 13 Dec 2006
Posts: 279

Digg It
PostPosted: Sun Apr 08, 2007 7:08 pm    Post subject:

I don't know if this will work for house of the dead 3 but it will work for house of the dead one.

So player one uses mouse and player 2 uses the keys.
So for player one use the IR script
and for player 2
use this which uses I.R for the keyboard.

Code:
// Wiimote IR + Analog joystick (eg Nunchuk joystick) input
// mapped to digital (eg Keyboard) output, or analog (eg PPJoy) output
// Change the stuff below to match what you want
// by Carl Kenner

// Number of IR dots, set to 1 or 2
var.IRCount = 1

// change this if you only want to aim with IR sometimes, eg when they
// hold the B button would be var.Aiming = Wiimote.B
var.Aiming = True

// Additional aiming controls, for example if you want to also use the
// joystick to aim
//var.OtherJoyX = Wiimote.Nunchuk.JoyX + Wiimote.Classic.Joy1X
//var.OtherJoyY = Wiimote.Nunchuk.JoyY + Wiimote.Classic.Joy1Y

// Move this block to the bottom of the script for better performance
// Digital controls for vertical aiming
Key.Up = var.UpKey
Key.Down = var.DownKey
// Digital controls for horizontal aiming
Key.Left = var.LeftKey
Key.Right = var.RightKey
// Analog controls for vertical aiming
//PPJoy.Analog0 = var.PPJoyX
// Analog controls for horizontal aiming
//PPJoy.Analog1 = var.PPJoyY


// Find pointer coordinates 1024x768
if var.IRCount = 1 then
  if wiimote.dot1vis then
    Var.IRx = (1023-wiimote.dot1x)
    Var.IRy = Wiimote.dot1y
    Var.IRvis = true
  else
    Var.IRvis = false
  end if
else
  if wiimote.dot1vis and wiimote.dot2vis then
    Var.IRx = 1023-(wiimote.dot1x+wiimote.dot2x)/2
    Var.IRy = (Wiimote.dot1y+Wiimote.dot2y)/2
    Var.IRvis = true
  else
    Var.IRvis = false
  end if
end if

// Change in pointer position is mapped to "IR Joystick"
// You may need a minus sign in front of one of these
var.IRJoyX = MapRange(Smooth(Delta(Var.IRx),2), -20,20, -1,1)
var.IRJoyY = MapRange(Smooth(Delta(Var.IRy),2), -20,20, -1,1)

// Keep holding "IR Joystick" when aiming with pointer off the screen
if var.IRvis then
  Var.Above = Var.IRy < 80
  Var.Below = Var.IRy > 690
  Var.ToLeft = Var.IRx < 80
  Var.ToRight = Var.IRx > 940
else
  if var.Above then
    var.IRJoyY = -1   // offscreen speed
  else if var.Below then
    var.IRJoyY = 1  // offscreen speed
  end if
  if var.ToLeft then
    var.IRJoyX = -1  // offscreen speed
  else if var.ToRight then
    var.IRJoyX = 1   // offscreen speed
  end if
end if

if var.Aiming then
  var.jx = Var.OtherJoyX + var.IRJoyX + var.LeftOverX
  var.jjx = Var.OtherJoyX + var.IRJoyX + var.jLeftOverX
  var.jy = Var.OtherJoyX + var.IRJoyY + var.LeftOverY
  var.jjy = Var.OtherJoyX + var.IRJoyY + var.jLeftOverY
else
  var.jx = Var.OtherJoyX + var.LeftOverX
  var.jjx = Var.OtherJoyX + var.jLeftOverX
  var.jy = Var.OtherJoyX + var.LeftOverY
  var.jjy = Var.OtherJoyX + var.jLeftOverY
end if

if var.jx > 1 then
  var.LeftOverX = Var.jx - 1
  var.jLeftOverX = Var.jjx - 1
  var.LeftKey = false
  var.RightKey = true
else if var.jx < -1 then
  var.LeftOverX = Var.jx + 1
  var.jLeftOverX = Var.jjx + 1
  var.RightKey = false
  var.LeftKey = true
else
  var.LeftOverX = Var.jx
  var.jLeftOverX = 0
  var.LeftKey = false
  var.RightKey = false
end if

if var.jy > 1 then
  var.LeftOverY = Var.jy - 1
  var.jLeftOverY = Var.jjy - 1
  var.UpKey = false
  var.DownKey = true
else if var.jy < -1 then
  var.LeftOverY = Var.jy + 1
  var.jLeftOverY = Var.jjy + 1
  var.DownKey = false
  var.UpKey = true
else
  var.LeftOverY = Var.jy
  var.jLeftOverY = 0
  var.UpKey = false
  var.DownKey = false
end if
var.PPJoyX = EnsureRange(var.jjx, -1, 1)
var.PPJoyY = EnsureRange(var.jjy, -1, 1)
Wiimote.Led1 = 1

_________________
Check out my collection of my wii script's
freewebs.com/kunalkunal2
Back to top
View user's profile Send private message
Vixus



Joined: 29 Mar 2007
Posts: 56

Digg It
PostPosted: Sun Apr 08, 2007 11:07 pm    Post subject:

If HoD3 can use joysticks why not just map some to PPJoy? Although, I admit, I could never get PPJoy to work with an app, although Windows worked fine.
_________________
Java Coder... oh god...
Sensor bar designers... http://led.linear1.org/led.wiz
Back to top
View user's profile Send private message MSN Messenger
THEKIDD



Joined: 09 Apr 2007
Posts: 2

Digg It
PostPosted: Mon Apr 09, 2007 2:07 am    Post subject:

thx i was interested on this 2 for House of the Dead 3

ima give it a try

eidt: it works great but its a little slow how can u increase the speed

thx
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