Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (flink, VoroneTZ, AndrewAMD), 1,230 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19056 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Moving an object #243853
01/01/09 08:02
01/01/09 08:02
Joined: Oct 2008
Posts: 67
pewpew Offline OP
Junior Member
pewpew  Offline OP
Junior Member

Joined: Oct 2008
Posts: 67
if you have a tank, and you want to move it, is this the proper proceedure? -

1) apply physics to tank
2) move tank using c_move and c_rotate

i cant seem to get it working properly.

EDIT: heres the code i am trying to use - but it just jilts the tank left/right/up/down, then it returns to the original coordinates.

Code:
action move_tank()
{

	while(1)
	{
		//forward and reverse
		if(key_pressed(17) == 1)
			c_move(me, vector(10,0,0), nullvector, IGNORE_PASSABLE);
		if(key_pressed(31) == 1)
			c_move(me, vector(-10,0,0), nullvector, IGNORE_PASSABLE);
			
		//rotation
		if(key_pressed(30) == 1)
			c_rotate (me, vector(2,0,0), IGNORE_PASSABLE);
		if(key_pressed(32) == 1)
			c_rotate (me, vector(-2,0,0), IGNORE_PASSABLE);
		   
		//downwards
		if(key_pressed(46) == 1)
			c_move(me, vector(0, 0, -20 * time_step), nullvector, IGNORE_PASSABLE);
		wait(1);
	}
}


for some reason, only rotation works. and it only does so if i hold down key 46 (which presses the tank against the level)

Last edited by pewpew; 01/01/09 08:52.

HURRR DERP DERP DEERRPP HURR
Re: Moving an object [Re: pewpew] #243862
01/01/09 09:39
01/01/09 09:39
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
c_move only works then the object is not stuck in the floor or a wall. Why dont you learn about moving in the tutorial, look here:

http://www.conitec.net/litec/work18.htm

Re: Moving an object [Re: Petra] #243966
01/01/09 23:26
01/01/09 23:26
Joined: Oct 2008
Posts: 67
pewpew Offline OP
Junior Member
pewpew  Offline OP
Junior Member

Joined: Oct 2008
Posts: 67
yeah it was actually workshop 18 and 19 i was using to teach myself. i still cant seem to get it to work?

so you say DONT use c_move if u are using physics??


HURRR DERP DERP DEERRPP HURR
Re: Moving an object [Re: pewpew] #243989
01/02/09 01:31
01/02/09 01:31
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
You might have better luck with this:

Code:
action move_tank()
{
  VECTOR speed;
  ANGLE rotAng;
  while(1)
  {
     rotAng.pan = 2 * (key_a - key_s) * time_step;
     c_rotate(my,rotAng,IGNORE_PASSABLE);
     speed.x = 10 * (key_w - key_s) * time_step;
     c_move(my,speed,nullvector,IGNORE_PASSABLE | GLIDE);
     wait(1);
  }
}



I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: Moving an object [Re: heinekenbottle] #244005
01/02/09 05:01
01/02/09 05:01
Joined: Oct 2008
Posts: 67
pewpew Offline OP
Junior Member
pewpew  Offline OP
Junior Member

Joined: Oct 2008
Posts: 67
nope.. still doesnt work. ive been stuck on this for literally 2 months. its so annoying and frustrating frown

and i mean, its such a simple concept but i cant seem to find the correct solution!!!!

should i upload the project?


HURRR DERP DERP DEERRPP HURR
Re: Moving an object [Re: pewpew] #244010
01/02/09 06:16
01/02/09 06:16
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Hmmmm, So what's your version?

Re: Moving an object [Re: Cowabanga] #244015
01/02/09 07:23
01/02/09 07:23
Joined: Oct 2008
Posts: 67
pewpew Offline OP
Junior Member
pewpew  Offline OP
Junior Member

Joined: Oct 2008
Posts: 67
just the free version. i'm guessing there could be a conflict with commands that are restricted to the paid versions??


HURRR DERP DERP DEERRPP HURR
Re: Moving an object [Re: pewpew] #244019
01/02/09 07:41
01/02/09 07:41
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Not the edition, i mean the version. BTW, you can use c_move in the free version. wink

Re: Moving an object [Re: Cowabanga] #244075
01/02/09 14:23
01/02/09 14:23
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Moving an object [Re: Michael_Schwarz] #244137
01/02/09 22:16
01/02/09 22:16
Joined: Jan 2009
Posts: 86
Brasil - RS
D
DiegoFloor Offline
Junior Member
DiegoFloor  Offline
Junior Member
D

Joined: Jan 2009
Posts: 86
Brasil - RS
I'm just beginning to learn too, so I may be wrong. But I think that when you're using physics you need to work with forces to move things around. I don't know how's your model, but depending on it you could apply a torque in the wheels or a simple force, pointing forward, in the gravity center of the whole object.

[edit: actually, I don't think it matters if the force is in the gc]
[edit2: actually, I don't think you can choose where to apply the force on an object! grin ]

Last edited by DiegoFloor; 01/02/09 22:29.
Page 1 of 2 1 2

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