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 

The ULTIMATE Condemned:Criminal Origins script!

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



Joined: 01 Feb 2007
Posts: 35

Digg It
PostPosted: Sun Feb 11, 2007 5:02 am    Post subject: The ULTIMATE Condemned:Criminal Origins script!

Updated to v1.2 to fix some bugs and added moves, as of Feb 11-07

This will let you play easily and have fun, or the old normal way if you choose! (Sensor Bar required). No PPJOY needed. Read below for details on how to play.... If anyone has a better working IR mouse, let me know please!

Let me know what you think!

Code:



// Condemned:Criminal Origins-THE ULTIMATE SCRIPT-BY TERRY HAGERTY  V 1.2

//All you need to do to set this up is make sure your Condemned:Criminal Origins controls are at their default.

/* This script lets you play much easier and more fun, or the old normal way if you choose! (Sensor Bar required)

HOW TO PLAY

The default controls are as follows:

Just walk around forward and backward with the Nunchuk joystick. It will NOT look up or down but it
will turn you left and right. This makes the game very easy to play.

To guard, just hold the Nunchuk upright. To Grab/Use, Flick the Nunchuk to the right.

To attack just swing the Wii Remote left/right/forward (for that direction attack) OR push the "B" button.

To kick just FLICK the Wii Remote backward (but NOT while holding C ).

To do a Finishing Move Hold Down "C" and swing the Nunchuk in a direction for that attack, OR Hold Down "C"
and use the remote's dpad.

To taser just push the A button.

Traditional Controls:

If you wish to use more traditional controls, hold down Z. Now your Nunchuk joystick will strafe left and right
instead or looking left/right and move forward/backward. This also enables the Wii Remote to act as your mouse.
So now you will look left/right and up/down with the remote (good for guns or camera control). This
also lets you move your pointer when needed.

The button controls are as follows:
Taser = Wiimote.A
Attack/Fire = Wiimote.B
Menu = Wiimote.Home
Sprint = Wiimote.Plus
Grab/use = Wiimote.Minus
Check Ammo = Wiimote.Up
Flashlight = Wiimote.Down
Ready Tool = Wiimote.Left
Change Melee = Wiimote.Right


HAVE FUN!
*/
//This varible controlls the ammount of force you need to use when moving the
//wiimote or nunchuk, make it lower if you want to use less force when moving the
//wiimote or nunchuk

var.ForceSensitivity=20

//Assigning variables
mouse.rightbutton=key.up
mouse.leftbutton=key.down

// Mouse look Left and Right-No Z button

if wiimote.Nunchuk.ZButton =false then
Mouse.DirectInputX = Mouse.DirectInputX + 20 * DeadZone(Wiimote.Nunchuk.JoyX, 10%)

// Swing right
if (Wiimote.RawAccX > var.ForceSensitivity, Wiimote.RawAccX < -var.ForceSensitivity) then
key.a =true
press key.down
wait 100ms
key.a=false
release key.down
wait 100ms
else
key.a = false
key.d = false

endif


endif

//Walk forward and backward
key.w = wiimote.Nunchuk.JoyY < -0.5
key.s = wiimote.Nunchuk.JoyY > 0.5

//Hold up Nunchuk to Block
key.up=wiimote.nunchuk.pitch > 50 and wiimote.nunchuk.pitch < 190

//Taser
mouse.middlebutton = Wiimote.A
//Attack/Fire
mouse.leftbutton = Wiimote.B
// Menu
key.esc = Wiimote.Home
//Sprint
Key.LeftShift = Wiimote.Plus
// Grab/use
key.e = Wiimote.Minus or (Wiimote.Nunchuk.RawAccx > var.ForceSensitivity,Wiimote.Nunchuk.RawAccx < -var.ForceSensitivity)

if wiimote.Nunchuk.CButton =false then
//Check Ammo
key.r = Wiimote.Up
// Flashlight
key.f= Wiimote.Down
//Ready Tool
key.t = Wiimote.Left
//Change Melee
tab = Wiimote.Right
endif

//Finishing Moves
if wiimote.Nunchuk.CButton =true then
//Ram
key.1=Wiimote.Up or (Wiimote.Nunchuk.RawAccy > var.ForceSensitivity, Wiimote.Nunchuk.RawAccy < -var.ForceSensitivity)
//Slam
key.2=Wiimote.Down or (Wiimote.Nunchuk.RawAccy < -var.ForceSensitivity, Wiimote.Nunchuk.RawAccy > var.ForceSensitivity)
//Slap
key.3=Wiimote.Left or (Wiimote.Nunchuk.RawAccx > var.ForceSensitivity, Wiimote.Nunchuk.RawAccx < -var.ForceSensitivity)
//Punch
key.4=Wiimote.Right or (Wiimote.Nunchuk.RawAccx < -var.ForceSensitivity, Wiimote.Nunchuk.RawAccx > var.ForceSensitivity)
endif


