Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (Martin_HH, steyr, alibaba), 509 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Physics like in CS #33733
09/18/04 00:08
09/18/04 00:08
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Does Somebody has a simple script like in CounterStrike with
WASD-controling and jumping with space???


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Physics like in CS [Re: VeT] #33734
09/18/04 04:29
09/18/04 04:29
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
CS RULES!!!
I wrote a tutorial for you.

ok, open up the input.wdl in the template folder.
Find function _player_intentions()
replace it with this:
Code:
function _player_intentions()

{
// Set the angular forces according to the player intentions
aforce.PAN = -astrength.PAN*(KEY_FORCE.X+JOY_FORCE.X);
aforce.TILT = astrength.TILT*(KEY_PGUP-KEY_PGDN);
if(MOUSE_MODE == 0)
{ // Mouse switched off?
aforce.PAN += -astrength.PAN*MOUSE_FORCE.X*mouseview*(1+KEY_SHIFT);
aforce.TILT += astrength.TILT*MOUSE_FORCE.Y*mouseview*(1+KEY_SHIFT);
}
aforce.ROLL = 0;
// Set ROLL force if ALT was pressed
if(KEY_ALT != 0)
{
aforce.ROLL = aforce.PAN;
aforce.PAN = 0;
}
// Double the forces in case the player pressed SHIFT
/*-- if(KEY_SHIFT != 0)
{
aforce.PAN += aforce.PAN;
aforce.TILT += aforce.TILT;
aforce.ROLL += aforce.ROLL;
}--*/
// Limit the forces in case the player
// pressed buttons, mouse and joystick simultaneously
limit.PAN = 2*astrength.PAN;
limit.TILT = 2*astrength.TILT;
limit.ROLL = 2*astrength.ROLL;

if(aforce.PAN > limit.PAN) { aforce.PAN = limit.PAN; }
if(aforce.PAN < -limit.PAN) { aforce.PAN = -limit.PAN; }
if(aforce.TILT > limit.TILT) { aforce.TILT = limit.TILT; }
if(aforce.TILT < -limit.TILT) { aforce.TILT = -limit.TILT; }
if(aforce.ROLL > limit.ROLL) { aforce.ROLL = limit.ROLL; }
if(aforce.ROLL < -limit.ROLL) { aforce.ROLL = -limit.ROLL; }

// Set the cartesian forces according to the player intentions
force.X = strength.X*(KEY_W+KEY_FORCE.Y-KEY_S); // forward/back
force.Y = strength.Y*(KEY_A-KEY_D); // side to side
force.Z = strength.Z*(KEY_SPACE-KEY_CTRL); // up and down
if(MOUSE_MODE == 0)
{ // Mouse switched off?
force.X += strength.X*MOUSE_RIGHT*mouseview;
}

// Double the forces in case the player pressed SHIFT
/*-- if(KEY_SHIFT != 0)
{
force.X += force.X;
force.Y += force.Y;
force.Z += force.Z;
}--*/

// Limit the forces in case the player tried to cheat by
// operating buttons, mouse and joystick simultaneously

limit.X = 2*strength.X;
limit.Y = 2*strength.Y;
limit.Z = 2*strength.Z;

if(force.X > limit.X) { force.X = limit.X; }
if(force.X < -limit.X) { force.X = -limit.X; }
if(force.Y > limit.Y) { force.Y = limit.Y; }
if(force.Y < -limit.Y) { force.Y = -limit.Y; }
if(force.Z > limit.Z) { force.Z = limit.Z; }
if(force.Z < -limit.Z) { force.Z = -limit.Z; }
}


Then open up your levels .wdl and add include <input.wdl>; after the last include.
Then open your weapons.wdl, go to the bottom, and change this:
Code:
ON_CTRL weapon_fire;


to this:
Code:
//ON_CTRL weapon_fire;  



Then find function weapon_fire()
it should look like this:
Code:
 //////////////////////////////////////////////////////////////////////


// Desc: fire weapon
function weapon_fire()
{
weapon_firing = 1;
while(KEY_CTRL || MOUSE_LEFT) { wait(1); }
weapon_firing = 0;
}

// Desc: deselect weapon
function weapon_remove()
{
if(weapon != NULL)
{
weapon.INVISIBLE = ON;
weapon = NULL;
weapon_number = 0;
}
}


Change it to this(the red is the change):
Code:
 //////////////////////////////////////////////////////////////////////


// Desc: fire weapon
function weapon_fire()
{
weapon_firing = 1;
while( MOUSE_LEFT ) { wait(1); }
weapon_firing = 0;
}

// Desc: deselect weapon
function weapon_remove()
{
if(weapon != NULL)
{
weapon.INVISIBLE = ON;
weapon = NULL;
weapon_number = 0;
}
}


I hope you understand this.
Email me if you have any questions.

