Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
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
6 registered members (3run, AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip), 605 guests, and 0 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 3 1 2 3
[Workquestions] Pipes, Ramps and Loops #260065
04/08/09 18:42
04/08/09 18:42
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Ok.. i´m working on a template Project for my workshop. But got a little Problem...

I created a Level. inside is a straigth way, with a little half-pipe at the end. The way and the pipe are made of 13 plates. The pipe is built of 6 models. each has a higher roll-value ( to rotate it to a half-pipe ).

Now i created a ball on the way. i want the ball to fly straight on, ask for the pipe-plates roll value.. and set the balls own tilt to the you.roll

Problem:
i´m tracing below the hero:
Code:
action player_action()
{
	player = my;
	wait(1);
	c_setminmax(my);
	while(1)
	{
		c_trace(my.x,vector(my.x,my.y,my.z-9999),IGNORE_ME);
		if(you != NULL){my.tilt = you.roll;}
		
		if(key_a == 1){c_move(my,vector(1*time_step,0,0),nullvector,GLIDE);}
		
		vec_set(camera.x, vector(my.x,my.y-400,my.z));
		wait(1);
	}
}


ok.. works fine. The plate gives his roll-value to the ball. BUT.
Now the tilt of the ball is 15 ( the roll-value of the 1st pipe-plate ).
But the c_trace is scanning straight down... How to say the tracing, to trace into the new direction?


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260070
04/08/09 19:26
04/08/09 19:26
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
first create a downvector (0,0,-1000) by your trace-depth(here 1000) and vec_rotate it by the players angle. then add the balls coordinates to it (vec_add) and that is your position to trace to.

Re: [Workquestions] Pipes, Ramps and Loops [Re: Scorpion] #260074
04/08/09 19:34
04/08/09 19:34
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
what??? o.O ( sry.. still german ^^ i´m not as good in those complex sentences )


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260099
04/08/09 21:32
04/08/09 21:32
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
take out c_trace(my.x,vector(my.x,my.y,my.z-9999),IGNORE_ME); and replace with
Code:
VECTOR tmpV;
vec_set(tmpV, vector(my.x,my.y,my.z-9999) );
vec_rotateaxis(tmpV, my.x, my.pan);
c_trace(my.x, tmpV, IGNORE_ME);
as per scorpions suggestion.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260100
04/08/09 21:49
04/08/09 21:49
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hmm.. seems not wo work...
Here´s a video ( the text at the upper left side shows the tilt angle of the player.. )


The ball only reacts to the first tilted Plate of the pipe ( the tilt-panel shows always 15 after hitting the first Pipe-Plate )

It only works if i make the ball smaller...

Last edited by Espér; 04/08/09 21:52.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260105
04/08/09 22:09
04/08/09 22:09
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Cant do any testing ATM, but try
c_trace(my.x, tmpV, IGNORE_ME|USE_BOX);


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260109
04/08/09 22:25
04/08/09 22:25
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hmm.. k.. There´s just another problem with the movement...

The ball rotates to the plates tilt/roll...
But, the distance to the plates is getting smaller.. and via my.z, i can´t change it...

Here´s a video again:


and the code:
Code:
action plate()
{
	set(my,FAT);
	wait(1);
	c_setminmax(my);
	vec_set(my.min_x, vector(my.min_x+1, my.min_y+1, my.min_z+1));
	vec_set(my.max_x, vector(my.max_x+1, my.max_y+1, my.max_z+1));
	set(my,BRIGHT);
	set(my,POLYGON);
}

action player_action()
{
	player = my;
	set(my,POLYGON);
	vec_set(my.scale_x,vector(0.5,0.5,0.5));
	wait(1);
	c_setminmax(my);
	while(1)
	{
		VECTOR tmpV;
		vec_set(tmpV, vector(my.x,my.y,my.z-9999));
		vec_rotateaxis(tmpV, my.x, my.pan);
		vec_sub(tmpV,my.x);
		c_trace(my.x, tmpV, IGNORE_ME | USE_BOX);
		if(you != NULL)
		{
			my.tilt   = you.roll;
			my.skill1 = vec_dist(my.x, target.x);
			if(my.skill1 < 20 && my.skill1 < 15)
			{
				c_move(my,vector(0,0,10*time_step),nullvector,GLIDE);
			}
			if(my.skill1 > 20)
			{
				c_move(my,vector(0,0,-10*time_step),nullvector,GLIDE);
			}
		}
		
		if(key_a == 1){c_move(my,vector(30*time_step,0,0),nullvector,GLIDE);}
		
		vec_set(camera.x, vector(my.x,my.y-400,my.z));
		wait(1);
	}
}


Last edited by Espér; 04/08/09 22:51.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260116
04/08/09 23:11
04/08/09 23:11
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
untested but you should be able to see what Im TRYING to achieve.
Code:
action player_action()
{
	player = my;
	vec_set(my.scale_x,vector(0.5,0.5,0.5));
	wait(1);
	c_setminmax(my);
	VECTOR tmpV;
	while(1)
	{
		vec_set(tmpV, vector(my.x,my.y,my.z-9999));
		vec_rotateaxis(tmpV, my.x, my.pan);
		c_trace(my.x, tmpV, IGNORE_ME | USE_BOX);
		if(you != NULL)
		{
			my.tilt   = you.roll;
			my.skill1 = vec_dist(my.x, you.x);
			if(my.skill1 < 20)
			{
				c_move(my,vector(0,0,20-my.skill1),nullvector,GLIDE);
			}
		}
		
		if(key_a == 1){c_move(my,vector(30*time_step,0,0),nullvector,GLIDE);}
		
		vec_set(camera.x, vector(my.x,my.y-400,my.z));
		wait(1);
	}
}



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260118
04/08/09 23:24
04/08/09 23:24
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
uhm..

1.)
the ball shouldn´t touch the ground.. he should fly above it, in a maximum high of 20.. and a minimum high of 15.


2.)
i added my.skill1 ( the distance to the trace-target ) to the Panel.
But if the Ball is at the highest point, my.skill1 is 500 and higher o.O

But the distance looks smaller ^^



The red point is the position, the ball has to be if everythings works...

the blue ring shows the distant of the ball to the ground ( in the picture, the ground is up-right to the ball ).. but 533 seems a bit to much...
And the Tilt-Angle of the ball ( in Picture it is 39 ) seems to be wrong there..

Last edited by Espér; 04/08/09 23:27.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260122
04/08/09 23:41
04/08/09 23:41
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
This is omething I'll need testing time to do, and Im at work surrounded by
people who would notice me working on this.
Its going to have to wait 8 hours or so, unless people knock off early for easter weekend.

Any chance of me getting the whole project zipped?
If its not too hard, save me having to build a testbed to test your code in.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 1 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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