// Swing Back
if (Wiimote.RawAccy < -var.ForceSensitivity, Wiimote.RawAccy > var.ForceSensitivity) then
key.w = wiimote.Nunchuk.JoyY < -100
key.s = wiimote.Nunchuk.JoyY > 100
key.s =true
press key.down
wait 100ms
key.s=false
release key.down
wait 100ms
key.w = wiimote.Nunchuk.JoyY < -0.5
key.s = wiimote.Nunchuk.JoyY > 0.5
endif




// Swing Left
if (Wiimote.RawAccX < -var.ForceSensitivity,Wiimote.RawAccX > var.ForceSensitivity) then
press key.down
wait 100ms
release key.down
wait 100ms
endif



// Kick
if (Wiimote.RawAccy > var.ForceSensitivity, Wiimote.RawAccy < -var.ForceSensitivity) then
press (key.space)
wait 100ms
release (key.space)
wait 100ms
endif

////////////////////////////////////////////////////////////

/// Second configuration. NORMAL controls for walk,strafe,and aim.
///  Hold down Z button to use.

if wiimote.nunchuk.zbutton=true then
key.w = wiimote.Nunchuk.JoyY < -0.5
key.s = wiimote.Nunchuk.JoyY > 0.5
key.a = wiimote.Nunchuk.JoyX < -0.5
key.d = wiimote.Nunchuk.JoyX > 0.5



//MOUSE AIM START
//Full mouse aiming and movement START....
// If you have a better IR script, replace the following until you see
// "END OF MOUSE AIMING" at the bottom of this script

//Setup the input (so you can use any analog input with this code
var.InputX = Wiimote1.Dot1X // X component
var.InputXRangeStart = 0 Pixels // Smallest X value possible
var.InputXRangeEnd= 1023 Pixels //Biggest X value possible
var.InputXRangeSiz= (var.InputXRangeEnd- var.InputXRangeStart ) //calculates the size of the avaiable range
var.InputY = Wiimote1.Dot1Y  // Y component
var.InputYRangeStart = 0 Pixels // Smallest Y value possible
var.InputYRangeEnd = 767 Pixels //Biggest Y value possible
var.InputYRangeSiz= (var.InputYRangeEnd- var.InputYRangeStart ) //calculates the size of the avaiable range
var.InputEnabled=  Wiimote1.Dot1Vis //checks to see if the data is avaiable



// how much of the Y axis us destuned to "Absolute" motion,
// more than this in either direction will go into "Relative" mode
var.RangeX=(var.InputXRangeSiz / 4)
// how much of the Y axis us destuned to "Absolute" motion,
// more than this in either direction will go into "Relative" mode
var.RangeY= (var.InputYRangeSiz / 4) 
var.eyesizeX= 300 Mickeys //the size of the "Absolute" X movement in DirectInput units
var.eyesizeY= 225 Mickeys //the size of the "Absolute" y movement in DirectInput units
var.edgespeedX= 30mickeys //Speed of the X axis when in "relative" mode
var.edgespeedY= 20Mickeys //Speed of the Y axis when in "relative" mode



if (var.InputEnabled)then   //if the data is avaiable process it
// X offset in relation to the relative position
var.Xloc= -MapRange(var.InputX, var.InputXRangeStart , var.InputXRangeEnd, -var.eyesizeX,var.eyesizeX)mickeys
// Y offset in relation to the relative position
var.Yloc=  MapRange(var.InputY, var.InputYRangeStart , var.InputYRangeEnd, -var.eyesizeY,var.eyesizeY)mickeys
 //not used anymore, returns the distance from the relative position, I choose to use the distance per axis instead
var.dist    =sqrt(sqr((var.InputXRangeSiz/2) - var.InputX)+ sqr((var.InputYRangeSiz/2)- var.InputY))



var.text= ""
//if X is bigger than the Absolute range then process it as relative
if (   sqrt(sqr((var.InputXRangeSiz /2) - var.InputX)) > var.RangeX) then
// change the relative position based on the direction the cursor is
var.MiddleX = var.MiddleX+ (Maprange(var.Xloc, -Var.EyeSizex,var.eyesizex, -var.edgespeedX,var.EdgeSpeedX))
var.text =var.text+"edging X "       //adds to  the debug thing what it is doing
endif
//if Y is bigger than the Absolute range then process it as relative
if (   sqrt(sqr((var.InputYRangeSiz /2) - var.InputY)) > var.RangeY) then
// change the relative position based on the direction the cursor is
var.MiddleY = var.MiddleY+ (Maprange(var.Yloc, -Var.EyeSizeY,var.eyesizeY, -var.edgespeedY,var.EdgeSpeedY))
var.text= var.text+ "edging Y "        //adds to the debug thing what it is doing
endif

//if inside the absolute rnage then do whatever it is required
if ((sqrt(sqr(((var.InputYRangeSiz)/2) - var.InputY)) <= var.RangeY)) OR (   sqrt(sqr((var.InputXRangeSiz/2) - var.InputX)) <= var.RangeX)then

var.Text=var.Text+"local "// not much to be done, only ads to the debug thing what it is doing


endif
debug = var.text+ Mouse.DirectInputPos
//Position the DirectInput cursor based on what it has processed
Mouse.DirectInputPos = [var.MiddleX + var.Xloc, var.MiddleY + var.Yloc]
endif


//END OF MOUSE AIMING

endif

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