Last edited by humansandbag; 09/18/04 04:34.
Re: Physics like in CS [Re: Josh_Arldt] #33735
09/28/04 00:27
09/28/04 00:27
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Yeah thank you!!!!
This scrpit is clear!!!


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Physics like in CS [Re: VeT] #33736
10/04/04 03:29
10/04/04 03:29
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Also how can I make A and D is strafe?


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Physics like in CS [Re: VeT] #33737
10/04/04 04:32
10/04/04 04:32
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
I have already told you how to do this. I have hilighted it in red.


ok, open up the input.wdl in the template folder.
Find function _player_intentions()
replace it with this:
Code:
  

function _player_intentions()
{
// Set the angular forces according to the player intentions
aforce.PAN = -astrength.PAN*(KEY_FORCE.X+JOY_FORCE.X);
aforce.TILT = astrength.TILT*(KEY_PGUP-KEY_PGDN);
if(MOUSE_MODE == 0)
{ // Mouse switched off?
aforce.PAN += -astrength.PAN*MOUSE_FORCE.X*mouseview*(1+KEY_SHIFT);
aforce.TILT += astrength.TILT*MOUSE_FORCE.Y*mouseview*(1+KEY_SHIFT);
}
aforce.ROLL = 0;
// Set ROLL force if ALT was pressed
if(KEY_ALT != 0)
{
aforce.ROLL = aforce.PAN;
aforce.PAN = 0;
}
// Double the forces in case the player pressed SHIFT
/*-- if(KEY_SHIFT != 0)
{
aforce.PAN += aforce.PAN;
aforce.TILT += aforce.TILT;
aforce.ROLL += aforce.ROLL;
}--*/
// Limit the forces in case the player
// pressed buttons, mouse and joystick simultaneously
limit.PAN = 2*astrength.PAN;
limit.TILT = 2*astrength.TILT;
limit.ROLL = 2*astrength.ROLL;

if(aforce.PAN > limit.PAN) { aforce.PAN = limit.PAN; }
if(aforce.PAN < -limit.PAN) { aforce.PAN = -limit.PAN; }
if(aforce.TILT > limit.TILT) { aforce.TILT = limit.TILT; }
if(aforce.TILT < -limit.TILT) { aforce.TILT = -limit.TILT; }
if(aforce.ROLL > limit.ROLL) { aforce.ROLL = limit.ROLL; }
if(aforce.ROLL < -limit.ROLL) { aforce.ROLL = -limit.ROLL; }

// Set the cartesian forces according to the player intentions
force.X = strength.X*(KEY_W+KEY_FORCE.Y-KEY_S); // forward/back
force.Y = strength.Y*(KEY_A-KEY_D); // side to side
force.Z = strength.Z*(KEY_SPACE-KEY_CTRL); // up and down
if(MOUSE_MODE == 0)
{ // Mouse switched off?
force.X += strength.X*MOUSE_RIGHT*mouseview;
}

// Double the forces in case the player pressed SHIFT
/*-- if(KEY_SHIFT != 0)
{
force.X += force.X;
force.Y += force.Y;
force.Z += force.Z;
}--*/

// Limit the forces in case the player tried to cheat by
// operating buttons, mouse and joystick simultaneously

limit.X = 2*strength.X;
limit.Y = 2*strength.Y;
limit.Z = 2*strength.Z;

if(force.X > limit.X) { force.X = limit.X; }
if(force.X < -limit.X) { force.X = -limit.X; }
if(force.Y > limit.Y) { force.Y = limit.Y; }
if(force.Y < -limit.Y) { force.Y = -limit.Y; }
if(force.Z > limit.Z) { force.Z = limit.Z; }
if(force.Z < -limit.Z) { force.Z = -limit.Z; }
}



Last edited by humansandbag; 10/05/04 03:57.
Re: Physics like in CS [Re: Josh_Arldt] #33738
10/05/04 00:59
10/05/04 00:59
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
And Space- for jump?


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Physics like in CS [Re: VeT] #33739
10/05/04 03:56
10/05/04 03:56
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
Yes i have done this too.
I have hilighted SPACE for jumping and CTRL for ducking in blue
I have also hilighted W for foward and S for back in GREEN

Re: Physics like in CS [Re: Josh_Arldt] #33740
10/06/04 16:37
10/06/04 16:37
Joined: Dec 2002
Posts: 1,866
B
b_102373 Offline
Senior Developer
b_102373  Offline
Senior Developer
B

Joined: Dec 2002
Posts: 1,866
lol, Nice way of changing the script 5 stars.

Re: Physics like in CS [Re: b_102373] #33741
10/09/04 20:54
10/09/04 20:54
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Thanks
I trying to understand, what that script mean!!!


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Physics like in CS [Re: VeT] #33742
10/19/04 01:15
10/19/04 01:15
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
One more question:
How can i use scripts this csript without template docs?


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1